NexusFi: Find Your Edge


Home Menu

 





Color coding for indicator line help?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one hector24 with 4 posts (0 thanks)
    2. looks_two GridKing with 2 posts (1 thanks)
    3. looks_3 zeller4 with 1 posts (2 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 5,095 views
    2. thumb_up 4 thanks given
    3. group 3 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread

Color coding for indicator line help?

  #1 (permalink)
 hector24 
austin, texas
 
Experience: Intermediate
Platform: ninja trader
Trading: currency futures
Posts: 506 since Jan 2011
Thanks Given: 14
Thanks Received: 234

If I have a momentum line plotting on Ninja and it is just a single colored line how can I code it to color a particular color for up move and a selected color for down move.

Thanks
Hector

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #2 (permalink)
 
GridKing's Avatar
 GridKing 
San Diego, CA USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 3,630 since May 2011
Thanks Given: 584
Thanks Received: 881


hector24 View Post
If I have a momentum line plotting on Ninja and it is just a single colored line how can I code it to color a particular color for up move and a selected color for down move.

Thanks
Hector

here's what's in guide


Examples

// Initialize method of a custom indicator
protected override void Initialize()
{

// Lines are added to the Lines collection in order
Add(new Line(Color.Gray, 30, "Lower")); // Stored in Lines[0]
Add(new Line(Color.Gray, 70, "Upper")); // Stored in Lines[1]
}



// Dynamically change the upper line's color and thickness based on the indicator value

protected override void OnBarUpdate()

{

if (Value[0] > 70)

Lines[1].Pen = new Pen(Color.Blue, 3);

else

Lines[1].Pen = new Pen(Color.Gray, 1);

}

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103



hector24 View Post
If I have a momentum line plotting on Ninja and it is just a single colored line how can I code it to color a particular color for up move and a selected color for down move.

Thanks
Hector

Best you post your momentum line here for modification.

Reply With Quote
Thanked by:
  #4 (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,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665

 
Thread Moved


Moved to NinjaTrader Programming



When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading



Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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
  #5 (permalink)
 hector24 
austin, texas
 
Experience: Intermediate
Platform: ninja trader
Trading: currency futures
Posts: 506 since Jan 2011
Thanks Given: 14
Thanks Received: 234

Gridking, thanks for your coding. I don't have a clue on how this works. When you have time could you explain how I set this up in Ninja.

Thanks
Hector

Started this thread Reply With Quote
  #6 (permalink)
 
GridKing's Avatar
 GridKing 
San Diego, CA USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 3,630 since May 2011
Thanks Given: 584
Thanks Received: 881


hector24 View Post
Gridking, thanks for your coding. I don't have a clue on how this works. When you have time could you explain how I set this up in Ninja.

Thanks
Hector

Since you are Elite member go to this thread and watch the webinar

I am not much of a programmer and just starting , but the webinar will show you much of what you need to know once you have the basics down....

As far as the basics first , I think the best way to start out is to go to control panel>Help>Help> Ninjascript>educationalresources>basic programming concepts and just start reading , that is where i started , then start to use the wizard with the aid of help guide and then go into code and start to change things and see, but need to get some idea of basics first then the webinar will fill in the blanks

Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 hector24 
austin, texas
 
Experience: Intermediate
Platform: ninja trader
Trading: currency futures
Posts: 506 since Jan 2011
Thanks Given: 14
Thanks Received: 234

Thanks GridKing, Hector. Your information is really appreciated.

Started this thread Reply With Quote
  #8 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404

Hector,

I believe GridKing is showing you how to add two horizontal lines of value 30 or 70.

If I understand your request, you're asking for the rising line to be one color and the falling line to be another color.

if you do a search for PlotColors in futures.io (formerly BMT), you'll find plenty of code examples from the excellent programmers here.

something like this...
 
Code
if(Rising(Value))PlotColors[0][0]=upColor;
if(Falling(Value))PlotColors[0][0]=downColor;
you would need to define upColor/downColor in the variables section.

HTH,

kz

Reply With Quote
Thanked by:
  #9 (permalink)
 hector24 
austin, texas
 
Experience: Intermediate
Platform: ninja trader
Trading: currency futures
Posts: 506 since Jan 2011
Thanks Given: 14
Thanks Received: 234

Zeller4, yes your exactly right that what is I am looking for. I am going to check the information you passed to me.

Thanks
Hector

Started this thread Reply With Quote




Last Updated on July 13, 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