a problem with my stop

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

a problem with my stop

Postby nuno-online » 26 Nov 2008

Hello

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;
Attachments
chart.png
(93.22 KiB) Downloaded 323 times

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 26 Nov 2008

Hi nuno-online,

Looks like what you have reported as a bug. Our engineers will run the necessary tests and if they can replicate the problem, we will create a ticket on this issue and make sure it is fixed as soon as possible.

Regards.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 27 Nov 2008

Hi nuno-online,

Well, our engineers did run the test and according to their tests (they used the data you posted) the sell signal was generated where it was supposed to. Please see the attached screenshot.

In your tests, did you apply the strategy to historical data or were those signals generated in real time?

Also, if the problem persists, please contact our customer support to demonstrate the problem. Or send us the workspace, the strategy, and the logs commenting the problem just the way you did above.

Thank you.
Attachments
forum_5780.PNG
(21.43 KiB) Downloaded 315 times


Return to “MultiCharts”