My name is ken,
hi ken
i am a newbie in EA programming.
IMHO this is very helpful
Do i still need Marketinfo() to retrieve all those M30 data?
Play video | Please edit your post. For large amounts of code, attach it. |
Hi qjol,
actually i wish to compare the USD currency strength against other such as JPY, GBP, CHF by using (M30 Close price-Open price method) before entering a position on EURUSD.
If USD gain >20pips each on JPY, GBP, CHF.... i will sell EURUSD, vice versa if USD loss 20pips
then what for do you need
iClose("GBPUSD", PERIOD_M30, 1); //Close bar no. 1 = 1 bar before the current bar
Play videoPlease edit your post.
For large amounts of code, attach it.
- You can only get the current chart pair/timeframe values with the predefineds. If you need other pairs or timeframes, that's one way.
- If you don't then no.
Hi qjol,
Thanks for your kindness
Actually i did insert the iClose("GBPUSD", PERIOD_M30, 1); into my EA.
My question is, i attach my EA on EURUSD chart, and inserting above code, would my EA able to get the GBPUSD M30 info prior proceed to my coding calculation for market entrance decision without the help from Marketinfo() function?....
yes but It depends on what you are trying to achieve
for example if you the LOTSIZE on GBP you will have to use:
MarketInfo("GBPUSD", MODE_LOTSIZE);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
My name is ken, actually i am a newbie in EA programming.
Wish to ask if my EA already containing below declaration in an EA and attach to EURUSD chart. Do i still need Marketinfo() to retrieve all those M30 data? Thanks in advance for the advise!!!
double gbpusdAwayUSD0 = iClose("GBPUSD", PERIOD_M30, 1);
double usdjpyHomeUSD0 = iClose("USDJPY", PERIOD_M30, 1);
double usdchfHomeUSD0 = iClose("USDCHF", PERIOD_M30, 1);
double gbpusdAwayUSD1 = iOpen("GBPUSD", PERIOD_M30, 1);
double usdjpyHomeUSD1 = iOpen("USDJPY", PERIOD_M30, 1);
double usdchfHomeUSD1 = iOpen("USDCHF", PERIOD_M30, 1);