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:	372
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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    80 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X