Slope of an indicator, frustrating =/ - NinjaTrader Programming | futures io social day trading
futures io futures trading


Slope of an indicator, frustrating =/
Updated: Views / Replies:10,830 / 45
Created: by gonzofist Attachments:7

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 7  
 
Thread Tools Search this Thread
 

Slope of an indicator, frustrating =/

  #11 (permalink)
Elite Member
kansas city
 
Futures Experience: Advanced
Platform: ninjatrader
Broker/Data: IQFeed, Ninja, Own C# with API to Trade King and IB
Favorite Futures: stocks
 
otterway's Avatar
 
Posts: 39 since Jul 2011
Thanks: 22 given, 20 received

Lets take an easy example of obtain slope...

this thread is probably dead but maybe someone needs the answer still. First, why should you be interested in slope... Well, it's an immediate response to change and allows for a visual view if using lines, boxes, rectangles... etc to see what's happening. It is easier to view a program and your logic visually...


I am using int names as example to help reason the code

int starting_bar = 4... Bars back
int ending_bar = 0... Now
int smaperiod = 4

double Degree =Math.Round(System.Math.Atan(Slope(SMA(smaperiod),startingbar, endingbar))*180/Math.PI, 2);

if(degree < -45)
....going down
if (degree < -70)
.... going down fast
if (degree > 45)
.... going up
if (degree > 70)
.....going up fast

Let's say you are using pivot points... and you want to tell the last time the price was in the current range... is there a chance of a reversal....

so you will need to store the CurrentBar for the last time it was in the area... I use List<int> for that. Each time the tick is in the area you can just add it to a list.

Then when the last price is in the area... you can draw a line from the last bar in the pivot area to the new price in the current pivot area.. This will visually help you to look at what's going on... And you can check the degree for higher lower... Remember... pivot points change over time... I am enclosing an example of a modified murrymath that I show a reflection of change. I use angles from the old murraymath and the new...

Attached Thumbnails
Slope of an indicator, frustrating =/-murrey.jpg  
Reply With Quote
 
  #12 (permalink)
Elite Member
desert CA
 
Futures Experience: Intermediate
Platform: NT7, TOS
Broker/Data: AMP/wCQG, TDA
Favorite Futures: CL,YM
 
Posts: 2,027 since Jul 2011
Thanks: 2,211 given, 1,551 received


otterway View Post

double Degree =Math.Round(System.Math.Atan(Slope(SMA(smaperiod),startingbar, endingbar))*180/Math.PI, 2);

So in this equation , the "Slope" function returns the ratio y/x of the triangle formed by the SMA of the startingbar to endingbar. Then that result is put into the System.Math.Atan (inverse tan) function which returns the angle in radians. Then that result is multiplied by the 180/pi conversion factor to change from radians to degrees. Is that correct? Does that "Slope" function come with NT7? Thanks.

Perry's continuation method has the indicator MASlopeMulti which shows the angles; but it's all in .dll ..
Nice pic. Makes it look like trading in 3D


Last edited by Cloudy; March 14th, 2012 at 01:43 AM.
Reply With Quote
 
  #13 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,223 received


You can't properly measure slope on a dynamic scale chart. The slope changes based on the data on the screen.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #14 (permalink)
Elite Member
kansas city
 
Futures Experience: Advanced
Platform: ninjatrader
Broker/Data: IQFeed, Ninja, Own C# with API to Trade King and IB
Favorite Futures: stocks
 
otterway's Avatar
 
Posts: 39 since Jul 2011
Thanks: 22 given, 20 received

Oh Bid Dog... Don't say we disagree again?

Really.....?

The points change yes... but they stay in scale!

My data is reporting the same as I Cntrl Up/Down....


Last edited by otterway; March 14th, 2012 at 10:05 AM. Reason: to add
Reply With Quote
The following 2 users say Thank You to otterway for this post:
 
  #15 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received


Big Mike View Post
You can't properly measure slope on a dynamic scale chart. The slope changes based on the data on the screen.

Mike

I will try to find it and maybe copy it into a WIKI as @Fat Tails has a good perspective on this calculation. I think the moral of his story is to "normalize" the slope rather than make it visually correct. That way a 1 min and a 5 min chart for the same rise in time will be about equal.

Rise/Run ~= (Price change)/(Delta time over change)

He recently put this together for me and I feel bad I can't put my finger on it right now.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote
The following user says Thank You to NJAMC for this post:
 
  #16 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received

Ah ha!

Found it:
https://futures.io/ninjatrader-programming/17859-coloring-indicatorline-slope-questions-optimal-coding.html#post197648

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote
The following 2 users say Thank You to NJAMC for this post:
 
  #17 (permalink)
Elite Member
kansas city
 
Futures Experience: Advanced
Platform: ninjatrader
Broker/Data: IQFeed, Ninja, Own C# with API to Trade King and IB
Favorite Futures: stocks
 
otterway's Avatar
 
Posts: 39 since Jul 2011
Thanks: 22 given, 20 received

Slope in the same series vs comparing apples to oranges

I didn't think I was suggesting that you can take the slope in a 3 minute chart and compare a slope that was in a 10 range chart... Yes they are different and it would be hopeless to look at the two... If I gave that impression... I am sorry... But slopes and visual lines are very helpful in looking at how to code or how your code is behaving...

Reply With Quote
The following user says Thank You to otterway for this post:
 
  #18 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,223 received


otterway View Post
I didn't think I was suggesting that you can take the slope in a 3 minute chart and compare a slope that was in a 10 range chart... Yes they are different and it would be hopeless to look at the two... If I gave that impression... I am sorry... But slopes and visual lines are very helpful in looking at how to code or how your code is behaving...

But a chart with a High-Low range of 10 points, and a chart with a High-Low range of 20 points, will have a different scale and different slope angle, even though it is identical instrument, time frame, etc.

I will let @Fat Tails answer, he has covered this many times and does a much better job at it than me.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #19 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received


otterway View Post
I didn't think I was suggesting that you can take the slope in a 3 minute chart and compare a slope that was in a 10 range chart... Yes they are different and it would be hopeless to look at the two... If I gave that impression... I am sorry... But slopes and visual lines are very helpful in looking at how to code or how your code is behaving...

That is I think the point @Fat Tails makes. How I digest his suggestion is that "Slope" be calculated as if it is plotted on the same Full Chart rather than zoomed in. I think there is a visual aspect of a zoomed in section of a chart (looks like 45degrees to me) but as you zoom out (by changing just the X or just the Y) the angle will change. Certainly if you maintain the aspect ratio it isn't a big deal.

First and foremost, we probably should disclose "Angle/Slope" calculations within our indicators so the user knows if they can apply that "angle" to other charts they are looking at or if it is almost simply a "Local Reference".

Not sure this makes sense as I am still struggling a bit myself, but this is how I have internalized the problem/concern. (Prior to Fat Tails discussion, I didn't think much of it but you look at Perry's system where he looks at the angle of multiple time-frames. This is where I think it is critical, single timeframe and instrument, not so much)

I have created a WIKI to help document this issue as it is complex: https://futures.io/wiki/trading-wiki/Concept-of-Slope-Angle-in-indicators

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization

Last edited by NJAMC; March 14th, 2012 at 01:18 PM. Reason: Added Wiki reference
Reply With Quote
 
  #20 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,652 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary

Slope is just a proxy for momentum


Slope is a geometrical concept that was useful, when people had their daily charts printed out with ever the same time scale on the x-axis and the same price scale on the y-axis. The geometrical concept of slope was simply used to describe momentum. A steep slope meant high momentum, a horizontal line meant no momentum.

With charting software that distorts the x-axis, at least for non time based-charts in equidistant mode and that autoscales the y-axis, the geometrical concept of slope makes no sense. It does no more represent momentum, but is just an optical illusion.

If you want to measure momentum, you can create an indicator that calculates the slope, as if the x-axis was teim-based and non-compressible and as if the y-Axis would use a fixed scale. This exercise will yield you an artificial angle, which can be used as a proxy for momentum, but is different from the angle which you will see on your chart. To calculate the artificial angle you need to compare the directional price move to intrabar volatility, by dividing the n-bar momentum by n times the average true range or standard deviation. You can then use the result to get your much-loved angles.

I do not use angles. In my opionion it is simply nonsense to use angles on charts with a non-linear, compressible time axis and/or an autoscaling y-axis. Better use momentum or the rate of change.

Reply With Quote
The following 8 users say Thank You to Fat Tails for this post:

Reply



futures io > > > > > Slope of an indicator, frustrating =/

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
dmplus v3a is there a slope indicator? bobarian NinjaTrader 4 January 11th, 2013 12:09 PM
STOPS are Frustrating (SL) ...to take or not to take hatorihanzo Psychology and Money Management 113 March 10th, 2012 08:21 AM
Use of Rising() and Slope() MXASJ NinjaTrader Programming 17 August 13th, 2011 12:31 PM
Using slope of an indicator in an auto-strategy nanobiotech NinjaTrader Programming 4 August 6th, 2010 12:31 PM
Calculating the slope of _ADXVMA_Alertsv01_5_1 nanobiotech NinjaTrader Programming 3 April 6th, 2010 01:35 PM


All times are GMT -4. The time now is 06:53 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-13 in 0.16 seconds with 20 queries on phoenix via your IP 54.90.92.204