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

Arrows not drawing on tick charts

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

    Arrows not drawing on tick charts

    I am developing an indicator that will use arrows and simply put these arrows will not draw on tick or renko charts, only on minute charts, right now I am just trying to get them to print:

    protected override void OnBarUpdate()
    {
    if (Close[1]>Close[0])
    DrawArrowUp("tagA"+CurrentBar, 0, Low[0] - 3 * TickSize, Color.CornflowerBlue);

    Again, using this code they print on time charts but no other type. I am using NT7
    Thanks in advance!

    #2
    Hello meandthetrio,

    Thanks for your post.

    We've moved your topic into "NinjaTrader7 indicator development" just to keep NT7 and NT8 separated as the methods and properties can be different between them. Please help us keep the forums organized by posting in the appropriate topics, thank-you.

    I would suggest adding this line of code just above your if statement: if (CurrentBar < 1) return; // wait until 2nd bar before proceeding

    If you look at the log tab of your control center, you may see errors listed there concerning bar index error. The conditional check of the CurrentBar is to ensure that at least 1 bar gets loaded before the indicator tests to see if the current bar [0] is less then the previous bar[1]. The indicator, when it loads, will always start at the first bar of data and on that first bar there is no [1].

    The reason why it may show on the time based bars but not price based could be coincidental related to the condition used, Close[1]>Close[0].

    Reference: https://ninjatrader.com/support/help...currentbar.htm

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Worked like a charm, thank you so much

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bmartz, Today, 09:30 AM
      2 responses
      11 views
      0 likes
      Last Post bltdavid  
      Started by f.saeidi, Today, 11:02 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by geotrades1, Today, 10:02 AM
      4 responses
      12 views
      0 likes
      Last Post geotrades1  
      Started by rajendrasubedi2023, Today, 09:50 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by lorem, Today, 09:18 AM
      2 responses
      11 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X