Download MetaTrader 5

How to get every last Bid price, fastest way

To add comments, please log in or register
jurcekmpt
592
jurcekmpt  

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
15335
whroeder1  
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
592
jurcekmpt  
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
15335
whroeder1  
Why would you want to run it when nothing has changed?
jurcekmpt
592
jurcekmpt  
Prices of other pairs may change and because of this calculations I need also.
Gordon Gekko
623
Gordon Gekko  
Use this.
To add comments, please log in or register