How can I get the candle number on which the vertical line is drawn? Sorry for my English.
- Moving Average Indicator
- Coding help
- trading hours and trading days
datetime when = (datetime)ObjectGetInteger(0, "MyVerticalLine", OBJPROP_TIME, 0); int shift = iBarShift(_Symbol, PERIOD_CURRENT, when); Print("Vertical line is drawn on candle ", shift);
Be careful if the object doesn't exist. If the object doesn't exist, when == 0 so iBarShift will be the oldest bar on the chart (depending on what you set for 'exact' in iBarShift)
Thanks.
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