I am writing a strategy and i want explaination about Stop:
The execution method Sell next bar at price Stop instructs TS to exit a long position at the first opportunity at the specified price or lower.
Below, we can see a buy order in the second bar
I don’t understand why my sell order isn’t executed in the fourth bar (09:50) where close = 66.64 , Low = 66.55 and MyStop = 66.65
date, time, Open, High, Low, Close, Vol
08/08/2001,09:35:00,66.99,67.00,66.48,66.62,180000
08/08/2001,09:40:00,66.61,67.00,66.60,66.81,141000 >> buy order executed
08/08/2001,09:45:00,66.87,66.99,66.60,66.64,130500
08/08/2001,09:50:00,66.67,66.81,66.55,66.71,125300 > stop???
08/08/2001,09:55:00,66.72,67.48,66.72,67.40,152600
08/08/2001,10:00:00,67.42,67.68,67.20,67.40,189800
Code: Select all
Inputs:
TextSpacing(1.00);
Vars:
LH1(0), LB1(0), MP(0), MyStop(0), Status(0), StopDEPART(0);
{ CALCULATE PIVOTS AT THE BEGINING OF THE DAY }
If (Date <> Date[1]) then
Begin
LH1 = High;
LB1 = Low;
End;
MP = MarketPosition;
If (Date = Date[1]) and ((Time > Sess1StartTime) and (Time < Sess1EndTime)) and MP = 0 then
Begin
// Long sur LH1
If Close[1] < LH1 and Close[1] > LB1 and High >= LH1 then
Begin
Buy ("LongLH1") this bar on Close;
StopDEPART = 66.48;
End;
End;
If MP = 1 then
Begin
//MyStop
MyStop = 66.65;
// Exit Order
Sell next bar at MyStop stop;
// Visuel Stop
Value1 = Text_New(D, T, MyStop,"*");
//Value1 = Text_New(D, T, MyStop-TextSpacing,NumToStr(MyStop,2));
Text_SetColor(Value1,red);
End;