Indicator does not work on new version
Indicator does not work on new version
19 Dec 2022, 12:10
Hi.
On the older versions of Ctrader i had this indicator, it worked fine, now it crashes, can you guys explain why??? please.
Many thanks
Here is the code, it's quite simple:
private Supertrend SUP;
protected override void Initialize()
{
SUP = Indicators.Supertrend(6, 3);
}
public override void Calculate(int index)
{
var SUPdn = SUP.DownTrend.LastValue;
var SUPup = SUP.UpTrend.LastValue;
Chart.DrawRectangle("Recta", index - 2, SUPup + 0.0015, index + 2, SUPup, Color.DarkGreen, 2, LineStyle.Lines);
Chart.DrawRectangle("Recta2", index - 2, SUPdn - 0.0015, index + 2, SUPdn, Color.DarkRed, 2, LineStyle.Lines);