markcollins
27th December 2006, 10:19 PM
I want to test a system with multiple exits. I am trying to have a 28 day channel stop for the first 28 days and then switch to a 4 day channel stop.
I came up with the following code. Is this the correct way to code for what I am trying to do?
Stop1 := C<Ref(LLV(L,28),-1);
Stop2 := C<Ref(LLV(L,4),-1);
EntryTrigger := Cross(MACD(),Mov(MACD(),9,E))
EntryPrice :=Ref(C,-1) + (Ref(ATR(25),-1)*0.25);
NewEntryPrice := If(0>EntryPrice,O,EntryPrice);
ExitTrigger := If((BarsSince(EntryTrigger)>24),Stop2,Stop1);
ExitPrice := OPEN;
InitialStop:=C-(3*ATR(25));
regards
Mark
I came up with the following code. Is this the correct way to code for what I am trying to do?
Stop1 := C<Ref(LLV(L,28),-1);
Stop2 := C<Ref(LLV(L,4),-1);
EntryTrigger := Cross(MACD(),Mov(MACD(),9,E))
EntryPrice :=Ref(C,-1) + (Ref(ATR(25),-1)*0.25);
NewEntryPrice := If(0>EntryPrice,O,EntryPrice);
ExitTrigger := If((BarsSince(EntryTrigger)>24),Stop2,Stop1);
ExitPrice := OPEN;
InitialStop:=C-(3*ATR(25));
regards
Mark