NexusFi: Find Your Edge


Home Menu

 





MACD Angle


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one c12345 with 1 posts (0 thanks)
    2. looks_two Fat Tails with 1 posts (2 thanks)
    3. looks_3 Big Mike with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,892 views
    2. thumb_up 3 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
c12345
PA
 
Posts: 81 since Sep 2009
Thanks Given: 4
Thanks Received: 47

I am looking to determine the math and logic to program a indicator to calculate the Angle of the MACD fast line. Such as to get a value returned as 60% or 30%, etc. etc.

Any ideas or suggestions on how to do this? Some ideas were linear regression, and I've seen some other ideas posted other forums, but nothing really that does this, that I can find....

If anyone has any ideas, on how to do this, I would like to discuss them with you.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
Iran Fired a Missile at Israel Last Night. The $8M June …
Prediction Markets & Event Contracts
Thanks Mike. Godspeed.
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,117


The big problem with angles is that they depend on both the horizontal and vertical scale of the chart. As both price and indicator panels of the charts use Autoscale for the y-axis, you will get different angles for the same price action depending on the volatility 50 bars ago. I never understood, how anybody could use angles. This is non-sense, unless you swear to never compress or expand neither the x-scale nor the y-scale and never change instruments.

A better concept than angles would be momentum. The chart below shows a momentum with periods 3 (green) and 6 (red) applied to the MACD. Applying an indicator to an indicator is only possible with NT7.



c12345 View Post
I am looking to determine the math and logic to program a indicator to calculate the Angle of the MACD fast line. Such as to get a value returned as 60% or 30%, etc. etc.

Any ideas or suggestions on how to do this? Some ideas were linear regression, and I've seen some other ideas posted other forums, but nothing really that does this, that I can find....

If anyone has any ideas, on how to do this, I would like to discuss them with you.


Attached Thumbnails
Click image for larger version

Name:	Slope of MACD.jpg
Views:	426
Size:	111.6 KB
ID:	15114  
Reply With Quote
Thanked by:
  #4 (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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577

Here is some code I used before to do this. I just tore it from a indicator, I do not use Ninja anymore for charting so you'll need to make appropriate changes as the code is not plug-n-play. I removed some of the fancier part of the code because it is from an Elite indicator and this is a non-Elite section.

It shows the angle of the line in degrees.

 
Code
                            
if (ShowSlope)

            {
                
double radToDegrees 180/Math.PI;
                
                
double _slope0        = (int)(radToDegrees*(Math.Atan((collective[0]-(collective[1]+collective[2])/2)/1.5/TickSize)));
                
                
Slope.Set(_slope0);
                
                
DrawOnPricePanel    false;
                
DrawTextFixed("Slope""CMA Slope:\n0 = " _slope0.ToString("0") + "°\n1 = " _slope1.ToString("0") + "°\n2 = " _slope2.ToString("0") + "°"TextPosition.BottomRightslopecolor, new Font("Tahoma"8), Color.Empty, Color.Empty, 10);
            } 
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 X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on June 8, 2010


© 2026 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 - Downloads - Top
no new posts