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 alifarahani, Today, 09:40 AM
          3 responses
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by RookieTrader, Today, 09:37 AM
          4 responses
          18 views
          0 likes
          Last Post RookieTrader  
          Started by PaulMohn, Today, 12:36 PM
          0 responses
          5 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          40 views
          0 likes
          Last Post love2code2trade  
          Started by junkone, Today, 11:37 AM
          3 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X