use OnCalculate with expert advisor

 

Hello,

I have a source code for an indicator, and I want to use it as an Expert advisor, but the problem i have that OnCalculate doesn't called automatically .

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])

so how to get the params of this function before i call it

 
hello
You have to use Icustom 
 

Don't try to do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)

Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.
          (MT4) Detailed explanation of iCustom - MQL4 programming forum (2017)

 
Your topic has been moved to the section: Expert Advisors and Automated Trading — In the future, please consider which section is most appropriate for your query.
MQL5 forum: Expert Advisors and Automated Trading
MQL5 forum: Expert Advisors and Automated Trading
  • www.mql5.com
How to create an Expert Advisor (a trading robot) for Forex trading