Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can't Draw Vertical Line - Unhandled Exception

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

    Can't Draw Vertical Line - Unhandled Exception


    Can you tell me how to fix this please:

    Click image for larger version

Name:	_delete.JPG
Views:	367
Size:	15.8 KB
ID:	1149935

    I've attached a bare bones indicator as an example, but basically it has 2 lines only:

    Code:
    if(Bars.BarsSinceNewTradingDay == 120)
    Draw.VerticalLine(this,CurrentBar.ToString(),0,Brushes.Yellow,DashStyleHelper.Solid,5);
    The line still draws fine but the error popup is annoying.
    Also the line is not linked to the indicator. Meaning I can unlock + remove the line manually but the indicator stays. (not wanted)
    Removing the indicator gives the popup error again and the drawn line remains on the chart as an orphaned object.

    When the draw is enclosed in a dispatcher invoke then the popup issue is fixed, but it creates another problem.
    The line is once again detached from the indicator, but now on every reload of the indicator it draws another copy of the line without removing the old one.
    So hardly ideal. If the indicator is removed then the popup error appears again and the drawn line remains as an orphan same as above.

    So both ways have their multiple issues.

    Any solution appreciated.


    #2
    Hello anon84,

    This code is not likely the cause of the error.

    I've tested and I was not able to reproduce.



    To confirm you are using 8.0.24.1?

    If you close all open workspaces and in a new blank workspace if you open a new chart and add this indicator the error appears?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X