Big Mike's Trading Forum
 

Go Back   Big Mike's Trading Forum

> Trading Forums > Platforms and Indicators > NinjaTrader > NinjaTrader Programming


Notices
     

Color change in an indicator line
Started:January 11th, 2011 (12:22 PM) by macro Views / Replies:1,554 / 9
Last Reply:March 16th, 2012 (05:12 PM) Attachments:3

Welcome to Big Mike's Trading Forum.

Welcome, Guest!

This forum was established to help traders by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

BMT is fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


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, and we will never resell your private information.

-- Big Mike
     

Reply
 
Thread Tools Search this Thread

Color change in an indicator line

Old January 11th, 2011, 12:22 PM   #1 (permalink)
Elite Member
South Pasadena, California, Un
 
Trading Experience: Intermediate
Platform: NinjaTrader
Favorite Instrument: ES
 
macro's Avatar
 
Posts: 5 since Dec 2010
Thanks: 0 given, 2 received

Color change in an indicator line

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

Reply With Quote
     

Old January 11th, 2011, 12:22 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

     

Old January 11th, 2011, 01:27 PM   #3 (permalink)
Elite Member
Dallas, TX
 
Trading Experience: Beginner
Platform: Ninjatrader
Broker/Data: Zen-Fire
Favorite Instrument: ZN, 6E
 
gulabv's Avatar
 
Posts: 279 since May 2010
Thanks: 157 given, 145 received


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 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
     
The following user says Thank You to gulabv for this post:
     

Old January 11th, 2011, 02:40 PM   #4 (permalink)
Market Wizard
Houston,Tx
 
Trading Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Instrument: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,153 received


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
Color change in an indicator line-ccicolor.png  
Reply With Quote
     

Old January 11th, 2011, 02:59 PM   #5 (permalink)
Elite Member
South Pasadena, California, Un
 
Trading Experience: Intermediate
Platform: NinjaTrader
Favorite Instrument: ES
 
macro's Avatar
 
Posts: 5 since Dec 2010
Thanks: 0 given, 2 received

Color change crossing zero

Current BMT User Poll

Should sim traders that pretend to trade cash be allowed on BMT?

 
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

Reply With Quote
     

Old January 11th, 2011, 03:41 PM   #6 (permalink)
Market Wizard
Houston,Tx
 
Trading Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Instrument: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,153 received

Here Ya Go


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 BMT but am not an employee of or a spokesperson for BMT and receive no compensation for recommending BMT Elite membership.

Please register to view the post attachment(s), image(s), or screenshot(s) - it's simple and free.


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
     
The following 2 users say Thank You to ThatManFromTexas for this post:
     

Old January 11th, 2011, 04:11 PM   #7 (permalink)
Elite Member
Dallas, TX
 
Trading Experience: Beginner
Platform: Ninjatrader
Broker/Data: Zen-Fire
Favorite Instrument: ZN, 6E
 
gulabv's Avatar
 
Posts: 279 since May 2010
Thanks: 157 given, 145 received

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

Reply With Quote
     

Old January 11th, 2011, 04:17 PM   #8 (permalink)
Elite Member
South Pasadena, California, Un
 
Trading Experience: Intermediate
Platform: NinjaTrader
Favorite Instrument: ES
 
macro's Avatar
 
Posts: 5 since Dec 2010
Thanks: 0 given, 2 received

THANKS!!

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

Reply With Quote
     

Old January 12th, 2011, 11:14 AM   #9 (permalink)
Elite Member
Denver, CO
 
Trading Experience: Advanced
Platform: NinjaTrader
Favorite Instrument: ES
 
NinjaTrader's Avatar
 
Posts: 688 since May 2010
Thanks: 61 given, 881 received


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 - NinjaTrader Support Forum

Reply With Quote
     
The following 2 users say Thank You to NinjaTrader for this post:
     

Old March 16th, 2012, 05:12 PM   #10 (permalink)
Elite Member
Accokeek, USA
 
Trading Experience: Beginner
Platform: NT
Favorite Instrument: ES
 
Posts: 19 since Mar 2011
Thanks: 5 given, 12 received

Indicator color change up/dn NT7


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
     

Reply



Tags
adx, c#, cci, change, code, color, color changes, day, dow, easy language, elite, free, functions, guru, histogram, how to, indicator, indicators, language, line, load, modify, moves, ninja, ninjascript, ninjatrader, nt, nt7, pivots, plot, programmer, programming, question, review, start, support, syntax, tax, texas, time, traders
     

Big Mike's Trading Forum > Trading Forums > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Color change in an indicator line

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Color coding for indicator line help? hector24 NinjaTrader Programming 8 July 13th, 2011 09:10 PM
Change color of LineOnClose from an indicator? ThatManFromTexas NinjaTrader 1 May 11th, 2011 06:00 PM
Color Shading Fibonacci Line Levels trs3042 NinjaTrader 2 December 30th, 2010 12:09 PM
ADX color line change in DM Indicator Joshua 1 vs 8 NinjaTrader Programming 30 October 31st, 2010 03:10 PM
Color changing Regression Line with Paint Bar Gibby NinjaTrader Programming 49 April 23rd, 2010 02:54 PM


All times are GMT -4. The time now is 07:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2014 by Big Mike Trading. 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

Page generated 2014-04-18 in 0.15 seconds with 20 queries on atlantis via your IP 54.205.95.9