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

Real time result differs from historical one

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

    Real time result differs from historical one

    Hi NT team,

    I found it happened twice on my strategy script that my cut-loss didn't get moved as expected on the real time, resulting in my loos . I kept it running overnight for trading the future (Emini).

    But when I disabled and re-enabled the same script in the morning, it worked perfectly, everything as expected, I didn't change anything, just disable and enable the same script. Any thoughts?

    Thanks,
    Gary

    #2
    When you say it worked properly when you re-enabled do you mean the historical orders displayed properly on the chart?



    For testing purposes you may consider running the past day on the market replay and add some Print() statements to verify results and order handling.

    Trace orders should help out too


    For info on using market replay: http://www.ninjatrader.com/support/h...l?set_up12.htm
    LanceNinjaTrader Customer Service

    Comment


      #3
      Thanks for quick response. I think the reason could be I set CalculateOnBarClose to false. Do you think so?

      Comment


        #4
        Hello,

        Setting COBC = false certainly could cause many differences between the historical and real time results. When looking at historical results COBC will always be true.

        If you only wanted to calculate some of your calculations at the start of a bar and have COBC = false
        you could use something like this
        LanceNinjaTrader Customer Service

        Comment


          #5
          Well, Just tested with the market replay, it worked exactly as expected, i.e. as the historical one, no matter setting COBC to false or true. How come the real time not, bug?

          Comment


            #6
            In order to further test this we would need to isolate the exact occurrence using a simplified script that could replicate the issue.

            Please send me your log and trace files for today so that I may look and see if there were other potential causes

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

            Please reference the following ticket number in the body of the email: ATTN Lance 835960
            LanceNinjaTrader Customer Service

            Comment


              #7
              Sure, but where I can get the log and trace files?

              Comment


                #8
                When you go to Control Center-> Help-> Mail to Support it will be a check box that is checked by default.

                If you're unable to auto send them the physical files are found in (MY)Documents\NinjaTrader 7\trace
                LanceNinjaTrader Customer Service

                Comment


                  #9
                  Thanks. Also sent you my script.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by AaronKoRn, Today, 09:49 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post AaronKoRn  
                  Started by carnitron, Today, 08:42 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post carnitron  
                  Started by strategist007, Today, 07:51 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post strategist007  
                  Started by StockTrader88, 03-06-2021, 08:58 AM
                  44 responses
                  3,975 views
                  3 likes
                  Last Post jhudas88  
                  Started by rbeckmann05, Today, 06:48 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post rbeckmann05  
                  Working...
                  X