Download MetaTrader 5
To add comments, please log in or register
Share your programs. That will improve your rating.
jurcekmpt
486
jurcekmpt 2016.07.29 20:25 

Hello!

 I would like to know how to get every last Bid price of EURUSD, GBPUSD and EURGBP on EURUSD chart.

For now I have: 

double EU1 = MarketInfo("EURUSD",MODE_BID);
double GU1 = MarketInfo("GBPUSD",MODE_BID);
double EG1 = MarketInfo("EURGBP",MODE_BID);

 

but I think this is faster:

double EU1 = Bid;
double GU1 = MarketInfo("GBPUSD",MODE_BID);
double EG1 = MarketInfo("EURGBP",MODE_BID);

 

Is with iClose faster? Like this:

 double EU1=iClose("EURUSD",PERIOD_H1,0);
 double GU1=iClose("GBPUSD",PERIOD_H1,0);
 double EG1=iClose("EURGBP",PERIOD_H1,0);

What do you think is the faster way when using for calculation? 

whroeder1
13644
whroeder1 2016.07.30 12:39  
You are getting values over the network, taking tens or hundreds of milliseconds at best. The difference between those methods will be in nanoseconds. Irrelevant.
jurcekmpt
486
jurcekmpt 2016.07.30 13:02  
Thank you! Can you tell me how can I "run" indicator every second or all the time? Now it updates values only on tick change on chart where it is attached. And solution?
whroeder1
13644
whroeder1 2016.07.30 20:27  
Why would you want to run it when nothing has changed?
jurcekmpt
486
jurcekmpt 2016.07.31 10:10  
Prices of other pairs may change and because of this calculations I need also.
Gordon Gekko
665
Gordon Gekko 2016.07.31 11:35  
Use this.
/
To add comments, please log in or register