Audai Louri:
Hello All
Im trying to build an indicator that helps me scan the market and calculate strength of Currencies using my own algorithm.
I loop through Currencies and then I can't detect the Closing Price for that specific currency.
Here is my code so far
Is there any way I can select the Symbol so that I could do operations on, e.g. Check the last 3 bars of that symbol?
So Im doing this in multiple Symbols and comparing Prices and closing bars on them.
Thanks in advance.
Try this code (move code in OnTick() function.
//--- double TheSwap=0; double ClosingPrice=0; //--- for(int i=0; i<SymbolsTotal(1); i++) { if(SymbolName(i,1) == "EURUSD") { TheSwap = MarketInfo(SymbolName(i,1), MODE_SWAPLONG); ClosingPrice = Close[0]; Print("Symbol: ",SymbolName(i,1)," || Swap: ",TheSwap," || Price: ",ClosingPrice); break; } } //---
iOpen(SymbolName(1,1),PERIOD_D1,0)
I believe I found the solution, but thanks.
Audai Louri:
iOpen(SymbolName(1,1),PERIOD_D1,0)
- On MT4: Unless the current chart is that specific pair/TF
referenced, you must handle 4066/4073
errors before accessing candle/indicator values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4 - I assume that is a posting typo because it's not in your original code.
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
Hello All
Im trying to build an indicator that helps me scan the market and calculate strength of Currencies using my own algorithm.
I loop through Currencies and then I can't detect the Closing Price for that specific currency.
Here is my code so far
Is there any way I can select the Symbol so that I could do operations on, e.g. Check the last 3 bars of that symbol?
So Im doing this in multiple Symbols and comparing Prices and closing bars on them.
Thanks in advance.