• 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

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.

      http://www.ninjatrader.com/support/h...currentbar.htm
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Bionian, Today, 10:10 AM
      2 responses
      14 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by D Trader, Today, 01:41 PM
      0 responses
      7 views
      0 likes
      Last Post D Trader  
      Started by rexmie888, Today, 04:00 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by terminatorT1000, Today, 01:23 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by Tradarr, Today, 12:25 PM
      0 responses
      7 views
      0 likes
      Last Post Tradarr
      by Tradarr
       
      Working...
      X