- Katılım
- 23 Eki 2020
- Mesajlar
- 1,826
DBS in TS code To: "metastock bulletin board" <metastock@xxxxxxxxxxxxx> Subject: DBS in TS code From: "Walter Lake" <wlake@xxxxxxxxx> Date: Sun, 2 Aug 1998 19:08:04 -0400 Reply-To: metastock@xxxxxxxxxxxxx Sender: owner-metastock@xxxxxxxxxxxxx Mark Etzkorn in Futures Magazine listed the following code for a "Dynamic Breakout System" in Futures Jan '98: Inputs: Ceil(60), Flr(20); Vars: X(0), Y(0), VarA(0), VarB(0), OldVarA(0); Y = X; X = Stddev(Close,30); ZDelta = (X - Y)/X; If CurrentBar = 1 then VarA = 20 OldVarA = VarA; VarA = OldVarA * (1 + ZDelta); VarA = MaxList(VarA, Flr); VarA = MinList(VarA, Ceil); VarB = VarA * 0.5; Buy tomorrow at Highest(High,VarA) stop; Sell tomorrow at Lowest(Low,VarA) Stop; ExitLong tomorrow at Lowest(Low, VarB) Stop; ExitShort tomorrow at Highest(High, VarB) Stop; - 0 - The April issue of Tech Analysis of Stocks and Commodities (TASC) had a long article starting on page 22 that appears to use a Channel Breakout System. There are many charts indicating what the system looks like. Did Metastock publish anything in the "Traders Tips" section of TASC about how to program it? Here are two out of three indicators that Futures magazine published in the March 98 issue, page 46, that are used with the DBS system. The first one is just an extension of the code listed above. The second one uses the same code but is shortened. It is placed in an inner window and shows how many days are used in the daily calculation of the variable channel length so that the volitility is clearly visible. #1 Indicator Name: DBS-Break (or DBS-Breakout) charts the entry and exit trigger levels plus the price action. Inputs: Ceil(60), Flr(20); Vars: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0), EntryL(0), EntryS(0), ExitL(0), ExitS(0); Y = X; X = Stddev(Close,30); ZDelta = (X-Y)/X; If CurrentBar = 1 then VarA = 20; OldVarA = VarA; VarA = OldVarA*(1 + ZDelta); VarA = MaxList(VarA,Flr); VarA = MinList(VarA,Ceil); VarB = VarA * 0.5; EntryL = Highest(High,VarA); EntryS = Lowest(Low,VarA); ExitL = Lowest(Low,VarB); ExitS = Highest(High,VarB); Plot1(EntryL,"EntryL"); Plot2(EntryS,"EntryS"); Plot3(ExitL,"ExitL"); Plot4(ExitS,"ExitS"); #2 Indicator Name: DBS-Day (i.e., DBS-Days in Channel) NOTE: This code is almost identical to #1 without the Entry & Exit lines and the Plot lines, the Vars: is shortened and a different Plot1 is added at the end. Inputs: Ceil(60), Flr(20); Vars: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0); Y = X; X = Stddev(Close,30); ZDelta = (X-Y)/X; If CurrentBar = 1 then VarA = 20; OldVarA = VarA; VarA = OldVarA*(1 + ZDelta); VarA = MaxList(VarA,Flr); VarA = MinList(VarA,Ceil); VarB = VarA * 0.5; Plot1(VarA,"LookBack") I believe the above is copied correctly from Futures magazine. - 0 - The following is Metastock's attempt to program the basic channel enter the following formula "BaseC" into the indicator builder. It needs to have the name of base for your system test to work. |
|
BaseC If(Cum(1)<=31,1,(((Stdev(C,30)-Ref(Stdev(C,30),-1))/Stdev(C,30))+1)*PREV) |
|
The next two formulas should be entered in the Enter Long and Enter Short of a system test. |
Base Channel System Enter Long Cross(H,Ref(HHV(H,20)+Fml("BaseC"),-1)) Enter short Cross(Ref(LLV(L,20)-Fml("BaseC"),-1),L) |
If you just want to look at the formulas on a chart enter the following into the indicator builder and plot then on top of your chart. |
|
Base Channel {Formula1} Ref(HHV(H,20) + Fml("BaseC"),-1); {Formula2} Ref(LLV(L,20) - Fml("BaseC"),-1) |
|