Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy Comparison vs Benchmark

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy Comparison vs Benchmark

    I have a question regarding evaluating the performance of a strategy. I am familiar with the analyzation results NT offers like gross profit, profit factor etc.

    In a book I encountered another method to evaluate a strategy: The just compare the strategy's performance directly to the performance of the used instrument. So they say like "within x months the underlying instrument gained yy % and the strategy gained zz %". They also plot this information on a chart like this:


    Is there any way to plot a similar chart in NT to compare the strategy performance to the traded instrument?

    Thank you!

    #2
    I don't think so.

    You'd be best to export your results to excel, and get the instruments results in excel, and make your own chart there.

    Comment


      #3
      Hello _vbs_,

      This may be possible.

      In your script you can track the realized and unrealized PnL. Using this you could calculate a percent of change. Once you have a value you can set this to a plot in an indicator from the strategy.

      Below is a link to an example of setting a plot from a strategy.
      When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability


      The @NetChange column in the Market Analyzer uses real-time data only to calculate a net change for the instrument. This could be adapted to use historical tick data instead and could also pushed to the indicator on a second plot.

      The @NetChange column has to be opened outside of NinjaTrader 7 and is located in:
      Documents\NinjaTrader 7\bin\Custom\MarketAnalyzer\@NetChange.cs
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Big thanks for answering my questions, I apperciate alot!

        It took me some time to read and understand and to finally do it, but now I think I got something that does what I want. And indicator in a separate panel that looks like this:


        Just if someone is interested to use it:
        It consists of an indicator and a base class (found in the attachments) you need to derive your strategy from like this:
        Code:
        namespace NinjaTrader.NinjaScript.Strategies.AbsoluteWeekly
        {
        	public class Trendhoch : BenchmarkStrategy
        	{
        Then aswell OnStateChange and OnBarUpdate have to call their base implementation:
        Code:
        		protected override void OnStateChange()
        		{
        			base.OnStateChange();
        Code:
        		protected override void OnBarUpdate()
        		{
        			base.OnBarUpdate();
        Then the indicator can be added as usual in OnStateChange:
        Code:
        			else if (State == State.Configure)
        			{			
        				AddChartIndicator(StrategyBenchmark());
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by warreng86, 11-10-2020, 02:04 PM
        7 responses
        1,360 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        5 views
        0 likes
        Last Post Perr0Grande  
        Started by elderan, Today, 08:03 PM
        0 responses
        9 views
        0 likes
        Last Post elderan
        by elderan
         
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        14 views
        0 likes
        Last Post maybeimnotrader  
        Working...
        X