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

  #21 (permalink)
 
stephenszpak's Avatar
 stephenszpak 
Massachusetts (USA)
 
Experience: None
Platform: NinjaTrader
Trading: YM
Posts: 750 since Jun 2009
Thanks Given: 144
Thanks Received: 356


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

Don't understand. I was thinking about RangeNoGap candles, which have the same range.

Attachment shows much the same thing again.

The steepness of the moving average is
significant at the left for a bullish candle but at the right it is almost horizontal. That area at the right
might be a good cutoff point. The SMA of 2 should have that slope or less to be a neutral
candle. I opened the databox window but it only gives the value of the SMA of 2, which doesn't
help.

I am checking out the futures.io (formerly BMT) indicators now for one that might be helpful in this.

- Stephen

Attached Thumbnails
Click image for larger version

Name:	new image.png
Views:	280
Size:	79.9 KB
ID:	70145  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
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?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #22 (permalink)
 
stephenszpak's Avatar
 stephenszpak 
Massachusetts (USA)
 
Experience: None
Platform: NinjaTrader
Trading: YM
Posts: 750 since Jun 2009
Thanks Given: 144
Thanks Received: 356

Trying this indicator out now to make some sort of progress hopefully. Didn't see any
indicator that is close to providing exactly what we've talked about.



MASlopeMTF

First version of MASlopeMTF, it display MA slope (only) of different time frames, it doesn't display the MA line itself.
Colored background colored by slope.
User defined text for slope box.
Currently it displays only real-time slope, no history at this version.
Exported using NT Version 7.0.1000.7


The indicator says 63 degrees, at lower right corner. Does this seem in the ballpark FalTails?
See next post for attachment.

Reply With Quote
  #23 (permalink)
 
stephenszpak's Avatar
 stephenszpak 
Massachusetts (USA)
 
Experience: None
Platform: NinjaTrader
Trading: YM
Posts: 750 since Jun 2009
Thanks Given: 144
Thanks Received: 356


Image in attachment.

Sorry to keep posting to myself. I checked out an area that
had the moving average going flat. The angle was 61 degrees. I assumed
the indicator would look at and use the moving average I had chosen, ( SMA2 ), however
the MASlopeMTF indicator used its own parameters here. Have to check this out to see
if MASlopeMTF can be helpful or not.

Attached Thumbnails
Click image for larger version

Name:	save newest image.png
Views:	273
Size:	122.2 KB
ID:	70147  
Reply With Quote
  #24 (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

I have tried to explain about a hundred times that it is impossible to use angles on scalable charts. If this is too difficult to understand I cannot help. Angles were a concept used a long time ago as a proxy for momentum. That was when charts were printed on paper and neither time scale nor price scale were ever changed.

Using angles on a software like NinjaTrader is simply nonsense.

To decide whether a moving average has made a significant change you would need to compare it to the average bar size (average range) or the average bar size + gaps if applicable (average true range). If the change in the moving average exceeds a specific multiple of the average range or average true range, the momentum represented by that moving average can be deemed as significant.

You just need to define the threshold.

Reply With Quote
Thanked by:
  #25 (permalink)
 
stephenszpak's Avatar
 stephenszpak 
Massachusetts (USA)
 
Experience: None
Platform: NinjaTrader
Trading: YM
Posts: 750 since Jun 2009
Thanks Given: 144
Thanks Received: 356


Fat Tails View Post
I have tried to explain about a hundred times that it is impossible to use angles on scalable charts. If this is too difficult to understand I cannot help. Angles were a concept used a long time ago as a proxy for momentum. That was when charts were printed on paper and neither time scale nor price scale were ever changed.

Using angles on a software like NinjaTrader is simply nonsense.

To decide whether a moving average has made a significant change you would need to compare it to the average bar size (average range) or the average bar size + gaps if applicable (average true range). If the change in the moving average exceeds a specific multiple of the average range or average true range, the momentum represented by that moving average can be deemed as significant.

You just need to define the threshold.

Sorry about that.

Reply With Quote
  #26 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,395


stephenszpak View Post
Sorry about that.

I have collected some of @Fat Tails statements about Angles in a Wiki:
Concept of Slope/Angle in indicators - Big Mike's Trading Forum

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote
  #27 (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


stephenszpak View Post
Sorry about that.

@stephenszpak: Sorry myself, did not want to attack you.

I would measure the difference between the SMA of the current bar and the SMA of the prior bar and compare that to the average true range. That ratio would tell me, whether the momentum indicated by the SMA is significant or not.

Reply With Quote
Thanked by:
  #28 (permalink)
 
stephenszpak's Avatar
 stephenszpak 
Massachusetts (USA)
 
Experience: None
Platform: NinjaTrader
Trading: YM
Posts: 750 since Jun 2009
Thanks Given: 144
Thanks Received: 356


Fat Tails View Post
@stephenszpak: Sorry myself, did not want to attack you.

I would measure the difference between the SMA of the current bar and the SMA of the prior bar and compare that to the average true range. That ratio would tell me, whether the momentum indicated by the SMA is significant or not.

I understand what you're saying now about the slope I believe. Should have picked up on that sooner.

I can eye ball that measurement or do it with a cross hair. I guess no indicator does it as yet automatically.

Thanks

Reply With Quote
  #29 (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


stephenszpak View Post
I understand what you're saying now about the slope I believe. Should have picked up on that sooner.

I can eye ball that measurement or do it with a cross hair. I guess no indicator does it as yet automatically.

Thanks

The BollingerUniversalX indicator as per post #6 of this thread has a neutral area for the slope based on the average true range, you just would need to adapt the code to your indicator.

Reply With Quote
  #30 (permalink)
 
stephenszpak's Avatar
 stephenszpak 
Massachusetts (USA)
 
Experience: None
Platform: NinjaTrader
Trading: YM
Posts: 750 since Jun 2009
Thanks Given: 144
Thanks Received: 356



Fat Tails View Post
The BollingerUniversalX indicator as per post #6 of this thread has a neutral area for the slope based on the average true range, you just would need to adapt the code to your indicator.

Just got some time so I played around with it.

First off, it does work pretty well. The idea at the moment would be to color code the
candles or HiLo bars or whatever by where the closing price is.

If within the bands then, neutral.
If above upper band then, bullish.
If below the lower band then, bearish.

The problem that keeps coming up is with the dojis. Sometimes the indicator
will place the doji, that has the same close, within the bands. Then the coloring would be neutral, which it
should be. Other times the doji, that has the same close, is outside of the bands. The coloring would then
go bullish or bearish which it should not.

In the 6E using 3 RangeNoGap charts these dojis are always coming up.
If the bands are widened to include all the dojis, then candles that should go bullish or bearish
have closes within the bands and would be colored neutral.

Is there a way to make all dojis with the same close neutral, regardless of what
the computations of BollingerUniversalX come up with, within some code? I believe you
said once that NT can't do stuff like that.


The anaThrustBars are fine for now if not.

- Stephen

Attached Thumbnails
Click image for larger version

Name:	Graph 1.png
Views:	339
Size:	98.0 KB
ID:	70797  
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