I am trying to develop a new strategy. I took ATR indicator and build some simple strategies (Enter if (ATR1[0] > ATR1[3]), Exit if (ATR1[3] < ATR1[0]). I run it and it works. I could do backtesting and see the results data.
Second, I wanted to optimize the strategy, thus I change the code by adding Variable (A1).
I run the strategy on a chart and I can see enter and exit on the chart, also while performing strategy performance I can see the results data.
Now I tried to do a strategy analyzer -Backtest, and I got nothing.
1. what is the difference between the backtest and strategy performance?
2. Why backtesting is not running?
the code:
IsInstantiatedOnEachOptimizationIteration = true;
A1 = 3;
}
else if (State == State.Configure)
{
AddDataSeries("SPY", Data.BarsPeriodType.Day, 1, Data.MarketDataType.Last);
}
else if (State == State.DataLoaded)
{
ATRavarag = new Series<double>(this);
ATR1 = ATR(Close, 14);
ATR1.Plots[0].Brush = Brushes.DarkCyan;
AddChartIndicator(ATR1);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < A1)
return;
// Set 1
if (ATR1[0] > ATR1[A1])
{
EnterLong(Convert.ToInt32(DefaultQuantity), @"ATRdown");
}
--------
I tried optimizing the strategy A1= 3;8;1 for instance, and got nothing (it run but no data was received).
Any direction?
Thanks
