If you place the handle definition in OnTick, a new handle reference is made every single tick, you shouldn't do that. Put both the iSAR and ArraysSetAsSeries in OnInit(). Make "psarHandle" a global variable. Leave copybuffer in OnTick. Realize that parabolic sar can repaint. You might need bar confirmation logic to validate the start of a new trend
Conor Mcnamara #:
If you place the handle definition in OnTick, a new handle reference is made every single tick, you shouldn't do that. Put both the iSAR and ArraysSetAsSeries in OnInit(). Make "psarHandle" a global variable. Leave copybuffer in OnTick. Realize that parabolic sar can repaint. You might need bar confirmation logic to validate the start of a new trendThank you
If you place the handle definition in OnTick, a new handle reference is made every single tick, you shouldn't do that. Put both the iSAR and ArraysSetAsSeries in OnInit(). Make "psarHandle" a global variable. Leave copybuffer in OnTick. Realize that parabolic sar can repaint. You might need bar confirmation logic to validate the start of a new trendThank you
Thank you, I will try that. Could you explain or pass on a reference about bar confirmation logic?
bar confirmations can be handled in multiple different ways, it could be as simple as changing [0] and [1] indexes to [1] and [2]
I would avoid doing this in the trade logic as well:
PriceInfo[1].close<PriceInfo[1].open
PriceInfo[1].close>PriceInfo[1].open
You don't need to make sure the candle is red for a sell position, or that the candle is green for a buy position. Because even when there's a buy trend on the PSAR, you will see some prior red candle, and you don't want to miss the trade opportunity on it - instead you want to believe in the trend
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Backtesting an idea using Parabolic SAR. I was expecting the trade to open at the open of the new bar when the signal switches, but it doesn't. It is late and inconsistent. And it is not just the difference in the spread. I can't seem to find anything in the code that prevents it from opening the trade at the correct moment.