Use of RefreshRates

 

Hello,

In mql5 there's the CopyRates function to get the latest rates.

In mql4 there's no such a function, but there's RefreshRates(). The question is: How often should it be called? Right before calling OrderSend() or OrderModify(), for example? Or it's necessary only after there's a pause, such as after calling sleep()? Does using RefreshRates() slow down execution of the program?

Thanks

 

mql4writer01:

In mql4 there's no such a function, but there's RefreshRates(). The question is: How often should it be called? Right before calling OrderSend() or OrderModify(), for example? Or it's necessary only after there's a pause, such as after calling sleep()? Does using RefreshRates() slow down execution of the program?

Only necessary after a delay from start. That means calculations that take seconds or more, between server calls (multiple modifies or multiple sends) or after sleep. Or after loosing connection and waiting.

If you return after processing, (successful or not) it's not necessary.

 
mql4writer01:

Hello,

In mql5 there's the CopyRates function to get the latest rates.

In mql4 there's no such a function, but there's RefreshRates(). The question is: How often should it be called? Right before calling OrderSend() or OrderModify(), for example? Or it's necessary only after there's a pause, such as after calling sleep()? Does using RefreshRates() slow down execution of the program?

Thanks


Thanks
Reason: