Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live strategy output logs are different from StrategyAnalyzer output in NT7.19

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

    Live strategy output logs are different from StrategyAnalyzer output in NT7.19

    I'm trying to figure out why the print/log statements from a strategy are entirely different when trading live (sim101) versus using StrategyAnalyzer.

    I suspect that there's a difference in how the bars are being loaded in at startup but I'd need a support person to take a look to determine this. Can someone from NT take a look at the strategy? I can send it in a private mesg.

    Thx,
    Lou

    #2
    Hello bluelou,

    There are expected differences when running a strategy live versus a backtest in the strategy analyzer. This can result in different output as well.


    We don't provide support through private messages. We need support communication to be open for our team to operate effectively.

    If you don't want to share the strategy here, please use [email protected] and reference this thread:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan,
      I wasn't talking about something expected like slippage. The output from the functions is off by orders of magnitude when I look at the live logs vs. the backtest logs.

      No problem emailing support rather than p.m. I'll send the file to your attention.

      -Lou

      Comment


        #4
        Austin and Brett,
        I was able to coax the stripped down strategy that I sent you via support at ninjatrader into running properly but I'm concerned that my solution may impact the execution of the full version of my strategy in real-time. Also, I'm surprised no one at NinjaTrader support suggested this.

        To reiterate:
        A. The problem:
        1. I have a strategy which requires approx 7 days worth of 20 tick bars for BarsArray[0] and exactly 30 days of 1 day bars for BarsArray[1].
        2. NT7 requires a buffer of min bars required = 20 before it will run a strategy properly (per NT support)
        3. In backtesting, I set min bars required = 50 and my strategy ran properly in backtest mode. Per NT support, I was told that min bars required is based off of the lowest interval BarsArray. However, the strategy would not run live with min bars required = 50. I was told by NT support to keep min bars required = 20.
        4. For real-time trading I set DaysToLoad = 50 and min bars required = 20 but my indicator output was off by orders of magnitude.
        5. I've since discovered that min bars required appears to work very differently in real-time vs. backtest mode. In real-time, min bars required is based on BarsArray[0]. In StrategyAnalyzer, min bars required appears to use the lowest interval data series.


        B. A solution:
        1. Set BarsArray[0] = 3 days per bar and set min bars required = 20. Thus, 3 * 20 = 60 days of data and NT doesn't get upset by min bars required != 20.
        2. Other than to get 60 days worth of data into the strategy before running in real-time I have no reason for BarsArray[0] = 3 days per bar.
        3) Recode the entire strategy so that there are no references to BarsArray[0] since that is only used to get data into the strategy. Set BarsArray[1] = 20 ticks/bar, set BarsArray[2] = 1 day per bar.

        C. A concern.
        I'm in the process of recoding the full version of the strategy to reflect the convoluted way that the different data series must be addressed real-time in NT7. Given that my true primary bars are now BarsArray[1] = 20 ticks/bar is there anything that could go wrong in real-time execution? Will my stop losses, market orders, or limit orders be effected in any way? What could go wrong?

        Also, can't NT7 be improved so that there is an easier way to load data into a real-time strategy? Why the difference in using min bars required in a backtest vs real-time? Having to load data this way for real-time trading seems really amateurish.

        -Lou
        Last edited by bluelou; 08-13-2010, 08:56 AM.

        Comment


          #5
          Strategy working in NT6.5 but not in NT7

          The problem I'm having is with NT7 and not NT6.5. I've tried the aforementioned strategy changes and I was able to get them to work in NT6.5 but not in NT7.

          Specifically,
          I need tick bars in one BarsArray and at least 30 1-day bars in another BarsArray. In NT 6.5 I can get the strategy to run in backtest mode and in real time. In NT 7 I can only get the strategy to run in backtest mode, but NOT in real-time.

          [Note: There are some slight differences in the NT6.5 indicator output and I think this is due to different session times. How do you set session times in NT 6.5? I couldn't find this in the help files.]

          Comment


            #6
            Hi BlueLou,

            Minimum bars required is used to halt all strategy processing until it has been reached. It's applied for all series in the strategy. If you have it set to 20 and you have a daily series, then there is no strategy processing until 20 days in.

            You have to be aware of the primary series and how much data is needed on this primary series to properly access your other series.

            The relationship between these two properties may be what is causing this for you.

            To debug this properly you will need try catch blocks to catch any lines that are causing exceptions.



            I'll evaluate this with a simple strategy. Please let us know:
            • What intervals you're using for each series:
            1. Primary
            2. Secondary
            3. Tertiary
            • The maximum bars (not days) needed for any indicator calculations and which series they apply to.
            • Which instrument you're using.
            I realize some of this information was provided in your earlier post, but I'm looking for it in one place and expressed in bars.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_RyanM View Post
              Hi BlueLou,

              Minimum bars required is used to halt all strategy processing until it has been reached. It's applied for all series in the strategy. If you have it set to 20 and you have a daily series, then there is no strategy processing until 20 days in.

              You have to be aware of the primary series and how much data is needed on this primary series to properly access your other series.

              The relationship between these two properties may be what is causing this for you.

              To debug this properly you will need try catch blocks to catch any lines that are causing exceptions.



              I'll evaluate this with a simple strategy. Please let us know:
              • What intervals you're using for each series:
              1. Primary
              2. Secondary
              3. Tertiary
              • The maximum bars (not days) needed for any indicator calculations and which series they apply to.
              • Which instrument you're using.
              I realize some of this information was provided in your earlier post, but I'm looking for it in one place and expressed in bars.
              Ryan,
              I'm aware of what you're saying and that is not where the problem is. Also, there are no exceptions or error messages. I've already tried that and I've been trying to find the problem for 2 weeks now. I've covered this via Skype w/Brett and he agreed that there was a problem with min bars required and my strategy. He said Austin was the man so he passed me off to him but I haven't heard from Austin other than a few basic questions in an email around noon yesterday.

              I'll reiterate what the problem is again:
              1) I set BarsArray[0] = 20 ticks/bar and BarsArray[1] to 1-day bars. My strategy requires 30 days of 1-day bars and around 7 days of tick bars. Since NT7 appears to require a minimum of 20 bars as a buffer I've been setting min bars required = 50 (30 +20) for backtesting. The indicator results are exactly what I'd expect.

              2) When I follow 1) above and apply it to real-time data my indicator output either = 0 or there are nonsensical numbers that are orders of magnitude away from the data appearing appearing in the backtest or in an indicator chart.

              Are you interested in taking a look at the problem? I've sent the strategy code to Austin at the support email address.

              -Lou

              Comment


                #8
                Lou,

                If there's an issue with the platform we need to break it down to the simplest elements that demonstrate the issue. My last suggestion is an attempt to collect the minimum relevant details needed to reproduce. If you have an alternate strategy or test we can use that shows what you're facing then please share with us. It needs to be simple and reproducible on our side. Once you start using strategies with dll code we're really can't analyze the situation properly.

                If the issue is specific to the code you're using, we can't offer the debugging services you require. Please see our 3rd party NinjaScript consultants here, who can be hired for this service:
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Ryan,
                  Okay, you've almost worn me down. All you have to do is look at the last line in the output window. That indicator doesn't have a dll reference. Try the tests that I've mentioned. You'll see that the real-time output # makes no sense when compared to the backtest or the indicator plot.

                  I don't have to use NT7. As well as working properly in NT7 backtest mode the code works properly in both NT6.5 real-time and backtest mode (Doesn't sound like a dll issue, does it?)

                  But, since NT6.5 doesn't support day bars for Gain Capital I need to build up the day bars from minute bars and I can't figure out how to handle the session times in NT 6.5. How do I get the 1440 minute (1 day) bars from Gain to match what Gain shows as the daily close. If I can get the NT6.5 sessions to match Gain's actual sessions then I can avoid NT7 altogether.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by MacDad, 02-25-2024, 11:48 PM
                  8 responses
                  173 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by alancurry, Today, 06:53 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post alancurry  
                  Started by Juanhuisman, Today, 06:51 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post Juanhuisman  
                  Started by sidlercom80, 10-28-2023, 08:49 AM
                  173 responses
                  2,339 views
                  0 likes
                  Last Post intelligenttrader  
                  Started by ArkansasClint, 04-25-2024, 09:28 AM
                  1 response
                  23 views
                  0 likes
                  Last Post Leafcutter  
                  Working...
                  X