You can use RemoveDrawObject() on the 21st bar to only have the last 20 bars be visible.
You would need to loop through the DrawObjects collection to find specific draw objects, get their tag name, and use that tag name when calling RemoveDrawObject().
See the sample code on the DrawObjects help guide page linked below for how to loop through the DrawObjects collection to find specific draw objects.
DrawObjects: https://ninjatrader.com/support/help...rawobjects.htm
RemoveDrawObject: https://ninjatrader.com/support/help...drawobject.htm
SampleRemoveDrawObjects: https://ninjatrader.com/support/help...s_from_the.htm
Please let us know if we can assist further.

Comment