Coding help please for dashed line - futures io
futures io futures trading



Coding help please for dashed line


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one gever17 with 6 posts (3 thanks)
    2. looks_two Big Mike with 1 posts (1 thanks)
    3. looks_3 Turning Point with 1 posts (1 thanks)
    4. looks_4 MooreTech with 1 posts (2 thanks)
      Best Posters
    1. looks_one MooreTech with 2 thanks per post
    2. looks_two cory with 1 thanks per post
    3. looks_3 Big Mike with 1 thanks per post
    4. looks_4 gever17 with 0.5 thanks per post
    1. trending_up 3,851 views
    2. thumb_up 8 thanks given
    3. group 3 followers
    1. forum 10 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Coding help please for dashed line

(login for full post details)
  #1 (permalink)
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
 
Posts: 69 since Nov 2010
Thanks: 329 given, 54 received

Hello,
I am not familiar with ninjascript!!! Would someone please help me out with line issue I am trying to resolve.
I would like to make a solid line a dashed line.
Here is the line code in the indy:

Add(new Line(Color.DarkViolet, -40, "Lower"));
Add(new Line(Color.YellowGreen, 40, "Upper"));

I would like to make these 2 lines dashed when I add the indy to a chart.

Any help would be greatly appreciated!!!!

Thank you for your time

gever17

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
What blockvolume is visible? - order processing
NinjaTrader
Indicators for pair trading MES and M2K
Platforms and Indicators
Short Interest Ratio indicator?
ThinkOrSwim
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
137 thanks
Big Mike in Ecuador
34 thanks
Want your NinjaTrader indicator created, free?
32 thanks
Saturday Morning Market Replay!
20 thanks
Selling Options on Futures?
19 thanks
 
(login for full post details)
  #3 (permalink)
USA
 
Experience: Advanced
Platform: NT, TOS
 
Posts: 65 since Aug 2009
Thanks: 10 given, 43 received



gever17 View Post
Hello,
I am not familiar with ninjascript!!! Would someone please help me out with line issue I am trying to resolve.
I would like to make a solid line a dashed line.
Here is the line code in the indy:

Add(new Line(Color.DarkViolet, -40, "Lower"));
Add(new Line(Color.YellowGreen, 40, "Upper"));

I would like to make these 2 lines dashed when I add the indy to a chart.

Any help would be greatly appreciated!!!!

Thank you for your time

gever17

Add(new Plot(Color.Magenta, "PLOTNAME"));
Plots[
1].PlotStyle = PlotStyle.Line;
Plots[
1].Pen.DashStyle = DashStyle.Dash;
Plots[
1].Pen.Width = 1.0f;


as an example...

Reply With Quote
The following user says Thank You to Turning Point for this post:
 
(login for full post details)
  #4 (permalink)
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
 
Posts: 69 since Nov 2010
Thanks: 329 given, 54 received

WOW!!! Thanks for replying so fast Turning Point!!
Maybe I did not give enough information. I added the code you posted and it worked. But it changed the wrong line.
Here is the code for all the lines in the indy:

Add(new Plot(Color.Green, "SMI")); //<<<<Your code dashed this one>>>>>
Add(new Plot(Color.Orange, "SMIEMA"));

Add(new Line(Color.Firebrick, 0, "Zero")); //<<<<<Trying to dash this>>>>>
Add(new Line(Color.Gray, -50, "Lower")); //<<<<<Trying to dash this>>>>>
Add(new Line(Color.Gray, 50, "Upper")); //<<<<<Trying to dash this>>>>>

My bad for not asking for the right help!!!

Thanks again for your help!!!

gever17

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
 
Posts: 57 since Aug 2010
Thanks: 6 given, 73 received

Try

 
Code
                            
Lines[0].Pen.DashStyle=DashStyle.Dash;
Lines[1].Pen.DashStyle=DashStyle.Dash;
Lines[2].Pen.DashStyle=DashStyle.Dash

Follow me on Twitter Reply With Quote
The following 2 users say Thank You to MooreTech for this post:
 
(login for full post details)
  #6 (permalink)
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,030 since Jun 2009
Thanks: 845 given, 7,894 received


gever17 View Post
WOW!!! Thanks for replying so fast Turning Point!!
Maybe I did not give enough information. I added the code you posted and it worked. But it changed the wrong line.
Here is the code for all the lines in the indy:

Add(new Plot(Color.Green, "SMI")); //<<<<Your code dashed this one>>>>>
Add(new Plot(Color.Orange, "SMIEMA"));

Add(new Line(Color.Firebrick, 0, "Zero")); //<<<<<Trying to dash this>>>>>
Add(new Line(Color.Gray, -50, "Lower")); //<<<<<Trying to dash this>>>>>
Add(new Line(Color.Gray, 50, "Upper")); //<<<<<Trying to dash this>>>>>

My bad for not asking for the right help!!!

Thanks again for your help!!!

gever17

you are having 2 diff type of objects; a plot and a line. Ninja keeps track of plots you add, the first add plot = plot (0) the second add plot = plot (1). The same with lines, first add line = line(0) etc...So pay attention to order of lines, plots when you refer to them.

Reply With Quote
The following user says Thank You to cory for this post:
 
(login for full post details)
  #7 (permalink)
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
 
Posts: 69 since Nov 2010
Thanks: 329 given, 54 received

Thanks MooreTech!!!!!
As soon as I saw what you posted the light bulb came on and it made sense. I added the code and it works perfect!
Thanks so much for your help!
gever17

Started this thread Reply With Quote
The following user says Thank You to gever17 for this post:
 
(login for full post details)
  #8 (permalink)
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
 
Posts: 69 since Nov 2010
Thanks: 329 given, 54 received

Thanks cory for your help!!!
With the help of you guys and your last post I see now how NT keeps track of plots and lines!
Thanks again for the help!!!
gever17

Started this thread Reply With Quote
The following user says Thank You to gever17 for this post:
 
(login for full post details)
  #9 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,790 since Jun 2009
Thanks: 32,314 given, 97,610 received


gever17 View Post
Thanks MooreTech!!!!!


gever17 View Post
Thanks cory for your help!!!

May I also suggest, for your viewing pleasure...





Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #10 (permalink)
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
 
Posts: 69 since Nov 2010
Thanks: 329 given, 54 received


Thanks Big Mike!!!!
I was just looking for how to post a thanks!!!!!!
gever17

Started this thread Reply With Quote
 
(login for full post details)
  #11 (permalink)
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
 
Posts: 69 since Nov 2010
Thanks: 329 given, 54 received

I very much appreciate the time that all of you took to answer my very elementary question!
I now know where the thanks button is also!
gever17

Started this thread Reply With Quote
The following user says Thank You to gever17 for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Coding help please for dashed line


Last Updated on January 3, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts