Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BUG: built-in Slope() method incorrect
Collapse
X
-
-
Originally posted by mgbloomfield View PostThink of ticks (price) as the y-axis and period (time) as the x-axis.
Comment
-
-
Here is what I use for an indicator slope:
MyAngle.Set(Math.Atan(Slope(MACD(12,26,9).Avg, 1,0)) * 180/Math.PI);
which checks angle between current and 1 bar back I haven't tried to apply directly to price.
Would this work?
MyAngle.Set(Math.Atan(Slope(Close), 1,0)) * 180/Math.PI);
Not what I expected.
This:
Print("angle " + (Math.Atan(Slope(Close, 3,0) * 180/Math.PI)));
outputs this:
angle -1.36434100921404
angle -1.46645686609606
angle 0
angle 1.36434100921404
angle 1.36434100921404
angle 1.46645686609606
angle 1.54752946948938
angle 1.55175867160589
angle 1.55334480614343
angle 1.52893289777454
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by nicthe, Today, 07:38 AM
|
3 responses
17 views
0 likes
|
Last Post
by nicthe
Today, 01:36 PM
|
||
Started by samish18, Yesterday, 12:20 PM
|
1 response
12 views
0 likes
|
Last Post Today, 12:54 PM | ||
Started by Lancer, 01-29-2020, 10:15 PM
|
6 responses
460 views
1 like
|
Last Post
by neveral0n3
Today, 12:53 PM
|
||
Started by Rogers101, Today, 11:30 AM
|
1 response
13 views
0 likes
|
Last Post Today, 12:50 PM | ||
Started by AndreiBig, Yesterday, 12:30 AM
|
1 response
11 views
0 likes
|
Last Post Today, 12:47 PM |
Comment