• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw object occurring on wrong bar only on live data

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

    Draw object occurring on wrong bar only on live data

    Hello,

    I have built a custom indicator that brings in 3 different bar objects, compares them and then draws an arrow on the primary bar when conditions are met. When I refresh the indicator on historical data, the draw arrow is put on the correct primary bar and everything appears correct.

    When I am watching the indicator in real time, it always seems to draw the arrow on the -1 or prior bar. My value on all draw statements is "0"

    Something is different about realtime vs. historical. Can you please point to what I might be missing?

    Thank you!

    #2
    Hello vanderhe68,

    Thanks for your post.

    Are you running the script with CalculateOnBarClose = false; ?

    What bar type are you using?

    Have you added print statements to time stamp when the arrow is drawn (in real time)?

    Here is a link to our debugging tips: https://ninjatrader.com/support/foru...ead.php?t=3418

    edit: Corrected for NT7
    Last edited by NinjaTrader_PaulH; 05-16-2018, 01:04 PM.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello vanderhe68,

      My previous post was based on NT8. I will edit the reply for NT7.
      Sorry for any confusion.
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Thank you,

        I am using Minute bars for all bar objects. No, I had Calculateonbarclose set to True. That might explain what is happening. I will try setting to False. If I remember correctly, setting to false takes a toll on the CPU?

        Also, what changes in NT8 with all of this?

        Thank you!

        Comment


          #5
          Hello vanderhe68,

          Thanks for your reply.

          With the script running with CalculateOnBarClose = false then the script would run different historically than in real time. All historical performance is done with CalculateOnbarClose = true then as soon as you connect to live data, the mode would change to on each tick.

          As you were using CalculateOnbarClose = true I would expect to see the same behavior live and historically.

          Yes, CalculateOnBarClose = false would use more CPU than operating in True.

          Are you drawing the arrow when BarsInProgress == 0?
          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by timcjpfx, Today, 06:22 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Kate  
          Started by welson, Today, 08:26 AM
          2 responses
          13 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Started by brucerobinson, Today, 08:27 AM
          3 responses
          11 views
          0 likes
          Last Post NinjaTrader_Kate  
          Started by Leeroy_Jenkins, Today, 07:45 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by 1001111, 02-22-2020, 09:10 AM
          5 responses
          41 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X