mql5 Expert advisor onTick()

To add comments, please log in or register
waza123
117
waza123  

When I make indicator, I got this params:

int OnCalculate(const int rates_total, 
                const int prev_calculated, 
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{}

How can I get the same params when I make Expert Advisor using onTick() function ?

Thanks

Rodrigo Malacarne
Moderator
8048
Rodrigo Malacarne  
waza123:

When I make indicator, I got this params:

How can I get the same params when I make Expert Advisor using onTick() function ?

Thanks

The event handler OnCalculate() is used only inside indicators. When you are using expert advisors it is replaced by the event handler OnTick(). So you cannot use both at the same time.
waza123
117
waza123  
Malacarne:
The event handler OnCalculate() is used only inside indicators. When you are using expert advisors it is replaced by the event handler OnTick(). So you cannot use both at the same time.

yes i know it, but I need rates_total and high[] low[] in OnTick() to do something like that onTick(){ double x = high[rates_total-300]; }


is there any way to do it ?

Alain Verleyen
38118
Alain Verleyen  
waza123:

yes i know it, but I need rates_total and high[] low[] in OnTick() to do something like that onTick(){ double x = high[rates_total-300]; }


is there any way to do it ?

CopyHigh() to get high[] and Bars for rates_total.
waza123
117
waza123  
angevoyageur:
CopyHigh() to get high[] and Bars for rates_total.
thanks, will try.
To add comments, please log in or register