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

Entry doesn't relate to chart?

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

    Entry doesn't relate to chart?

    Hi Guys, I'm seeing some strange behaviour in my strategy which maybe you can help with.

    I'm connected to the GAIN demo feed and the sim account working on my first strategy.

    When I load it up it will quite often show my entries in completely the wrong place e.g. I have some logic that will enter long when price crosses above MA ... on this example the entry price displayed is correct and the numbers correct if I print them to the output window but the chart (at exactly the same time) shows the entry at a different place.

    I have another entry where the entry price seems correct but it's only displayed on the chart 40 minutes later, again at the wrong place.

    And another where the plotting is again completely out ... so far that the entry and exit displayed on the chart are a full 100 pips above the price action. In fact, it seems rare that it's ever in the right place. The visual on the chart seems to be completely out of sync with what's happening in the strategy and the price action being recorded.

    In almost every case (but not all) entry and exit are just plotted as vertical lines instead of the actual entry and exit (specifically I'm talking about exit here).

    This seems very strange, and quite worrying, to me. Can anyone suggest an explanation or method of investigation?

    I'm using NT 6.5.

    Thanks,
    Allan

    #2
    Hi Allan,

    I suggest you first start by debugging via these two tips:



    TraceOrders is especially useful for figuring out what your orders are doing. Start simply and add more and more layers of complexity to your system.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the post Josh, been away for a couple of days.

      For info I think what may have been happening was that the onBarUpdate method was being called by the bar close of another timeframe in my strategy so I've just used BarsInProgress to stop this.

      cheers

      Comment


        #4
        Glad you got it worked out.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rocketman7, Today, 09:41 AM
        4 responses
        15 views
        0 likes
        Last Post rocketman7  
        Started by selu72, Today, 02:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by WHICKED, Today, 02:02 PM
        2 responses
        13 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by f.saeidi, Today, 12:14 PM
        8 responses
        21 views
        0 likes
        Last Post f.saeidi  
        Started by Mikey_, 03-23-2024, 05:59 PM
        3 responses
        56 views
        0 likes
        Last Post Sam2515
        by Sam2515
         
        Working...
        X