I am very new to this topic. I am curious if I can find out the exact time frame a strategy is using from its code? I am studying the simplest "SampleMACrossOver" strategy in the installation package. I cannot find which time frame this strategy is using.
From the code, it proceeds to add indicators directly. That confused me.
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = NinjaTrader.Custom.Resource.NinjaScriptStrategyDes criptionSampleMACrossOver;
Name = NinjaTrader.Custom.Resource.NinjaScriptStrategyNam eSampleMACrossOver;
Fast = 10;
Slow = 25;
// This strategy has been designed to take advantage of performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = false;
}
else if (State == State.DataLoaded)
{
smaFast = SMA(Fast);
smaSlow = SMA(Slow);
smaFast.Plots[0].Brush = Brushes.Goldenrod;
smaSlow.Plots[0].Brush = Brushes.SeaGreen;
AddChartIndicator(smaFast);
AddChartIndicator(smaSlow);
}
}
Best Regards
David WANG

Comment