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 suroot, 04-10-2017, 02:18 AM
|
4 responses
3,021 views
0 likes
|
Last Post
by truepenny
Today, 08:01 AM
|
||
Started by Stanfillirenfro, Today, 07:23 AM
|
1 response
6 views
0 likes
|
Last Post Today, 07:37 AM | ||
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
2 responses
22 views
0 likes
|
Last Post Today, 07:24 AM | ||
Started by olisav57, Yesterday, 07:39 PM
|
1 response
9 views
0 likes
|
Last Post Today, 07:23 AM | ||
Started by cocoescala, 10-12-2018, 11:02 PM
|
7 responses
944 views
0 likes
|
Last Post
by Jquiroz1975
Today, 07:21 AM
|
Comment