- Moving Average of Oscillator - Oscillators - Indicators - Charts - MetaTrader 5 for Android
- Moving Average of Oscillator - Oscillators - Indicators - Chart - MetaTrader 5 for iPhone
- Relative Vigor Index - Oscillators - Indicators - Charts - MetaTrader 5 for Android
You can use either a script, indy or an EA, but it's best to use EA's as they have their own thread so it doesn't affect the GUI thread.
What you ask isn't perfunctory because you need to scan the charts you have open, which is a question unto itself. You could attach an EA to each chart, but that's not the best method. It's better to attach a master EA to only one chart and then it can scan all other charts you have open and do as you need.
const int LOOK_BACK = 2; // which candle to target MqlRates rates[]; ArraySetAsSeries(rates, true); // set array so newest candle is array[0] double c2Hi, c2Lo, diff; int copied = CopyRates(_Symbol, _Period, 0, LOOK_BACK, rates); if (copied >= LOOK_BACK) { c2Hi = rates[LOOK_BACK-1].high; // arrays are zero-based, so subtract 1 c2Lo = rates[LOOK_BACK-1].low; diff = (c2Hi - c2Lo) / Point(); // use Point() to get the symbols decimal places printf("c2Hi:%g c2Lo:%g diff:%g", c2Hi, c2Lo, diff); // c2Hi:1.13757 c2Lo:1.0814 diff:5617 } N.B. The difference is in pipettes, so divide by 10 if you want pips (562pips)
You can use either a script, indy or an EA, but it's best to use EA's as they have their own thread so it doesn't affect the GUI thread.
What you ask isn't perfunctory because you need to scan the charts you have open, which is a question unto itself. You could attach an EA to each chart, but that's not the best method. It's better to attach a master EA to only one chart and then it can scan all other charts you have open and do as you need.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use