When backtesting strategies it can be useful to add the indicators you use for calculations onto the chart to make it easier to check your strategy for accuracy. Instead of doing this step manually every time you run the strategy you can program it to automatically load the indicators for you.
For example:
To add a volume indicator to your charts you need to add this code snippet into the OnStateChange section of your code for the State: State.DataLoaded
protected override void OnStateChange() { if (State == State.DataLoaded) { [B]AddChartIndicator(VOL());[/B] } }
VOL().Panel = 2; AddChartIndicator(VOL());
VOL().Plots[0].Brush = Brushes.Red; // Plots the VOL with a red plot
VOL().Plots[0].Width = 4; // Plots the VOL bars with a width of 4
VOL().Plots[0].PlotStyle = PlotStyle.Dot;
RSI(14, 3).Lines[0].Value = 20; RSI(14, 3).Lines[0].Brush = Brushes.Green;
Leave a comment: