After opening of a Short position I want to protect it with a Stop. The variable bShortStop is a global variable.
I use:
Strategy.doCover("text", Strategy.STOP, Strategy.THISBAR, null, bShortStop);
For example, bShortStop =50, today's range was High[0]=47.85, Low[0]=47.16, Open[0]=47.75.
Under these condition the Strategy.doCover should not close the short position. But it closed the short position at Open[0]=47.75.
The value of bShortStop is outside the day's range, but I do not use a limit order and do not have to check that the limit order is within the day's range.
What am I doing wrong?
I use:
Strategy.doCover("text", Strategy.STOP, Strategy.THISBAR, null, bShortStop);
For example, bShortStop =50, today's range was High[0]=47.85, Low[0]=47.16, Open[0]=47.75.
Under these condition the Strategy.doCover should not close the short position. But it closed the short position at Open[0]=47.75.
The value of bShortStop is outside the day's range, but I do not use a limit order and do not have to check that the limit order is within the day's range.
What am I doing wrong?
Comment