PDA

View Full Version : Why is this fixed proctective stop loss not working?


Metastockuser
28th July 2003, 05:27 PM
EntryTrigger := (Sum(Mov(C-O,4,S),5)-Ref(Sum(Mov(C-O,4,S),5),-1)>0) AND (Sum(Mov(C-O,6,S),6)-Ref(Sum(Mov(C-O,6,S),6),-1)>0) AND (Sum(Mov(C-O,9,S),9)-Ref(Sum(Mov(C-O,9,S),9),-1)>0) AND (Sum(Mov(C-O,5,S),6)-Ref(Sum(Mov(C-O,5,S),6),-1)>0) AND ((Mov(C-O,3,S)>(-1)*Mov(C-O,6,S)) AND (Mov(C-O,8,S)>(-1)*Mov(C-O,6,S))) AND ((Mov(C-O,11,S)>(-1)*Mov(C-O,8,S)) AND (Mov(C-O,6,S)>(-1)*Mov(C-O,8,S)));
EntryPrice := OPEN;

ExitTrigger := ((Sum(Mov(C-O,5,S),2)-Ref(Sum(Mov(C-O,5,S),2),-1)<0) AND (Sum(Mov(C-O,8,S),2)-Ref(Sum(Mov(C-O,8,S),2),-1)<0) AND (Sum(Mov(C-O,2,S),1)-Ref(Sum(Mov(C-O,2,S),1),-1)<0) AND (Sum(Mov(C-O,9,S),1)-Ref(Sum(Mov(C-O,9,S),1),-1)<0) AND ((Mov(C-O,4,S)<(-1)*Mov(C-O,4,S)) AND (Mov(C-O,7,S)<(-1)*Mov(C-O,4,S))) AND ((Mov(C-O,4,S)<(-1)*Mov(C-O,10,S)) AND (Mov(C-O,11,S)<(-1)*Mov(C-O,11,S))));
ExitPrice := OPEN;

Initialstop :=0.92*EntryPrice;

ExtFml( "TradeSim.EnableProtectiveStop",0);
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");

ExtFml( "TradeSim.RecordTrades",
"AALB Basic 8% fixed", { Trade Data Filename }
LONG, { Trade Position Type }
EntryTrigger, { Entry Trigger }
EntryPrice, { Entry Price }
0, { Optional Initial Stop }
ExitTrigger, { Exit Trigger }
ExitPrice, { Exit Price }
START); { Recorder Control }

David Samborsky
29th July 2003, 01:38 AM
All flag setting calls should be placed after a call to the Initialization routine otherwise the default values will be set.

Try changing the code to this:-

...
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.EnableProtectiveStop",0);
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
...

Metastockuser
29th July 2003, 02:39 AM
I'm really a NON programmer who is slowly being forced to learn more as I acquire these various tools. My Fixed stop losses are now up and running.

Now that I'm through that, perhaps I can advance to other stop losses without crying for help.

David Samborsky
29th July 2003, 11:30 AM
Don't be afraid to ask questions even if you think they might be trivial because this can benefit others who might be a bit intimidated.