samvendor:
instead of Bid I want to put Dailyopen
instead of Bid I want to put Dailyopen
in below "daily open" indicator code i have put horizontal lines code but instead of Bid price i want horizontal lines on daily open. try to edit but compile error. Any Help Highly appreciated Thankyou.
Not exactly sure what you're trying to achieve (your DailyOpen() looks complicated), but have you tried this?:
for (int i=lastbar; i>=0; i--) { int iDBar = iBarShift(Symbol(),PERIOD_D1,Time[i]); TodayOpenBuffer[i] = iOpen(Symbol(),PERIOD_D1,iDBar); }
in place of:
DailyOpen(0,lastbar);
?
-
int iDBar = iBarShift(Symbol(),PERIOD_D1,Time[i]); TodayOpenBuffer[i] = iOpen(Symbol(),PERIOD_D1,iDBar);
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing candle values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4The function linked to, opens a hidden chart for the symbol/TF in question (if not already open,) thus updating history, and temporarily placing the symbol on Market Watch (if not already there,) so SymbolInfoDouble(symbol, SYMBOL_BID) or MarketInfo(symbol, MODE_BID) don't also return zero on the first call.
- Avoid the problem, use:
int iBOD = iBarShift(_Symbol, _Period, date(Time[i]) ); // Beginning of the Day TodayOpenBuffer[i] = Open[iBOD];
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
in below "daily open" indicator code i have put horizontal lines code but instead of Bid price i want horizontal lines on daily open. try to edit but compile error. Any Help Highly appreciated Thankyou.