• 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_Paul; 05-16-2018, 02:04 PM.
    PaulNinjaTrader Customer Service

    Comment


      #3
      Hello vanderhe68,

      My previous post was based on NT8. I will edit the reply for NT7.
      Sorry for any confusion.
      PaulNinjaTrader 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?
          PaulNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by 911C4S, Today, 06:51 AM
          0 responses
          6 views
          0 likes
          Last Post 911C4S
          by 911C4S
           
          Started by dlanthana, Today, 06:24 AM
          0 responses
          14 views
          0 likes
          Last Post dlanthana  
          Started by cupir2, 10-13-2018, 04:39 PM
          8 responses
          70 views
          0 likes
          Last Post NinjaTrader_JaredM  
          Started by jg123, Today, 03:34 AM
          0 responses
          8 views
          0 likes
          Last Post jg123
          by jg123
           
          Started by Zeos6, Today, 02:48 AM
          0 responses
          5 views
          0 likes
          Last Post Zeos6
          by Zeos6
           
          Working...
          X