NexusFi: Find Your Edge


Home Menu

 





Need Plot code help


Discussion in NinjaTrader

Updated
    1. trending_up 378 views
    2. thumb_up 7 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 ndakotan 
Minot, North Dakota, USA
 
Experience: Beginner
Platform: Ninja Trader, AMT AutoTra
Trading: ES Mini
Posts: 26 since May 2019
Thanks Given: 14
Thanks Received: 12

I have an indicator working the way I want it except for 1 detail:

I want to be able to handle Dash Style in this line if possible

Plots[7].PlotStyle = PlotStyle.Square; Plots[7].Width = 2;

For instance I would like Dash (Square) line. At this point, Dash Style can only be set in the parameters when using the indicator. Since there are a few lines, I'd like to be able to pre-set some to Dash, or Dash Dot.

I keep getting pointed toward DashStyleHelper for the Dash Style, which rarely (if ever) works for me. Any hints on how to get DashStyleHelper to work in 8.1+?

Someone suggested I add an opacity setting for each line. if that can be set in the line I'd be interested in that as well. if not, that can somewhat be handled by picking lighter colors.


Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Prop Firm Tracked Payouts Hit $115M in Q1 but Growth Fla …
Funded Trading Evaluation Firms
Expiration Day: Wall Street Rallies on Peace Hopes While …
Prediction Markets & Event Contracts
CME Group Fee Schedule Changes Hit All Four Exchanges -- …
Traders Hideout
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #2 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018


ndakotan View Post
I have an indicator working the way I want it except for 1 detail:

I want to be able to handle Dash Style in this line if possible

Plots[7].PlotStyle = PlotStyle.Square; Plots[7].Width = 2;

For instance I would like Dash (Square) line. At this point, Dash Style can only be set in the parameters when using the indicator. Since there are a few lines, I'd like to be able to pre-set some to Dash, or Dash Dot.

I keep getting pointed toward DashStyleHelper for the Dash Style, which rarely (if ever) works for me. Any hints on how to get DashStyleHelper to work in 8.1+?

Someone suggested I add an opacity setting for each line. if that can be set in the line I'd be interested in that as well. if not, that can somewhat be handled by picking lighter colors.

I'm AFK but if no one replies I will post the code when I'm not on my tablet


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Reply With Quote
Thanked by:
  #3 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,801 since Aug 2009
Thanks Given: 11,742
Thanks Received: 3,018



ndakotan View Post
I have an indicator working the way I want it except for 1 detail:

I want to be able to handle Dash Style in this line if possible

Plots[7].PlotStyle = PlotStyle.Square; Plots[7].Width = 2;

For instance I would like Dash (Square) line. At this point, Dash Style can only be set in the parameters when using the indicator. Since there are a few lines, I'd like to be able to pre-set some to Dash, or Dash Dot.

I keep getting pointed toward DashStyleHelper for the Dash Style, which rarely (if ever) works for me. Any hints on how to get DashStyleHelper to work in 8.1+?

Someone suggested I add an opacity setting for each line. if that can be set in the line I'd be interested in that as well. if not, that can somewhat be handled by picking lighter colors.

You did not post all of the line code so it is a little difficult to know what would work best for your needs
But here a the way to plot the line.

AddPlot(new Stroke(Brushes.PeachPuff, DashStyleHelper.Dot, 3), PlotStyle.Line, "Line Name");

If you want to assign those settings separately you could use:

AddPlot(Brushes.Chartreuse, "Line Name");
Plots[0].Width = 3;
Plots[0].DashStyleHelper.DashDotDot;


If you want to change the DashStyleHelper to a different choice, let NTScript fill in the options for you.
To do that type:
Plots[0].DashStyleHelper
When you add the DOT after the "DashStyleHelper" NT script will popup a box showing what options are available. Select what you want and hit enter.

*******
TIp: Open other indicators in the NT Editor and you can see the code and options for other coding methods when you get stuck.


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
 ndakotan 
Minot, North Dakota, USA
 
Experience: Beginner
Platform: Ninja Trader, AMT AutoTra
Trading: ES Mini
Posts: 26 since May 2019
Thanks Given: 14
Thanks Received: 12


DavidHP View Post
You did not post all of the line code so it is a little difficult to know what would work best for your needs
But here a the way to plot the line.

AddPlot(new Stroke(Brushes.PeachPuff, DashStyleHelper.Dot, 3), PlotStyle.Line, "Line Name");

If you want to assign those settings separately you could use:

AddPlot(Brushes.Chartreuse, "Line Name");
Plots[0].Width = 3;
Plots[0].DashStyleHelper.DashDotDot;


If you want to change the DashStyleHelper to a different choice, let NTScript fill in the options for you.
To do that type:
Plots[0].DashStyleHelper
When you add the DOT after the "DashStyleHelper" NT script will popup a box showing what options are available. Select what you want and hit enter.

*******
TIp: Open other indicators in the NT Editor and you can see the code and options for other coding methods when you get stuck.

thank you


Started this thread Reply With Quote
Thanked by:




Last Updated on April 8, 2026


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts