I don't see why you said there is a problem. Your code delete a sell_stop if bid price is above high price of candle "2" back from current candle, which was the case obviously.
I don't see why you said there is a problem. Your code delete a sell_stop if bid price is above high price of candle "2" back from current candle, which was the case obviously.
The sell stop on the left, the red horizontal line, should have only deleted if price went above the black pin bar no? The buy stop to the right deleted correctly after price went below the white pin bar.. unless I'm getting something wrong here?
No! you aren't checking for a pin bar. The Bid of the white bar is plainly above the high of the middle black bar.
Ah! Right, ok I see now. I had described the three bar pattern highlighted with the left blue rectangle as below, so I was using the same naming convention to delete the order. High[2] I thought would still be the pin bar in the middle of the left blue rectangle.
Is there a way I can get it to count backwards in time from the sell_stop order. Basically I want to cancel the sell order if the price goes against it past the top of the pin bar...
if(body<maxsize && Open[3]<Low[2] && Open[2]-Low[2]<maxsize && High[2]>High[3] && High[2]>High[4] && Close[1]<Low[2] && High[1]<High[2])

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I've written some "if" functions that delete a stop_order if the price goes past the high/low of the applicable candle in these three bar signals. However, if you take a look at the screen shot below, the sellstop order at 1.11737 has deleted incorrectly just before it would have entered into a sell order, and the buystop order at 1.12202 has correctly deleted after the price went below the pin bar.. I've provided the "if" function for both so you can compare. I've tried all sorts like giving them different magic numbers, changing the sell "If" to bid > the stop loss of the sellstop order and so on, but to no success. Am I missing something obvious??
note: you probably know this already but High[2] refers to the second candle back in the three bar pattern - at least for describing the signal. Is it possible that the "if" function doesn't recognise this numbering system? If so then how is it working for one but not the other...
Thanks for any help!!!!!!