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
Hello, I am trying to design an EA to trade on divergence between the prices and RSI values. I have read this article https://www.mql5.com/en/articles/1456 and borrowed some logic in my coding to transfer an indicator code into an EA code. However, I have two questions and I would greatly appreciate help on them!
1. I have set up "Indicator Buffers Emulation" and int "limit, MaxBar, i, counted_bars", but I am not sure if I am coding it correctly. I would like peak[i] to represent a peak price and peak[i+1] to represent the peak price prior to peak[i], the same for trough prices (Should I use a different int here from "i"?). Could anyone take a look at my code and see if the arrays and the ints are correctly set up for my EA?
2. I would like to find RSI values corresponding to the peak/trough prices, for example, RSIpeak[i] and RSIpeak[i+1], but I don't know how I should write this scheme, I have set up an Array as Series for RSI then I don't know what to do next, as it is not certain how many bars passed between peak[i] and peak[i+1]?
Thanks again for your time reading my question and my deep gratitude for anyone who can help me solve these two problems.