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, 02: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 GLFX005, Today, 03:23 AM
          0 responses
          1 view
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          11 views
          0 likes
          Last Post XXtrader  
          Started by Waxavi, Today, 02:10 AM
          0 responses
          6 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by TradeForge, Today, 02:09 AM
          0 responses
          11 views
          0 likes
          Last Post TradeForge  
          Started by Waxavi, Today, 02:00 AM
          0 responses
          2 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Working...
          X