// Downtrend to uptrend if(sarBuffer[prefCandle] > rates[prefCandle].high && sarBuffer[refCandle] < rates[refCandle].low) return -1; // Bullish signal // Uptrend to downtrend if(sarBuffer[prefCandle] < rates[prefCandle].low && sarBuffer[refCandle] > rates[refCandle].high) return 1; // Bearish signal
this logic is wrong
it should be like this (as an example):
// Downtrend to uptrend if(sarBuffer[0] < rates[0].close && sarBuffer[1] > rates[1].close) return -1; // Bullish signal // Uptrend to downtrend if(sarBuffer[0] > rates[0].close && sarBuffer[1] < rates[1].close) return 1; // Bearish signal
using close price has its benefits (won't miss the entry), and the open price might help with false signals...but you might miss entries as well
All indicators repaints on current candle if they use high, low or close prices to calculate. Only if using open price you will have static value for current bar.
I just wanted to add this as an alternative signal source and filter. On the chat, I always see a dot printed on the current bar. I don't know if it does it on open or a few ticks in. But when I tried to wait for the signal midbar, I got a signal almost every tick, even though there was none. I'd prefer if it worked on the current bar because my strategy is quick in and out but I will research more and adapt.
I just wanted to add this as an alternative signal source and filter. On the chat, I always see a dot printed on the current bar. I don't know if it does it on open or a few ticks in. But when I tried to wait for the signal midbar, I got a signal almost every tick, even though there was none. I'd prefer if it worked on the current bar because my strategy is quick in and out but I will research more and adapt.
If you need it to work "as a filter", you can only check a single candle, better if the last closed one, so values are sticky and not changes.
If you are planning to use "as a signal" you should use something like the crossover, using 2 candles, like the current and the previous one, or better, the last closed and the previous one (for the same reason of what I explained before).
You should compare indicator value with high/low of the candle.
this logic is wrong
it should be like this (as an example):
using close price has its benefits (won't miss the entry), and the open price might help with false signals...but you might miss entries as well
Thank you. I will use this and test it out. Weirdly, many of the tutorials I watched before and articles here used high and low prices. It seems to work for them, but I can't reproduce the same behavior. This is one of the articles. https://www.mql5.com/en/articles/10920

- www.mql5.com
If you need it to work "as a filter", you can only check a single candle, better if the last closed one, so values are sticky and not changes.
If you are planning to use "as a signal" you should use something like the crossover, using 2 candles, like the current and the previous one, or better, the last closed and the previous one (for the same reason of what I explained before).
You should compare indicator value with high/low of the candle.
Thank you. As I mentioned, the signals work on the last closed candle and the previous one. I shifted the index by 1, and it worked. I'll try to figure out how to use these signals to work well with my strategy. If it doesn't, I'll use it only as a filter, which already works well.
Hello, I'm sorry if the question sounds a bit dumb. I sought ways to improve my strategy and decided to add Parabolic SAR signals.
So I wrote this small class to handle that:
However when I try to test it, at first i didn't see any signals. When I left the test to run to the end, I realized it only registered a few signals compared to a whole lot more missed.
Here is the ontick code:
And it is expected that a signal will fire after the PSAR switches to the other side of the price. I have looked at a lot of examples and videos I can't find where I get wrong. In all the videos I watched, this seemed to work well.
UPDATE:
I called the signal method with a shift = 1 and it worked. The downside is that I have to wait for full candle closure after to make trade decision.
It seems the parabolic Sar indicator repaints on index 0 and maybe that's why I dont get signals when I use indices 0 and 1 but I get the results on 1 and 2. But why does it work on the others? Every video and tutorial I watched used the current candle and they were getting signals.
Parabolic SAR on bar 0 repaints because the candle is still forming, so signals from shift = 0 are unreliable. When you use shift = 1 , you're checking the last fully closed candle — the SAR value is stable and final. That’s why signals appear correctly with shift = 1 . Stick with that for consistent and valid results.
Parabolic SAR on bar 0 repaints because the candle is still forming, so signals from shift = 0 are unreliable. When you use shift = 1 , you're checking the last fully closed candle — the SAR value is stable and final. That’s why signals appear correctly with shift = 1 . Stick with that for consistent and valid results.
Thanks

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I'm sorry if the question sounds a bit dumb. I sought ways to improve my strategy and decided to add Parabolic SAR signals.
So I wrote this small class to handle that:
However when I try to test it, at first i didn't see any signals. When I left the test to run to the end, I realized it only registered a few signals compared to a whole lot more missed.
Here is the ontick code:
And it is expected that a signal will fire after the PSAR switches to the other side of the price. I have looked at a lot of examples and videos I can't find where I get wrong. In all the videos I watched, this seemed to work well.
UPDATE:
I called the signal method with a shift = 1 and it worked. The downside is that I have to wait for full candle closure after to make trade decision.
int signal = mySignal.CheckSignal( 1 );
It seems the parabolic Sar indicator repaints on index 0 and maybe that's why I dont get signals when I use indices 0 and 1 but I get the results on 1 and 2. But why does it work on the others? Every video and tutorial I watched used the current candle and they were getting signals.