
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How to add the purchase price of a particular currency pair to Excel
i need ask & bid currency
// Set Item Value DDE
>>>>>> SetItem("BID","EURUSD",(string) ?????());<<<<<<
HI GUYS IF WANT SHOW EURUSD BID OR ASK PRICE HOW TO MODIFY THIS?
THANK YOU
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
Please do not make excessive use of capital letters when posting. It is considered shouting and very rude.
Good evening.
After a lot of fiddling, I managed to solve it. I registered on the site just for that.
Change the entire OnTimer() function:
void OnTimer()
{
//--- filling an array MA[] with current values of iMA
//--- Copying 100 elements
// CopyBuffer(MA_handle,0,0,100,MA);
// ArraySetAsSeries(MA,true);
double EURUSD_ASK = SymbolInfoDouble("EURUSD",SYMBOL_ASK); // for eurusd (example)
double EURUSD_BID = SymbolInfoDouble("EURUSD",SYMBOL_BID);
double USDCHF_ASK = SymbolInfoDouble("USDCHF",SYMBOL_ASK);
double USDCHF_BID = SymbolInfoDouble("USDCHF",SYMBOL_BID);
// Check & Add Item DDE
// if(!CheckItem("EMA","B"))
// {
// if(!AddItem("EMA","B")) return;
// }
if(!CheckItem("COMPANY","Value")) AddItem("COMPANY","Value");
if(!CheckItem("TIME","Value")) AddItem("TIME","Value");
if(!CheckItem("EURUSD","ASK")) AddItem("EURUSD","ASK");
if(!CheckItem("EURUSD","BID")) AddItem("EURUSD","BID");
if(!CheckItem("USDCHF","ASK")) AddItem("USDCHF","ASK");
if(!CheckItem("USDCHF","BID")) AddItem("USDCHF","BID");
// Set Item Value DDE
SetItem("COMPANY","Value",(string)AccountInfoString(ACCOUNT_COMPANY));
SetItem("TIME","Value",(string)TimeCurrent());
// SetItem("EMA","B","EMA(21):"+DoubleToString(MA[0],6));
SetItem("EURUSD","ASK",DoubleToString(EURUSD_ASK,5));
SetItem("EURUSD","BID",DoubleToString(EURUSD_BID,5));
SetItem("USDCHF","ASK",DoubleToString(USDCHF_ASK,5));
SetItem("USDCHF","BID",DoubleToString(USDCHF_BID,5));
}
The rest is the same as described above.
I hope it helps someone.
Here are the changes I made to the code below.
// Set Item Value DDE
>>>>>> SetItem("BID","EURUSD",(string) ?????());<<<<<<
HI GUYS IF WANT SHOW EURUSD BID OR ASK PRICE HOW TO MODIFY THIS?
THANK YOU
How to add the purchase price of a particular currency pair to Excel
i need ask & bid currency
I tried using your code but it only get me the Ask/Bid of the first currency pair in the list of symbols in MT5 regardless of the currency symbol I add in the code.
For example, I have USDCAD as the first symbol in MT5 symbols list. I write the code you provided with EURUSD, but the Ask price I get is the USDCAD one not the EURUSD one. How to fix that?
Also, do you have any suggestions on how to connect ask price of all currency pairs/symbols to Excel?
Thanks!
I modified it to take the data: high, close, low (HCL) of the previous candle to the current one; Upper and Lower Bollinger Band values (20,2) of the previous candle to the current one; Stochastic and %D (10,3,3) of the previous candle to the current one.
The code follows:
The rest is the same
I tried using your code but it only get me the Ask/Bid of the first currency pair in the list of symbols in MT5 regardless of the currency symbol I add in the code.
For example, I have USDCAD as the first symbol in MT5 symbols list. I write the code you provided with EURUSD, but the Ask price I get is the USDCAD one not the EURUSD one. How to fix that?
Also, do you have any suggestions on how to connect ask price of all currency pairs/symbols to Excel?
Thanks!
Try change: Symbol() to _Symbol
Please visit the brazilian comments
https://www.mql5.com/pt/forum/33344