Jackie
16th June 2004, 11:41 AM
Hi
This is my first posting. I'm probably missing something simple.
I wish to know how to exit the next day at the open price when the price has closed below my initial or protective stop.
Also I need to exit at open when the price gaps below the initial stop.
(My normal exit is fine and I exit the next day on open when the price closes below the 3.8*atr(30) trailing stop.)
I read somewhere that the SetStopGapPriceToOpen function no longer has any effect, and my following attempt is exiting me at the closing price the day after the price has closed below my protective stop.
What am I missing?
LongEntryTrigger:= Trigger;
LongEntryPrice := OPEN;
LongInitialStop:=Ref(CLOSE-2.5*ATR(30),-1);
LongExitTrigger:=ExtFml("TradeSim.TrailingStop",TRIGGER,LONG,3.8*ATR(30),HIGH,CLOSE);
LongExitPrice:=OPEN;
LongExitPrice:=If(O<LongInitialStop,O,LongExitPrice);
ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.EnableDelayOfEntryByOneBar");
ExtFml("TradeSim.EnableDelayOfAllExitsByOneBar");
ExtFml("TradeSim.EnableProtectiveStop",0);
ExtFml("TradeSim.SetExitPriceToInitialStop");
ExtFml("TradeSim.UseClosingPriceAsStopThreshold");
ExtFml("TradeSim.SetStartRecordDate",31,12,1995);
ExtFml("TradeSim.SetStopRecordDate",31,12,2004);
ExtFml( "TradeSim.RecordTrades",
"test close below", { Trade Data Filename }
LONG, { Trade Position Type }
LongEntryTrigger, { Entry Trigger }
LongEntryPrice, { Entry Price }
LongInitialStop, { Optional Initial Stop }
LongExitTrigger, { Exit Trigger }
LongExitPrice, { Exit Price }
START); { Recorder Control }
If I remove the "enable delay of all exits by one bar" then my normal exits are exiting at the open on the day of the trigger and my protective stops are exiting at the close of the breach of the initial stop.
Any help would be appreciated....
Thanks in advance
Jackie
This is my first posting. I'm probably missing something simple.
I wish to know how to exit the next day at the open price when the price has closed below my initial or protective stop.
Also I need to exit at open when the price gaps below the initial stop.
(My normal exit is fine and I exit the next day on open when the price closes below the 3.8*atr(30) trailing stop.)
I read somewhere that the SetStopGapPriceToOpen function no longer has any effect, and my following attempt is exiting me at the closing price the day after the price has closed below my protective stop.
What am I missing?
LongEntryTrigger:= Trigger;
LongEntryPrice := OPEN;
LongInitialStop:=Ref(CLOSE-2.5*ATR(30),-1);
LongExitTrigger:=ExtFml("TradeSim.TrailingStop",TRIGGER,LONG,3.8*ATR(30),HIGH,CLOSE);
LongExitPrice:=OPEN;
LongExitPrice:=If(O<LongInitialStop,O,LongExitPrice);
ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.EnableDelayOfEntryByOneBar");
ExtFml("TradeSim.EnableDelayOfAllExitsByOneBar");
ExtFml("TradeSim.EnableProtectiveStop",0);
ExtFml("TradeSim.SetExitPriceToInitialStop");
ExtFml("TradeSim.UseClosingPriceAsStopThreshold");
ExtFml("TradeSim.SetStartRecordDate",31,12,1995);
ExtFml("TradeSim.SetStopRecordDate",31,12,2004);
ExtFml( "TradeSim.RecordTrades",
"test close below", { Trade Data Filename }
LONG, { Trade Position Type }
LongEntryTrigger, { Entry Trigger }
LongEntryPrice, { Entry Price }
LongInitialStop, { Optional Initial Stop }
LongExitTrigger, { Exit Trigger }
LongExitPrice, { Exit Price }
START); { Recorder Control }
If I remove the "enable delay of all exits by one bar" then my normal exits are exiting at the open on the day of the trigger and my protective stops are exiting at the close of the breach of the initial stop.
Any help would be appreciated....
Thanks in advance
Jackie