MA slope without a Chart or Plot - NinjaTrader Programming | futures io social day trading
futures io futures trading


MA slope without a Chart or Plot
Updated: Views / Replies:1,092 / 11
Created: by vantojo Attachments:0

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
 
Thread Tools Search this Thread
 

MA slope without a Chart or Plot

  #1 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

MA slope without a Chart or Plot

Hi Guys,

Is there any code around for calculating the slope of an MA that would be designed to only run in Market Analyzer?

I don't want to do a Plot override if possible (for future conversion to NT 8, I imagine this is going to be messy) and also want to keep the code very simple.

So, it would be better, if possible that it didn't need chart code at all.

Also, a lot of the slope code I've seen tries to be a Swiss Army Knife with tons of options and tons of types of MA.

I am going to have background processes that use this data, but I don't need to see it.

I will be using EMA or SMA, nothing more.

Thanks in advance

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
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary



vantojo View Post
Hi Guys,

Is there any code around for calculating the slope of an MA that would be designed to only run in Market Analyzer?

I don't want to do a Plot override if possible (for future conversion to NT 8, I imagine this is going to be messy) and also want to keep the code very simple.

So, it would be better, if possible that it didn't need chart code at all.

Also, a lot of the slope code I've seen tries to be a Swiss Army Knife with tons of options and tons of types of MA.

I am going to have background processes that use this data, but I don't need to see it.

I will be using EMA or SMA, nothing more.

Thanks in advance


You don't want to use the slope. You can simply use the rise-over-run and normalize it by dividing through the average true range.

As an option you can further smooth the moving average with a 2-period SMA. This helps to avoid whipsaws.

You can then directly write that value to a plot. You do not need to override any plot.

The plot can be directly accessed via the market analyzer.

The indicator can be coded in a few minutes.

Reply With Quote
 
  #4 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

not sure

Hi Fat Tails,

What I'm looking for is the "instantaneous slope" or "line tangent".....

I'm not a math guy...not sure if what you suggest gives this?

Reply With Quote
 
  #5 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

matlab

I found this Matlab code... (it is not C#)

I guess I'll have to learn a new language...there are lots of algos published in matlab

==========================================================

File Exchange - MATLAB Central


also interesting

File Exchange - MATLAB Central

============================================================

don't know yet if I'm "barking up the wrong tree"

Reply With Quote
 
  #6 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


vantojo View Post
Hi Fat Tails,

What I'm looking for is the "instantaneous slope" or "line tangent".....

I'm not a math guy...not sure if what you suggest gives this?


Charting programs are scalable. The absolute value of the slope as no meaning. You need to move away from geometrical concepts.

The simple slope value or line tangent can be calculated as the rise over run with the run being 1.

It is simply the change of the indicator value.

As I have tried to explain, you should normalize this result by dividing through the average true range.

If you do not normalize, you will have a different scale for each instrument, each bar type and each time frame.


Rescaling the slope

To understand normalization, please have a look at the RSI and the MACD.

The RSI is a normalized indicator. Whatever instrument you selecrt, whatever chart you apply it to, whatever bar period you select, the overbought line is always located at 70. If you add a MACD to your chart, the values you will read depend on instrument, bar type and bar period and have no meaning. What would be your conclusion, if the MACD value 0.278, what iwould be your conclusion if the market analyzer display a MACD of 5.16?

Slope as well only makes sense, if you read it against a normalized scale. Temperature also requires a scale to measure it. Without a scale any information bcomes is useless. Therefore you need to rescale the slope by normalizing it. After normalizing you can compare different values obtained for the slope.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #7 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received


Fat Tails View Post
Charting programs are scalable. The absolute value of the slope as no meaning. You need to move away from geometrical concepts.

The simple slope value or line tangent can be calculated as the rise over run with the run being 1.

It is simply the change of the indicator value.

As I have tried to explain, you should normalize this result by dividing through the average true range.

If you do not normalize, you will have a different scale for each instrument, each bar type and each time frame.


Rescaling the slope

To understand normalization, please have a look at the RSI and the MACD.

The RSI is a normalized indicator. Whatever instrument you selecrt, whatever chart you apply it to, whatever bar period you select, the overbought line is always located at 70. If you add a MACD to your chart, the values you will read depend on instrument, bar type and bar period and have no meaning. What would be your conclusion, if the MACD value 0.278, what iwould be your conclusion if the market analyzer display a MACD of 5.16?

Slope as well only makes sense, if you read it against a normalized scale. Temperature also requires a scale to measure it. Without a scale any information bcomes is useless. Therefore you need to rescale the slope by normalizing it. After normalizing you can compare different values obtained for the slope.


To clarify...

I only use range bars on all instruments... 4 Range and 10 Range... never anything else....

I never use time based bars...second, minute, hour, day... none of those

I believe I understand what you say would make a difference on time based bars....but am not sure it would be the same on a Range bars...because there is no time basis at all on the X axis, and each bar has the same length.

I will have to spend some time with your suggestion so I can visualize it and see if it produces the results I need. At this moment I don't know, without testing it.

Can you comment on the Range bar issue and Slope?

Thank you.

Reply With Quote
 
  #8 (permalink)
Elite Member
Neuquen, Argentina
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: CL, TF, 6S, NG, sometimes GC
 
Posts: 195 since Jul 2012
Thanks: 25 given, 39 received

terms

I'm outside my area of expertise...but it seems to me that a "simple slope (rise / run)" is not the same as "line tangent"

"Simple slope" is geometry, and "line tangent" is calculus?

I believe they use the terminology "line tangent" because it is the slope of the tangent line at an exact point on the curve, not the simple slope between two points on the curve.

From what I understand "line tangent" is the slope at any moment in time on the curve...on a dynamic curve (MA/SMA) the "line tangent" changes as the curve in each moment on the curve....so it is "slope of that instant" (instantaneous slope) and not a simple slope from the beginning of the curve to the end of the curve or rise/run.

Please correct me if I'm wrong.

Reply With Quote
 
  #9 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


vantojo View Post
I'm outside my area of expertise...but it seems to me that a "simple slope (rise / run)" is not the same as "line tangent"

"Simple slope" is geometry, and "line tangent" is calculus?

I believe they use the terminology "line tangent" because it is the slope of the tangent line at an exact point on the curve, not the simple slope between two points on the curve.

From what I understand "line tangent" is the slope at any moment in time on the curve...on a dynamic curve (MA/SMA) the "line tangent" changes as the curve in each moment on the curve....so it is "slope of that instant" (instantaneous slope) and not a simple slope from the beginning of the curve to the end of the curve or rise/run.

Please correct me if I'm wrong.


Marthematically, the concept of the line tangent can only be applied to a continuous function. However, any price time graph is not continuous but discrete. Therefore, it is impossible to calculate a line tangent.

With discrete values, the concept of the tangent is replaced with the slope, where

slope = price difference / time interval = rise / run = rise over run


The slope that comes closes to the tangent, is the slope calculated from the smallest available time interval, which is made up from two adjacent bars.

This is exactly, what I have suggested to use. However, in a second step you should divide that slope by the average true range

normalized slope = rise over run / average true range

which is what you may display on your market analyzer.


Am I repeating myself ?

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #10 (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,357 given, 83,238 received



Fat Tails View Post
Am I repeating myself ?

Anyone can convince themselves how useful something is, if they try hard enough

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:

Reply



futures io > > > > > MA slope without a Chart or Plot

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
How to plot intrabar last price entry on chart? begemepe MultiCharts 0 February 27th, 2015 03:05 PM
Remove plot from chart haonkered EasyLanguage Programming 7 December 15th, 2014 04:45 PM
nt7. plot a 5min5 sma on a 1min chart bobarian NinjaTrader 9 January 18th, 2014 10:39 AM
plot yesterdays value on todays chart O66NL NinjaTrader 1 May 16th, 2013 05:25 PM
Sierra Chart plot bid, ask, last Big Mike Sierra Chart 4 August 18th, 2012 01:48 AM


All times are GMT -4. The time now is 04:08 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-18 in 0.16 seconds with 19 queries on phoenix via your IP 54.221.136.62