bphill
5th May 2004, 02:48 AM
"TradeSim.EnableProtectiveStop" does not seem to work with TradeSim.dll v4.2.2.
I've run the same exploration with v4.0.0 and v4.2.2, both write the same initial stop to the trade database but only v4.0.0 seems to use it as a protective stop. v4.2.2 doesn't exit until my more distant trailing stop is reached.
Code as follows:
LongEntryTrigger :=
{trigger conditions};
LongEntryPrice := O;
LongExitTrigger := Cross(Ref(LLV(L,15),-1),L);
LongExitPrice := If(O < Ref(LLV(L,15),-1),O,Ref(LLV(L,15),-1)-0.01);
LongExitPrice:=If(LongExitPrice<L,L,LongExitPrice);
LongInitialStop :=Ref(LLV(LOW,3),-1)-0.01;
ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.SetStartRecordDate",1,1,1998);
ExtFml("TradeSim.SetStopRecordDate",25,4,2004);
ExtFml("TradeSim.EnableDelayOfEntryByOneBar");
ExtFml("TradeSim.EnableTradePyramiding",Trigger,0,3);
ExtFml("TradeSim.EnableProtectiveStop",0);
ExtFml("TradeSim.SetExitPriceToInitialStop");
ExtFml("TradeSim.SetStopGapPriceToOpen");
ExtFml("TradeSim.RecordTrades",
"Test v400"
,Long,longEntryTrigger,longEntryPrice,
longInitialStop,longExitTrigger,longExitPrice ,
START);
I've run the same exploration with v4.0.0 and v4.2.2, both write the same initial stop to the trade database but only v4.0.0 seems to use it as a protective stop. v4.2.2 doesn't exit until my more distant trailing stop is reached.
Code as follows:
LongEntryTrigger :=
{trigger conditions};
LongEntryPrice := O;
LongExitTrigger := Cross(Ref(LLV(L,15),-1),L);
LongExitPrice := If(O < Ref(LLV(L,15),-1),O,Ref(LLV(L,15),-1)-0.01);
LongExitPrice:=If(LongExitPrice<L,L,LongExitPrice);
LongInitialStop :=Ref(LLV(LOW,3),-1)-0.01;
ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.SetStartRecordDate",1,1,1998);
ExtFml("TradeSim.SetStopRecordDate",25,4,2004);
ExtFml("TradeSim.EnableDelayOfEntryByOneBar");
ExtFml("TradeSim.EnableTradePyramiding",Trigger,0,3);
ExtFml("TradeSim.EnableProtectiveStop",0);
ExtFml("TradeSim.SetExitPriceToInitialStop");
ExtFml("TradeSim.SetStopGapPriceToOpen");
ExtFml("TradeSim.RecordTrades",
"Test v400"
,Long,longEntryTrigger,longEntryPrice,
longInitialStop,longExitTrigger,longExitPrice ,
START);