Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Make line plot vary between dash and dot style

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

  • patricia70
    replied
    I have named them exactly as you did in your example (Test1 and Test2). But that doesn't work because I get the mentioned error.

    I have found out by trial and error that I can use the two different plots by:

    Code:
    Values[0][0] = Low[0];
    Values[1][0] = High[0];

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello patricia70,

    Thanks for your reply.

    Test1 and Test2 are the names of the plots, so if you named your plots differently then you would need to references those names.

    Leave a comment:


  • patricia70
    replied
    Originally posted by NinjaTrader_PaulH View Post
    You may be able to accomplish your goal by using multiple plots, each set to the DashStyle of your choice. I've attached a screenshot of a quick example.
    I am getting the errors here when compiling:

    "name Test1 does not exist in current environment" CS0103
    "name Test2 does not exist in current environment" CS0103

    Do I need to declare this variable in the beginning somewhere? I don't see anything else related to Test1 or Test2 in your screenshot. Maybe if you scroll up ?

    Leave a comment:


  • catinabag
    replied
    cool - thank you !

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello catinabag,

    Thanks for your post.

    With a plot, you cannot change the PlotStyle or DashStyle in the same manner as the PlotBrush.

    The PlotStyle or DashStyle would be applied to the entire plot.

    You may be able to accomplish your goal by using multiple plots, each set to the DashStyle of your choice. I've attached a screenshot of a quick example.

    Click image for larger version

Name:	DashStylePlotExample.PNG
Views:	962
Size:	131.9 KB
ID:	1108664

    Leave a comment:


  • catinabag
    started a topic Make line plot vary between dash and dot style

    Make line plot vary between dash and dot style

    Hello,

    I have been changing color of my line plot through the if - else approach, like this:

    if (Plot0[0] > Plot0[1])
    {
    PlotBrushes[0][0] = Brushes.GhostWhite;
    }
    else if (Plot0[0] < Plot0[1])
    {
    PlotBrushes[0][0] = Brushes.Red;
    }
    else
    {
    PlotBrushes[0][0] = Brushes.Gray;
    }

    Could you please tell me the equivalent line I should utilize within the brackets in order to make the line go from dash to dot?

    Thank you,

Latest Posts

Collapse

Topics Statistics Last Post
Started by Mindset, 04-21-2026, 06:46 AM
0 responses
52 views
0 likes
Last Post Mindset
by Mindset
 
Started by M4ndoo, 04-20-2026, 05:21 PM
0 responses
71 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by M4ndoo, 04-19-2026, 05:54 PM
0 responses
38 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
99 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
60 views
0 likes
Last Post PaulMohn  
Working...
X