I download MACDUpDown from Ninjatrader script sharing file for 7.0.
Then I added a couple lines of coding at the bottome of OnBarUpdate() section as follows:
// My code - MACD main vs signal dots
if (Value[0] > Avg[0] && Value[1] < Avg[1] )
DrawDot("tag"+CurrentBar, true, Time[0], Low[0], Color.Lime);
if (Value[0] < Avg[0] && Value[1] > Avg[1] )
DrawDot("tag"+CurrentBar, true, Time[0], High[0], Color.Red);
The intention is to display a dot on the price chart when MACD main and signal line crosses over. It looks fine when I update my chart at the end of a day. I see green/red/green/red pattern.
When I applied it on a real-time chart, e.g. 3-min chart, during that bar interval, the condition may be met. A dot is generated. But when the condition was changed and the criteria was no longer met, the dot stays. Then I see pattern like green/green/red/red, etc.
When I hit F5 to refresh screen, the chart becomes correct and cleaned up.
How to have a clean up a chart in real-time without hitting F5? Before a price interval is completed, when the condition is changed, how to remove the display of a dot?
Thank you.

), so if you get any errors, let me know, and I will stop being lazy. 
Comment