Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy analyser not working with my strategy

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

    strategy analyser not working with my strategy

    when i ran my strategy today, it picked up trades. when i use the same symbol/strategy and run backtest. it does not pick up any trades. why?

    the only strategy it seems to backjtest properly is the builtin ones.

    #2
    junkone,

    Please debug your strategy by adding print functions throughout it to see what your strategy is processing and what it is not.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      so during the strategy analyser, it will keep printing all those stuff just like regular strategy?

      Comment


        #4
        It should still print regardless of whether backtesting or in real-time.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          i keep getting info that it is in historical. i have afilter to innore hisotical data. is there a way to detect if the strategy is run live or in strategy analyser mode. that way i can accept historical data.

          Comment


            #6
            If you have "if (Historical) return;" in your strategy you will not be able to backtest it. By the definition of backtesting, all data is historical data and they will all be processed as historical bars.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              so is there a way to detect if the strategy is being run under straetgy analyser

              Comment


                #8
                No, you just have to know what you are doing. You can just create yourself a property that is true/false for using Strategy Analyzer and just set it to what you want before you run the strategy.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by junkone View Post
                  so is there a way to detect if the strategy is being run under straetgy analyser
                  How about checking the account name...

                  Code:
                  [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (Account.Name == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Back101"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
                  [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                  [SIZE=2][FONT=Courier New]   Print([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"This is running in the Strategy Analyzer"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
                  [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                  [/SIZE][/FONT]
                  Seems to work for me.

                  Comment


                    #10
                    thats a good way of doing it. i currently have a bool parameter passed when when i am running strategy analyser so i can decide if i can accept historical data or not.
                    if(!inStrategyAnalyser){

                    if (Historical)
                    {
                    Print(
                    "in historical");
                    return;
                    }
                    }

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by jonfletcher, Today, 01:52 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post jonfletcher  
                    Started by MarceloF, 10-02-2018, 09:46 PM
                    13 responses
                    569 views
                    0 likes
                    Last Post bltdavid  
                    Started by demarcog, Today, 12:21 PM
                    0 responses
                    8 views
                    0 likes
                    Last Post demarcog  
                    Started by money0101, Today, 11:57 AM
                    0 responses
                    7 views
                    0 likes
                    Last Post money0101  
                    Started by M_ichel, 04-22-2025, 02:21 PM
                    12 responses
                    82 views
                    1 like
                    Last Post M_ichel
                    by M_ichel
                     
                    Working...
                    X