LinRegSlope in Degrees - NinjaTrader Programming | futures io social day trading
futures io futures trading

LinRegSlope in Degrees
Updated: Views / Replies:1,749 / 5
Created: by MXASJ Attachments:2

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

Thread Tools Search this Thread

LinRegSlope in Degrees

  #1 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received

LinRegSlope in Degrees

I'm looking for a way to have the Ninja Indicator LinRegSlope expressed in degrees so I can run some tests across a basket of instruments. Before I get too carried away has anyone already done this or seen this?

Default LinRegSlope code is:

protectedoverridevoid OnBarUpdate()
double sumX = (double) Period * (Period - 1) * 0.5;
double divisor = sumX * sumX - (double) Period * Period * (Period - 1) * (2 * Period - 1) / 6;
double sumXY = 0;
for (int count = 0; count < Period && CurrentBar - count >= 0; count++)
sumXY += count * Input[count];

Value.Set(((double) Period * sumXY - sumX * SUM(Inputs[0], Period)[0]) / divisor);
And the output is related to the tick size therefore you can not directly compare ES and 6E, for example.

Reply With Quote
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

  #3 (permalink)
Elite Member
Calcutta, India
Futures Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks: 161 given, 260 received

see this NinjaTrader Support Forum - View Single Post - Slope function output

Reply With Quote
The following user says Thank You to bukkan for this post:
  #4 (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,336 since Jun 2009
Thanks: 29,450 given, 83,940 received (formerly BMT) CollectiveMA also has slope code built in, easy to modify for your purpose.


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.
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:
  #5 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received

Thanks! And talk about a fast response!

Testing to see if this is correct:

Value.Set(System.Math.Atan((((double) Period * sumXY - sumX * SUM(Inputs[0], Period)[0]) / divisor)/TickSize)*180/Math.PI);

Reply With Quote
  #6 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received

Actually if anyone can check that code it would be great. My weekend hypothesis testing is the "Euro trends more than the ES" thing that came up in another thread. One way I thought to test that was to look at the distributions of LinRegSlope for the two instruments, but that will only work if it is true apples-to-apples math.

Preliminary histograms attached. 20 days of 1 min data.

Attached Thumbnails
LinRegSlope in Degrees-6e_hist.jpeg   LinRegSlope in Degrees-es_hist.jpeg  
Reply With Quote


futures io > > > > > LinRegSlope in Degrees

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

All times are GMT -4. The time now is 12:09 PM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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 2018-05-24 in 0.10 seconds with 19 queries on phoenix via your IP