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 arvidvanstaey, Today, 02:19 PM
      2 responses
      6 views
      0 likes
      Last Post arvidvanstaey  
      Started by jordanq2, Today, 03:10 PM
      0 responses
      2 views
      0 likes
      Last Post jordanq2  
      Started by traderqz, Today, 12:06 AM
      10 responses
      18 views
      0 likes
      Last Post traderqz  
      Started by algospoke, 04-17-2024, 06:40 PM
      5 responses
      46 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by mmckinnm, Today, 01:34 PM
      3 responses
      5 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X