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

Why I cannot draw anything on chart ?

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

    Why I cannot draw anything on chart ?

    Hi,

    I wanted to draw a line or circle in the indicator code it compiles but nothing is actually drawn on chart.

    Example code:

    protected override void Initialize()
    {
    Overlay = true;
    this.CalculateOnBarClose = false;
    }

    protected override void OnBarUpdate()
    {
    this.DrawLine("line1",20,9740, 5, 9740, Color.Red);
    }

    The price is currently around this level - 9740, but when adding the indicator to chart I didn't see any line. How can I fix this ?

    Thanks in advance.

    Tomasz

    #2
    I'm able to see a following errors in log:
    Error on calling 'OnBarUpdate' method for indicator 'CircleEntries' on bar0. DrawLine: startBarsAgo out of valid range 0 through 0, was 10. Is it possible that drawing on Tick charts isn't supported ? As it's not true that the range is 0 through 0 as there are a lot of bars already since start of trading for today (FDAX).

    Comment


      #3
      tkaluzny, you likely just miss a check for enough CurrentBars here, as you could for example not draw back those bars at the very beginning of the chart.

      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by benmarkal, Yesterday, 12:52 PM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by helpwanted, Today, 03:06 AM
      1 response
      16 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      6 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Working...
      X