LT
5th February 2004, 09:36 PM
Tradsim Users,
How do I get TradeSim to set my Initial stop to the low of the day before the buy?
The code below doesn't work. The initial stop SHOULD NOT be the low of the day I entered the trade. I can't set the stop on the low because I don't know what it will be until the market closes.
ExtFml( "TradeSim.Initialize"); ExtFml("TradeSim.EnableProtectiveStop",0);
Buy:= Fml( "MyBuy") = 1 ;
Sell:= Fml( "MyBuy") = 2 ;
LongInitialStop:=ValueWhen(1,buy=1 AND Ref(buy,-1)=2,L);
InitialStop:=L-.01;
EntryTrigger := Ref(Buy,-0);
EntryPrice := OPEN;
ExitTrigger := Ref(sell,-0);
ExitPrice := OPEN;
ExtFml( "TradeSim.Initialize");
{ExtFml("TradeSim.EnableDelayOfAllExitsByOneBar");
}
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.RecordTrades",
"Holy_Grail", {Trade Data Filename}
LONG, {Trade Position Type}
EntryTrigger,{Entry Trigger}
EntryPrice, {Entry Price}
InitialStop, {Optional Initial Stop}
ExitTrigger, {Exit Trigger}
ExitPrice, {Exit Price}
START); {Recorder Control}
Thanks,
LT
How do I get TradeSim to set my Initial stop to the low of the day before the buy?
The code below doesn't work. The initial stop SHOULD NOT be the low of the day I entered the trade. I can't set the stop on the low because I don't know what it will be until the market closes.
ExtFml( "TradeSim.Initialize"); ExtFml("TradeSim.EnableProtectiveStop",0);
Buy:= Fml( "MyBuy") = 1 ;
Sell:= Fml( "MyBuy") = 2 ;
LongInitialStop:=ValueWhen(1,buy=1 AND Ref(buy,-1)=2,L);
InitialStop:=L-.01;
EntryTrigger := Ref(Buy,-0);
EntryPrice := OPEN;
ExitTrigger := Ref(sell,-0);
ExitPrice := OPEN;
ExtFml( "TradeSim.Initialize");
{ExtFml("TradeSim.EnableDelayOfAllExitsByOneBar");
}
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.RecordTrades",
"Holy_Grail", {Trade Data Filename}
LONG, {Trade Position Type}
EntryTrigger,{Entry Trigger}
EntryPrice, {Entry Price}
InitialStop, {Optional Initial Stop}
ExitTrigger, {Exit Trigger}
ExitPrice, {Exit Price}
START); {Recorder Control}
Thanks,
LT