View Full Version : Protective stops
Marek
9th August 2004, 08:28 AM
Is it possible to test the following stop loss scenario wit the TradeSim:
I would like to exit the trade next day on open if the stop loss price was heat today?
David Samborsky
10th August 2004, 02:34 AM
You would need to use the following commands:-
ExitPrice:=OPEN;
ExtFml(“TradeSim.Initialize”);
ExtFml(“TradeSim.EnableProtectiveStop”,INACTIV ITY_DELAY);
ExtFml(“TradeSim.EnableDelayOfAllExitsByOneBar );
ExtFml("TradeSim.RecordTrades",.......);
Marek
11th August 2004, 10:20 AM
Thanks David
Marek
11th August 2004, 10:53 AM
Sorry David to bother you again but after carefully reading the manual I realised it is not what I need. I can not in advance foresee how many days the stop loss should be inactive. In example I open long position at 1.50$ with a stop loss at 1.00$. In the first N days the price did not hit my stop loss but the next day, say N+1 it did. I would like to exit the trade on Open the day after it means the N+2 day.
More precisely I would like to exit the trade tomorrow if today’s Close is equal or less than my initial stop loss.
Is it possible?
David Samborsky
11th August 2004, 01:21 PM
ExitPrice:=OPEN;
ExtFml(“TradeSim.Initialize”);
ExtFml(“TradeSim.EnableProtectiveStop”,0);
ExtFml(“TradeSim.EnableDelayOfAllExitsByOneBar );
ExtFml("TradeSim.RecordTrades",.......);
If you download the latest plugin from the download page (V4.2.2) the SetStopGapPriceToOpen function no longer has any effect. If Protective Stops are enabled and the InitialSop is breached then stops are handled according to the following pseudo code (long side example)
If UseClosePriceAsThreshold then
ExitPrice=Close
else
if Open < InitialStop then
ExitPrice = Open
else
if ExitAtStop then
ExitPrice = InitialStop
else
ExitPrice = UserExitPrice
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.