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
Hi, I am coding a basic RSI trading bot that takes trades when the the RSI is reverting back to the mean (RSI middle of 50) after leaving the upper or lower band. So basically if the RSI has gone under 37.5, and then when the RSI is peaked sell of and is going back up towards the mean, I want place a trade when it hits 37.5. The system I have now is using the OnTick function and is placing the trades prematurely, when the trade is first hitting the lower or upper band the trade is place, not when I want which is when it is returning to the band, which is when the down side or upside move is complete and the minor trend starts reversing. I am trying to code either a delay or some sort of function where the trade is place until at-least the two prior candles where below or above the band level and then when the current candle begins after the band level, to place the trade, instead of when the RSI first hits the band.
Here is a snippet of the code: