Add Background Color function to an indicator - NinjaTrader Programming | futures io social day trading
futures io futures trading


Add Background Color function to an indicator
Updated: Views / Replies:11,052 / 33
Created: by michaelf Attachments:11

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 11  
 
Thread Tools Search this Thread
 

Add Background Color function to an indicator

  #1 (permalink)
Elite Member
Mérida, Mexico
 
Futures Experience: Intermediate
Platform: NinjaTrader 8
Broker/Data: NinjaTrader Brokerage
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 525 since Mar 2011
Thanks: 1,223 given, 531 received

Add Background Color function to an indicator

I don't have any programer experience, but i would like to add an background color function to all my indicators, like the one on the MACDBBLinesV4. Simple panel background color change when indicator changes direction.
Question: is it very difficult, specialy for me, to make this add to the indicators?

thanks for answers

michael

Attached Thumbnails
Add Background Color function to an indicator-eurusd.jpg  
Reply With Quote
 
  #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.

 
  #3 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,693 since Mar 2010
Thanks: 4,228 given, 25,791 received
Forum Reputation: Legendary



michaelf View Post
I don't have any programer experience, but i would like to add an background color function to all my indicators, like the one on the MACDBBLinesV4. Simple panel background color change when indicator changes direction.
Question: is it very difficult, specialy for me, to make this add to the indicators?

thanks for answers

michael

It is not difficult to add this to any indicator. You will need to

(1) declare color variables in the Variables section of the indicator, something like

 
Code
private Color upColor = Color.LimeGreen;
private Color downColor = Color.Red;
private int opacity = 5;
(2) introduce a condition specifiying when your background shall be painted at the end of the OnBarUpdate() section, for example

 
Code
int alpha =  25 * opacity;
if (Value[0]>Value[1]) // rising indicator value
      BackColor = Color.FromArgb(alpha, upColor)
else // falling indicator value
      BackColor = Color.FromArgb(alpha, downColor)
If you use BackColorAll instead of BackColor, all panels of the chart will be colored, with BackColor only the indicator panel will be colored.

(3) If you want the colors to be user selectable you need to serialize the colors. You should define a property for the opacity. This can be done in the Properties Section of the indicator. Best copy the code from another indicator and just change the variables. Opacity should be a value between 0 and 10, so you would declare it as:

 
Code
  /// <summary>
        /// </summary>
        [Description("Opacity of Background ")]
        [GridCategory("Plots")]
        [Gui.Design.DisplayNameAttribute("Background Opacity")]
        public int Opacity
        {
            get { return opacity; }
            set { opacity = Math.Min(10, Math.Max(0, value)); }
        }

Reply With Quote
The following 8 users say Thank You to Fat Tails for this post:
 
  #4 (permalink)
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,073 received

If you want a readymade recipe this thread is about it https://futures.io/ninjatrader-programming/5686-make-charts-pretty.html

Reply With Quote
The following 4 users say Thank You to redratsal for this post:
 
  #5 (permalink)
Elite Member
Mérida, Mexico
 
Futures Experience: Intermediate
Platform: NinjaTrader 8
Broker/Data: NinjaTrader Brokerage
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 525 since Mar 2011
Thanks: 1,223 given, 531 received

Thank you Fat Tails for you reply

I want only that the indicator panel to be colored and I thought the same that I need to take first look on a existend indicator. I will to try it first with a Stochastic, because the WMA_colors indicator I use, yeah, I think with that one it will be to much.

Thanks again

Reply With Quote
 
  #6 (permalink)
Elite Member
Mérida, Mexico
 
Futures Experience: Intermediate
Platform: NinjaTrader 8
Broker/Data: NinjaTrader Brokerage
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 525 since Mar 2011
Thanks: 1,223 given, 531 received

redratsal thank you for you reply

I like the idea of bigmike's (thread 30) design, but it will be very hurtfurlly for me, every time when my wife will see this she will hit me on the head.

Reply With Quote
 
  #7 (permalink)
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,073 received


michaelf View Post
redratsal thank you for you reply

I like the idea of bigmike's (thread 30) design, but it will be very hurtfurlly for me, every time when my wife will see this she will hit me on the head.


Reply With Quote
 
  #8 (permalink)
Elite Member
Mérida, Mexico
 
Futures Experience: Intermediate
Platform: NinjaTrader 8
Broker/Data: NinjaTrader Brokerage
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 525 since Mar 2011
Thanks: 1,223 given, 531 received

HELP

I tried now everything but without success, it is to difficult for me.
Maybe someone out there can write a script for me. I wish to have a simple Stochastics with panel background color on the PeriodD and PeriodK crossover.
I maked a screenshot of an example, only on this indicator the Period D linie change it color when it changes direction and I would wish when D and K makes a crossover.

Hopefully some one can help me I would really appreciated it.

Thanks a lot
Michael

Attached Thumbnails
Add Background Color function to an indicator-eurusd.jpg  
Reply With Quote
 
  #9 (permalink)
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,073 received

it's elite post #2637 https://futures.io/elite-group-trading-methods/1261-want-your-ninjatrader-indicator-created-free-264.html#post124198

Reply With Quote
 
  #10 (permalink)
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,073 received


you are lucky same but not elite https://futures.io/ninjatrader/7507-ninja-background-colour-dependant-indicator.html#post86719

consider beeing elite you get a lot more...

Reply With Quote

Reply



futures io > > > > > Add Background Color function to an indicator




Upcoming Webinars and Events (4:30PM ET unless noted)

July Journal Challenge - $500 in Amazon Gift Cards!

July
 

AXESS Trader: Powerful Cloud Based Trading Platform w/GFF Brokers

Jul 17

TBA: FuturesTrader71 w/Morad Askar

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Background color neilzep NinjaTrader 4 May 17th, 2011 10:58 PM
Calling Indicator in Wrapper Function? serac NinjaTrader Programming 2 February 9th, 2011 03:54 PM
ninja background colour dependant on indicator kiwihsv NinjaTrader 9 January 6th, 2011 02:57 AM
Message for MindSet regarding your gradient background indicator FBJS NinjaTrader Programming 12 December 16th, 2010 07:40 AM
Set Background Color in EasyLanguage Big Mike EasyLanguage Programming 5 October 27th, 2010 12:45 PM


All times are GMT -4. The time now is 08:21 AM. (this page content is cached, log in for real-time version)

Copyright © 2018 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
Page generated 2018-07-18 in 0.14 seconds with 16 queries on phoenix