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.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sjsj2732, 03-23-2026, 04:31 AM
      0 responses
      76 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      313 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      311 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      149 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      111 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X