This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:

We work extremely hard to keep things positive on our forums.

We do not tolerate rude behavior, trolling, or vendor advertising in posts.

We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.

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, and we will never resell your private information.

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.

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.

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.

The following 2 users say Thank You to Fat Tails for this post:

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.

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.

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 ?

The following 2 users say Thank You to Fat Tails for this post:

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.

The following user says Thank You to Big Mike for this post: