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:9,655 / 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 90,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: looking
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 508 since Mar 2011
Thanks: 1,153 given, 512 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,652 since Mar 2010
Thanks: 4,226 given, 25,601 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,067 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: looking
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 508 since Mar 2011
Thanks: 1,153 given, 512 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: looking
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 508 since Mar 2011
Thanks: 1,153 given, 512 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,067 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: looking
Favorite Futures: CL
 
michaelf's Avatar
 
Posts: 508 since Mar 2011
Thanks: 1,153 given, 512 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,067 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,067 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

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


All times are GMT -4. The time now is 06:51 PM.

Copyright © 2017 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 2017-12-13 in 0.11 seconds with 20 queries on phoenix via your IP 54.90.92.204