Clear Objects on Chart from "x" bars back
Get the time of the object. get the shift from the time. test.
iBarShift
Search for a bar by its time. The function returns the index of the bar which covers the specified time.
int iBarShift( |
ObjectGetTimeByValue
The function returns the time value for the specified price value of the specified object.
datetime ObjectGetTimeByValue( |
- ObjectGetTimeByValue - MQL4 Documentation is used (on all the object types listed) because they have multiple times (Trendline start/end.) and you need a time between them.
- If you just need the start time/end time why would you need that?
Hi everyone, I have been searching with no luck for a way to clear a chart from "x" bars back. So for example any objects that are older than 50 bars get deleted. I am thinking this code could be modified to do that, it clears the whole chart in it's current state.
Would anyone have any ideas on what to change here?
Thanks for any help!
SD