NexusFi: Find Your Edge


Home Menu

 





Coding help please for dashed line


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one gever17 with 6 posts (3 thanks)
    2. looks_two cory with 1 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (1 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 5,525 views
    2. thumb_up 8 thanks given
    3. group 3 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

Coding help please for dashed line

  #1 (permalink)
 gever17 
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54

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 NexusFi?
What broker to use for trading palladium futures
Commodities
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #3 (permalink)
 Turning Point 
USA
 
Experience: Advanced
Platform: NT, TOS
Posts: 65 since Aug 2009
Thanks Given: 10
Thanks Received: 44



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
Thanked by:
  #4 (permalink)
 gever17 
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54

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
  #5 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
Posts: 57 since Aug 2010
Thanks Given: 6
Thanks Received: 73

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
Thanked by:
  #6 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


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
Thanked by:
  #7 (permalink)
 gever17 
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54

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
Thanked by:
  #8 (permalink)
 gever17 
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54

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
Thanked by:
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,237
Thanks Received: 101,661


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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
 gever17 
Cheyenne,Wyoming...USA
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54


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

Started this thread Reply With Quote




Last Updated on January 3, 2011


© 2024 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 - Privacy Policy - Downloads - Top
no new posts