MenuItems Flickering
Created at 14 Apr 2020, 07:20
GE
MenuItems Flickering
14 Apr 2020, 07:20
Hi
When tick rate is high, the MenuItem Indicators/IndicatorName is flickering.
As a result of this, indicator cannot be removed and if one tries the application crashes.
To reproduce:
1. create a dummy bot and run it at x10000 in Backtesting.
2. create an indicator which is using DrawIcon and place it on the Batesting chart.
3. try to remove it.
See code for both dummy bot and indicator used to reproduce, in snippets.
Note:
Same behavior with various Draw functions.
This behavior though shown in backtesting is exactly the same in normal charts.
Regards
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class DummycBot : Robot
{
protected override void OnStart()
{
}
protected override void OnBar()
{
}
}
}
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class TestMenuFlickering : Indicator
{
protected override void Initialize()
{
}
public override void Calculate(int index)
{
if (IsLastBar)
if (Bars.ClosePrices.IsRising())
Chart.DrawIcon("icon", ChartIconType.UpArrow, Bars.Count + 5, Bars.ClosePrices.LastValue, Color.Lime);
else if (Bars.ClosePrices.IsFalling())
Chart.DrawIcon("icon", ChartIconType.DownArrow, Bars.Count + 5, Bars.ClosePrices.LastValue, Color.Orange);
}
}
}