NexusFi: Find Your Edge


Home Menu

 





Coloring an IndicatorLine by Slope: Questions for Optimal Coding


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 24 posts (87 thanks)
    2. looks_two stephenszpak with 12 posts (0 thanks)
    3. looks_3 Big Mike with 3 posts (4 thanks)
    4. looks_4 Trendseek with 3 posts (15 thanks)
      Best Posters
    1. looks_one Trendseek with 5 thanks per post
    2. looks_two Fat Tails with 3.6 thanks per post
    3. looks_3 NJAMC with 1.5 thanks per post
    4. looks_4 Big Mike with 1.3 thanks per post
    1. trending_up 29,018 views
    2. thumb_up 111 thanks given
    3. group 22 followers
    1. forum 59 posts
    2. attach_file 19 attachments




 
Search this Thread

Coloring an IndicatorLine by Slope: Questions for Optimal Coding

  #41 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


Fat Tails View Post
Have now updated the Bollinger Universal and Keltner Universal indicators.

The indicators can be found here:



Notifications sent.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
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
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #42 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Fat Tails View Post
Have now updated the Bollinger Universal and Keltner Universal indicators.

You can select the midband from moving median, moving mode and 27 moving averages. Period for the midband and the smoothing period for the range or true range can be different. Both indicators allows to color the plots according to their slope or alternatively according to the slope of the midband. The range where the slope is considered neutral can be adjusted. It is possible not to display midband or channels.





The last version of the indicators had not called the Butterworth, Gauss and Supersmoother filters in a proper way.
All other moving averages were not affected.

Therefore I had to update the indicators again. The indicators can be found here:




Sorry for any inconvenience.

Reply With Quote
Thanked by:
  #43 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603



Fat Tails View Post
The last version of the indicators had not called the Butterworth, Gauss and Supersmoother filters in a proper way.
All other moving averages were not affected.

Therefore I had to update the indicators again. The indicators can be found here:




Sorry for any inconvenience.

Notifications sent.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #44 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

Have updated the two indicators today.

Have added paint bars to the Bollinger Universal indicator. Both indicators now use updated indicators for the Ehlers and Gauss filters. The mode is removed and no longer available. The indicator can now be displaced and will correctly align the plot colors and paint bars to the displacement.



Reply With Quote
Thanked by:
  #45 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

Notifications sent.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #46 (permalink)
 dynoweb 
McKinney, TX
 
Experience: Intermediate
Platform: ThinkOrSwim, NinjaTrader
Broker: TD Ameritrade (soon to be Schwab) & NinjaTrader
Trading: The indexes, ES, YM, NQ & RTY
Posts: 171 since Aug 2012
Thanks Given: 216
Thanks Received: 157

@Fat Tails, I may not have grasped all of your post several post ago, but if I could simplify what I read in terms for people like myself, if I used change of price over change of time, it would pass the C-2 test. Then 45 deg doesn't really mean anything because when a person running - velocity (mile/hour) or in trading (price changed/hour) would be the velocity. To know a flat period of time that price would be a low number under some arbitrary threshold. All that to say if I want to look at a chop filter, I could check velocity and if it's under x then its basically flat and not trending above my desired value.

If all that's valid, I could extend that by thinking, change in price/time would give me the acceleration (1st derivative of velocity) and I could use those values to indicate what some might call momentum.

Does that sound like I understand your points?

Follow me on Twitter Reply With Quote
  #47 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


dynoweb View Post
@Fat Tails, I may not have grasped all of your post several post ago, but if I could simplify what I read in terms for people like myself, if I used change of price over change of time, it would pass the C-2 test. Then 45 deg doesn't really mean anything because when a person running - velocity (mile/hour) or in trading (price changed/hour) would be the velocity. To know a flat period of time that price would be a low number under some arbitrary threshold. All that to say if I want to look at a chop filter, I could check velocity and if it's under x then its basically flat and not trending above my desired value.

If all that's valid, I could extend that by thinking, change in price/time would give me the acceleration (1st derivative of velocity) and I could use those values to indicate what some might call momentum.

Does that sound like I understand your points?

When charts were printed, angles were used as a proxy for momentum. A steep angle indicated high momentum, a flat angle low momentum. As the x-axis and y-axis of modern charting applications are scalable, this approximation does not make any sense today.

Momentum is in fact comparable to velocity, as momentum is price change over a time period. We cannot talk of a 1st derivative because the trades are discrete events and the discontinuous price function is not differentiable, but you may consider momentum as somewhat equivalent to the first derivative of price.

Angles could be used as tool to determine whether prices were rising, falling or flat, where "flat" was the equivalent of all smaller angles, for example all angles between -5° and + 5°. To find a similar threshold for momentum, we need to normalize momentum. The only possible input value to normalize momentum is the average bar size. Consider

-> bar size or range = 1-bar volatility (non-directional)
-> momentum(n) = n-bar volatility (directional)

By dividing momentum through the average range or average true range and the number of bars, you get a normalized value of momentum, which tells you whether a price move over n bars was steep or flat relative to intra-bar volatility. One possible formula would be

normalized momentum (n) = momentum(n) / ( n * SMA (true range (n)))

After applying such a normalization, you will also get reasonable results across different instrument and different timeframes. Such a normalized momentum will have a value between -100 and + 100 and you can define an upper and lower threshold such that all values contained between the threshold values can be considered as flat.

Reply With Quote
Thanked by:
  #48 (permalink)
 dynoweb 
McKinney, TX
 
Experience: Intermediate
Platform: ThinkOrSwim, NinjaTrader
Broker: TD Ameritrade (soon to be Schwab) & NinjaTrader
Trading: The indexes, ES, YM, NQ & RTY
Posts: 171 since Aug 2012
Thanks Given: 216
Thanks Received: 157


Fat Tails View Post
When charts were printed, angles were used as a proxy for momentum. A steep angle indicated high momentum, a flat angle low momentum. As the x-axis and y-axis of modern charting applications are scalable, this approximation does not make any sense today.

Momentum is in fact comparable to velocity, as momentum is price change over a time period. We cannot talk of a 1st derivative because the trades are discrete events and the discontinuous price function is not differentiable, but you may consider momentum as somewhat equivalent to the first derivative of price.

Angles could be used as tool to determine whether prices were rising, falling or flat, where "flat" was the equivalent of all smaller angles, for example all angles between -5° and + 5°. To find a similar threshold for momentum, we need to normalize momentum. The only possible input value to normalize momentum is the average bar size. Consider

-> bar size or range = 1-bar volatility (non-directional)
-> momentum(n) = n-bar volatility (directional)

By dividing momentum through the average range or average true range and the number of bars, you get a normalized value of momentum, which tells you whether a price move over n bars was steep or flat relative to intra-bar volatility. One possible formula would be

normalized momentum (n) = momentum(n) / ( n * SMA (true range (n)))

After applying such a normalization, you will also get reasonable results across different instrument and different timeframes. Such a normalized momentum will have a value between -100 and + 100 and you can define an upper and lower threshold such that all values contained between the threshold values can be considered as flat.

Thanks for the well thought out response. After reading it, the question it raised is won't the formula above be recursive since the result is part of the equations input? I did understand the point you were making and agree with what you were saying.

I'm not sure you answered another question that I had about the possibility of using change of price over change of time to determine slope and use that slope as a value to set a threshold. Thinking about it as I type this, it would limit your chart to a time based chart, but used with that limitation it seems like it would still be a valid indication of momentum (slope) . What are your thoughts about this?

Follow me on Twitter Reply With Quote
  #49 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


dynoweb View Post
Thanks for the well thought out response. After reading it, the question it raised is won't the formula above be recursive since the result is part of the equations input?

No, the formula is not recursive.


dynoweb View Post
I'm not sure you answered another question that I had about the possibility of using change of price over change of time to determine slope and use that slope as a value to set a threshold.

Change of price over change of time is the definition of momentum. If you want to compare momentum to a threshold value, you first have to normalize it. Normalization allows you to use the same threshold value for different instruments, chart types and time frames. Without normalization you need a different threshold value for each instrument, each chart type and each time frame. Normalization typically uses volatility as I have explained in my last post.

Reply With Quote
  #50 (permalink)
 
Rad4633's Avatar
 Rad4633 
Greensboro NC
 
Experience: Advanced
Platform: TOS/ NT Dorman
Trading: ES TF CL
Posts: 1,357 since Sep 2011
Thanks Given: 2,657
Thanks Received: 894



Fat Tails View Post
Have updated the two indicators today.

Have added paint bars to the Bollinger Universal indicator. Both indicators now use updated indicators for the Ehlers and Gauss filters. The mode is removed and no longer available. The indicator can now be displaced and will correctly align the plot colors and paint bars to the displacement.



@Fat Tails

Sir, I was wondering do you have a combo indicator with the bollinger and keltner channels together? , Ive seen one months back that colors candles up or down based off bands and squeeze of both bollinger/keltner. Sorry no picture at this time but Im 100% sure you know what Im referring too

thx in advance for your reply
R

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on May 25, 2016


© 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