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 geddyisodin, Today, 05:20 AM
      6 responses
      34 views
      0 likes
      Last Post geddyisodin  
      Started by trilliantrader, Today, 03:01 PM
      0 responses
      3 views
      0 likes
      Last Post trilliantrader  
      Started by pechtri, 06-22-2023, 02:31 AM
      9 responses
      122 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by frankthearm, 04-18-2024, 09:08 AM
      16 responses
      67 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by habeebft, Today, 01:18 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X