Coloring an IndicatorLine by Slope: Questions for Optimal Coding - NinjaTrader Programming | futures io social day trading
futures io futures trading


Coloring an IndicatorLine by Slope: Questions for Optimal Coding
Updated: Views / Replies:14,504 / 59
Created: by Trendseek Attachments:19

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
 19  
 
Thread Tools Search this Thread
 

Coloring an IndicatorLine by Slope: Questions for Optimal Coding

  #11 (permalink)
tw
Singapore
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: EUR/USD CL TF
 
Posts: 73 since Sep 2011
Thanks: 80 given, 12 received


Fat Tails View Post
Coloring an indicator by slope is pretty simple. Let us assume that you want to color the first PlotSeries of an indicator, which is called Values[0]. Then you need to define two colors, "upColor" and "downColor", which you use for coloring the slope.

You will then need to take into account three cases: rising slope, falling slope, zero slope. Here is the code

 
Code
if (CurrentBar > 0)
{
       if(Values[0][0] > Values [0][1])  
                 PlotColors[0][0] = upColor;
       else if (Values[0][0] < Values[0][1])
                 PlotColors[0][0] = downColor;
       else 
                 PlotColors[0][0] = PlotColors[0][1];
}
Attached is an example for an indicator, which colors the indicator plot and the paint bars based on slope.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

@Fat Tails
How can I use this indicator to pain the SMA slope?
Thank you
tw

Reply With Quote
 
  #12 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,293 received


Fat Tails View Post
If we want to define a neutral zone for the slope, we have to check the slope against volatility. This can be done by using any measure for volatility, for example

-> average true range
-> average range
-> standard deviation

But don't use the ticksize. Attached is an example of an experimental study to color the slope of the midband and the channel lines of the Bollinger Bands. The indicator uses the average true range to normalize slope and has a number of options. For example you may color the channel lines according to their own slope, or according to the slope of the midband.

This indicator is consistent across instruments and timeframes. You can use the same setting for YM 03-12 and ES 03-12, irrespective of their different tick sizes. And if you apply that indicator to a 60 min chart of YM, the neutral zone will not dissolve into nothing. Chart and indicator attached.

@Trendseek: Would like to know, whether you will apply that method to the RSI.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

@Fat Tails

What if you use range bars?

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
 
  #13 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary



ThatManFromTexas View Post
@Fat Tails

What if you use range bars?

You can easily use the indicator with range bars.

Reply With Quote
 
  #14 (permalink)
Trading Apprentice
united states
 
Futures Experience: Intermediate
Platform: ninjatrader
Favorite Futures: oil/gold
 
Posts: 2 since Mar 2011
Thanks: 0 given, 0 received

Color coded TRIX indicator

Hello,
does anyone know where i can find a free basic NT7 TRIX indicator coded one color for rising and another color for falling?

thx

Reply With Quote
 
  #15 (permalink)
Elite Member
Massachusetts (USA)
 
Futures Experience: None
Platform: NinjaTrader
Favorite Futures: YM
 
stephenszpak's Avatar
 
Posts: 778 since Jun 2009
Thanks: 144 given, 358 received


Fat Tails View Post
"Slope" does not exist on scalable charts. The concept "Slope" refers to print outs and was used 50 years ago when charts were printed and neither the time scale nor the price scale were ever changed.




Ticks are not suited to normalize momentum or slope

But ticks or tick size are not at all suited, because the ticks do not reflect volatility.

Forget the ticks, you cannot use them for normalization. And best forget the concept of slope, angles and remember that they were just used to visualize momentum, when charts were printed.

Hi Fat Tails

I was wondering what you think about using the slope of a SMA=2. In this case it would be on a 3 RangeNoGap
chart of the 6E. Not sure how to do this:

The chart that use candles shows that I would want candles colored in 3 possible ways.

YELLOW for up move that has significance
RED for no movement or little movement

BLACK for down move that has significance (no example area shown on the chart however)

The chart that uses HiLo bars is what I'd actually be thinking of using, if there is some way to
do this in the end.

Apparently there is no way to color code wicks of candles in NT?? So I am thinking about
color coding entire HiLo bars which is possible and apparently the way to go in this???

The HiLo chart provided is not important at the moment really.


So in the first chart the ideal color coding for the 8 candles/HiLo bars in question would be:

RED RED RED RED RED (No movement in price as shown by SMA=2.)
YELLOW (Price moves up significantly. Slope of SMA=2 seems significant.)
RED (No movement in price as shown by SMA=2.)
RED (Critical bar here. There is little price movement. Slope of SMA=2 is not sharply downward.
Since I'd be applying whatever I used in the end to the HiLo chart, this candle,
because there is almost no price movement, would be colored RED.)

Next HiLo bar would of course be colored YELLOW, as price make another sharp
move to the upside.

I'm looking at the angle of the SMA=2, but from what I thought I read about this matter it
is never good to look at the angle of a moving average or use ticks either??? I'm sure I missed
something somewhere that stated what I should do.

Thanks if you have time for this,

(Only thinking about RangeNoGap charts, and only thinking about a simple moving average
that is a value of 2. Don't know if that would matter. Just an additional comment.)

- Stephen

Attached Thumbnails
Coloring an IndicatorLine by Slope: Questions for Optimal Coding-3-rangenogap-sma-2-using-candles.png   Coloring an IndicatorLine by Slope: Questions for Optimal Coding-3-rangenogap-sma-2-using-hilo-bars.png  
Reply With Quote
 
  #16 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary

@stephenszpak: It is possible to change the color of the wicks. However in that case also the outline of the candle will be changed. You could try the following code:

 
Code
if (CurrentBar > 0) 
{        
       if(SMA(2)[0] > SMA (2)[1])
       {        
              BarColor = Color.Yellow;
              CandleOutlineColor = Color.Yellow;
       } 
       else if(SMA(2)[0] < SMA (2)[1])
       {        
              BarColor = Color.Black;
              CandleOutlineColor = Color.Black;
       } 
       else
       {        
              BarColor = Color.Red;
              CandleOutlineColor = Color.Red;
       } 
}
Not tested.


Last edited by Fat Tails; April 15th, 2012 at 05:43 PM.
Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
 
  #17 (permalink)
Elite Member
Massachusetts (USA)
 
Futures Experience: None
Platform: NinjaTrader
Favorite Futures: YM
 
stephenszpak's Avatar
 
Posts: 778 since Jun 2009
Thanks: 144 given, 358 received


Fat Tails View Post
@stephenszpak: It is possible to change the color of the wicks.

Thanks. The main idea I had was with slope though. It slope totally pointless?
What would you suggest here?

- Stephen

Reply With Quote
 
  #18 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


stephenszpak View Post
Thanks. The main idea I had was with slope though. It slope totally pointless?
What would you suggest here?

- Stephen

The code above checks for the slope of the SMA(2).

Reply With Quote
 
  #19 (permalink)
Elite Member
Massachusetts (USA)
 
Futures Experience: None
Platform: NinjaTrader
Favorite Futures: YM
 
stephenszpak's Avatar
 
Posts: 778 since Jun 2009
Thanks: 144 given, 358 received


Fat Tails View Post
The code above checks for the slope of the SMA(2).

Ok great.

So if the SMA(2) is going sideways, just slightly upwards, and just slightly downwards,
the coloring is RED. I can't see that it does that at the moment.

Reply With Quote
 
  #20 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary



stephenszpak View Post
Ok great.

So if the SMA(2) is going sideways, just slightly upwards, and just slightly downwards,
the coloring is RED. I can't see that it does that at the moment.

Then you need to define what is "slightly". I would use a multiple of the range or average range.

Reply With Quote
The following user says Thank You to Fat Tails for this post:

Reply



futures io > > > > > Coloring an IndicatorLine by Slope: Questions for Optimal Coding

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
Some Basic NinjaTrader Coding Questions -- IDataSeries Crow NinjaTrader Programming 7 October 15th, 2017 04:49 AM
Tricky NinjaScript coding {questions} . . . jmejedi NinjaTrader Programming 10 August 2nd, 2014 10:09 PM
InvestorRT axis label coloring Big Mike Investor/RT 3 August 18th, 2011 07:53 AM
NT MA with BG coloring emini_Holy_Grail NinjaTrader 10 January 11th, 2011 07:29 AM
On finding the optimal settings for a range interval trendisyourfriend The Elite Circle 5 December 7th, 2010 02:53 PM


All times are GMT -4. The time now is 11:48 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-15 in 0.14 seconds with 20 queries on phoenix via your IP 54.163.210.170