This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community
Refreshing all quotesBack to topics list | 1 2 |
|
AndrewSchwartz
2005.05.31 03:52
How do I get the current prices of all symbols using the metatrader api?
I do not want to wait until I get the UPDATE_BIDASK message for all of the different symbols. Is this possible? Thanks. |
|
Slawa
2005.05.31 10:38
You need to keep all the incoming prices. new price rewrites previous price and You have last prices always.
|
|
AndrewSchwartz
2005.05.31 10:43
The MetaTrader Client shows all of the prices when it starts. However, MetaTraderAPIExample2 takes a lot of time before it shows all of the prices (it shows some of them at the beginning, then it shows more after a long time). How can I get all of the prices at the beginning?
Thanks. |
|
AndrewSchwartz
2005.06.03 00:00
Slawa?
|
|
Slawa
2005.06.03 11:57
what the problem? get last history. get last close. bid=close-spread/2; ask=bid+spread;
|
|
AndrewSchwartz
2005.06.03 12:05
I must call MtGetTradeHistory once for every currency. I can only call MtGetTradeHistory once every 5 seconds!
If I have 12 currencies, does that mean I have to wait 5 seconds * 12 = 60 seconds, before I can have all of my prices? |
|
Slawa
2005.06.03 13:39
did You read our manual? You need to use MtGetRates not MtGetTradeHistory! MtGetTradesHistory requests history of your trading operations
|
|
AndrewSchwartz
2005.06.03 18:50
I'm sorry. You are completely correct!
What parameters should I give to MtGetRates? (Specifically, what should I give for period and last_time)? |
|
Slawa
2005.06.03 19:19
period - timeframe(in minutes): 1,5,15,30,60 etc
lasttime - current time |
|
AndrewSchwartz
2005.06.05 01:41
How do I get the spread?
I see "spread" in ConSecurity, but it is always 0 for my broker (FXDD). Thanks, Slawa. |
|
Slawa
2005.06.06 10:58
use MtGetSecurityInfo function
|
Back to topics list
| 1 2
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets
