Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy works on analyzer but don't work on realtime

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

    Strategy works on analyzer but don't work on realtime

    Hello to all! Have a trouble with testing my strategy.
    I'm using primary and one more data series for strategy.
    When running backtest in analyzer it works good and shows right results, but when I'm trying to run strategy on market replay or realtime - there are no enters at all.
    What it could be?
    Thanks!

    #2
    Hello YevhenShynkarenko,

    Thanks for your post.

    In reading your post the only difference I can think of between backtesting and live or market replay is that when you apply the strategy as a final step in live or market replay you have to set the strategies enabled status from false to true. This is done in the "General" settings of the strategy panel.

    To tell if a strategy is enabled or disabled on a chart, note the name of the strategy will be on the chart in the upper left. If disabled it will show "(D)" in front of the name. When enabled it will show just the name.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello YevhenShynkarenko,

      Thanks for your post.

      In reading your post the only difference I can think of between backtesting and live or market replay is that when you apply the strategy as a final step in live or market replay you have to set the strategies enabled status from false to true. This is done in the "General" settings of the strategy panel.

      To tell if a strategy is enabled or disabled on a chart, note the name of the strategy will be on the chart in the upper left. If disabled it will show "(D)" in front of the name. When enabled it will show just the name.
      Of course I'm enabling it! It shows green color in Strategies.
      I tried and from Strategies Tab and from Chart - still no enters.
      In Output window I see that it calculates SMA (I putted some Print functions) and shows it in Output, but there are no enters, which I have in Analyzer.

      Comment


        #4
        Hello YevhenShynkarenko,

        Thanks for your reply.

        Please send me your log and trace files for today so that I may look into what occurred.

        You can do this by going to the Control Center-> Help-> Mail to Platform Support.

        Please reference the following in the body of the email: Atten Paul and the title of this thread.

        Also please identify the name of the strategy and a date and an approximate time when you expected the strategy to place an order but did not.

        Thank-you
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Paul View Post
          Hello YevhenShynkarenko,

          Thanks for your reply.

          Please send me your log and trace files for today so that I may look into what occurred.

          You can do this by going to the Control Center-> Help-> Mail to Platform Support.

          Please reference the following in the body of the email: Atten Paul and the title of this thread.

          Also please identify the name of the strategy and a date and an approximate time when you expected the strategy to place an order but did not.

          Thank-you
          Found issue with code, and I think there is a problem.
          I have this code:

          Code:
          if (qw==true) 
             {
              Print("CCI UPDATE");
          
              if(CCI(CCIPer)[0] < 0 && CCI(CCIPer)[-1] > 0)
              {
               
                           EnterLong(DefaultQuantity, "");
               qw = false; 
              }
             }
          In this case I see Print in Output window.
          But when I'm trying to put Print in such way

          Code:
          if (qw==true) 
             {
              
          
              if(CCI(CCIPer)[0] < 0 && CCI(CCIPer)[-1] > 0)
              {
               Print("CCI UPDATE");
                           EnterLong(DefaultQuantity, "");
               qw = false; 
              }
             }
          It doesnt work - I see this Print only when enabling strategy - not in realtime at all, but condition works (CCI was lower 0 and then higher then 0).

          In any cases this code works fine in analyzer. So what's the problem?

          Comment


            #6
            Hello YevhenShynkarenko,

            Thanks for your reply.

            The [-1] index is the issue. In the case of back testing this would point to the bar ahead of the current bar. In the case of live data, the current bar is [0] and [-1] points to nothing.

            I suspect you are trying to compare the Current bar to the previous bar. In that case you would change your code to:

            if(CCI(CCIPer)[0] < 0 && CCI(CCIPer)[1] > 0)
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by f.saeidi, Yesterday, 02:09 PM
            3 responses
            19 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Jltarrau, Today, 05:57 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by kujista, Today, 06:23 AM
            0 responses
            2 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by traderqz, Yesterday, 04:32 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by f.saeidi, Today, 05:56 AM
            1 response
            5 views
            0 likes
            Last Post Jltarrau  
            Working...
            X