Indicator from mt5 to mt4

To add comments, please log in or register
Morten Kruse
3085
Morten Kruse  

I'm transfering an indicator from MT5 to MT4.


But the OnCalculate is based on data array.

Like


OnCalculate

The function is called in the indicators when the Calculate event occurs for processing price data changes. There are two function types. Only one of them can be used within a single indicator.

Calculation based on data array

int  OnCalculate(
   const int        rates_total,       // price[] array size
   const int        prev_calculated,   // number of handled bars at the previous call
   const int        begin,             // index number in the price[] array meaningful data starts from
   const double&    price[]            // array of values for calculation
   );



Is this possible to do in mt4? And how?


Br Morten

Documentation on MQL5: MQL5 programs / Client Terminal Events
Documentation on MQL5: MQL5 programs / Client Terminal Events
  • www.mql5.com
Immediately after the client terminal loads a program (an Expert Advisor or custom indicator) and starts the process of initialization of global variables, the Init event will be sent, which will be processed by OnInit() event handler, if there is such. This event is also generated after a financial instrument and/or chart timeframe is changed...
William Roeder
22306
William Roeder  
Morten Kruse: Is this possible to do in mt4?

Do you see that form in the MT4 documentation? Event Handling Functions - Functions - Language Basics - MQL4 Reference

Keith Watford
Moderator
24134
Keith Watford  
Comments that do not relate to this topic, have been moved to "Off Topic Posts".
To add comments, please log in or register