PiggyChu620:
Could somebody please be so kind and teach me how to make a function to get the amount of bars since the order is open!?
For example, if I bought a EUR/USD on 9/2, then today such function should return 10 in a daily chart, 240 (more or less) in a hourly chart, and so on.
Much appreciated!!!
Check the iBarShift function. You need to input inside the time the trade was opened .
-
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 - iBarShift
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
Could somebody please be so kind and teach me how to make a function to get the amount of bars since the order is open!?
For example, if I bought a EUR/USD on 9/2, then today such function should return 10 in a daily chart, 240 (more or less) in a hourly chart, and so on.
Much appreciated!!!