NexusFi: Find Your Edge


Home Menu

 





Color change in an indicator line


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one macro with 3 posts (0 thanks)
    2. looks_two ThatManFromTexas with 2 posts (2 thanks)
    3. looks_3 gulabv with 2 posts (1 thanks)
    4. looks_4 NinjaTrader with 1 posts (3 thanks)
    1. trending_up 6,558 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 3 attachments




 
Search this Thread

Color change in an indicator line

  #1 (permalink)
 
macro's Avatar
 macro 
South Pasadena, California, Un
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 5 since Dec 2010
Thanks Given: 0
Thanks Received: 2

Hi,
Could someone give me a snippet of code that changes the color of an indicator line to green when it moves above zero and red when it moves below zero?
Thanks in advance.
Macro

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
gulabv's Avatar
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
Posts: 286 since May 2010
Thanks Given: 161
Thanks Received: 169


NT has built-in functions called CrossAbove and CrossBelow to check for the zero cross.
Check out the help section of NT on these functions.
Also I would suggest you check out some of the free indicators in the futures.io (formerly BMT) download area for code samples on how to change the color. You will have to write code to modify the plot properties but it's difficult to give a specific answer since you have not specified what indicator you want to modify.

Reply With Quote
Thanked by:
  #4 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,353


macro View Post
Hi,
Could someone give me a snippet of code that changes the color of an indicator line to green when it moves above zero and red when it moves below zero?
Thanks in advance.
Macro

Which indicator? Is it a line or a Histogram? See the attached pic.

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Attached Thumbnails
Click image for larger version

Name:	CCIcolor.png
Views:	320
Size:	65.3 KB
ID:	28192  
Reply With Quote
  #5 (permalink)
 
macro's Avatar
 macro 
South Pasadena, California, Un
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 5 since Dec 2010
Thanks Given: 0
Thanks Received: 2

Hi Man From Texas,
Thank you for your response.
The indicator in question is the LinRegSlope. I know that comes with NT7 and cannot be changed but I like to use a zero line with it and I got tired of drawing a zero line, so I managed to cobble together LinRegSlope with a zero line. Then I realized it would be nice if the indicator changed to green above zero and red below. I am familiar with TS Easy Language and it is an easy matter to do color changes with Easy Language. However, when I looked at the color change code in some other indicators, I decided it was not so easy and obvious in C#.
Your assistance would be most appreciated.
Regards,
Macro

Started this thread Reply With Quote
  #6 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,353


macro View Post
Hi Man From Texas,
Thank you for your response.
The indicator in question is the LinRegSlope. I know that comes with NT7 and cannot be changed but I like to use a zero line with it and I got tired of drawing a zero line, so I managed to cobble together LinRegSlope with a zero line. Then I realized it would be nice if the indicator changed to green above zero and red below. I am familiar with TS Easy Language and it is an easy matter to do color changes with Easy Language. However, when I looked at the color change code in some other indicators, I decided it was not so easy and obvious in C#.
Your assistance would be most appreciated.
Regards,
Macro

Here ya go...

You should see all the really cool free stuff in the Elite Section. I strongly suggest you become an Elite member (Click on Elite Access at the top of the home page) it's painless and offers a tremendous amount of resources for traders.

Disclaimer: I am not a programmer, coach, trainer or self appointed guru. Have a professional review any code you receive from me before you trade real money with it. I am an Elite member of futures.io (formerly BMT) but am not an employee of or a spokesperson for futures.io (formerly BMT) and receive no compensation for recommending futures.io (formerly BMT) Elite membership.



LinRegSlopeTMFT.zip

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
Thanked by:
  #7 (permalink)
 
gulabv's Avatar
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
Posts: 286 since May 2010
Thanks Given: 161
Thanks Received: 169

LOL TMFT you crack me up each time you post on this forum! The next beer is on me!!

Reply With Quote
  #8 (permalink)
 
macro's Avatar
 macro 
South Pasadena, California, Un
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 5 since Dec 2010
Thanks Given: 0
Thanks Received: 2

Thanks so much for the responses, especially TMFT.
Best Regards,
Macro

Started this thread Reply With Quote
  #9 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,713 since May 2010
Thanks Given: 203
Thanks Received: 2,686


macro View Post
Hi,
Could someone give me a snippet of code that changes the color of an indicator line to green when it moves above zero and red when it moves below zero?
Thanks in advance.
Macro


Here is a good reference to start - Indicator: Multi-Colored Plots - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

Follow me on Twitter Reply With Quote
Thanked by:
  #10 (permalink)
 KySt 
Accokeek, USA
 
Experience: Intermediate
Platform: NT & TOS
Trading: ES RUT
Posts: 92 since Mar 2011
Thanks Given: 17
Thanks Received: 24


Good day TMFT,

I sent a message on this. How can I or you :-) do this for an ADX or CCI, when the indicator pivots form up/dn? I am not a coder, but figured adding the correct syntax of the NT7 indicator and saving it with a new name would work. No success finding the correct syntax to make it work.

Any help would be appreciated. Thanks -Ky

Reply With Quote




Last Updated on March 16, 2012


© 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