How to get the angle of a moving average? - page 3

 
divide 0 error ?
use Print(....)to debug all parameter
 

DxdCn, I'm curious about your equation and I'm surprised that no one has mentioned it before.

MathArctan(MathTan(x/y)) is the same thing as : x/y

MathArctan() is the inverse of MathTan(), in other words, whatever MathTan() does, MathArctan() un-does.

Just a thought...

 
ForexFred:

DxdCn, I'm curious about your equation and I'm surprised that no one has mentioned it before.

MathArctan(MathTan(x/y)) is the same thing as : x/y

MathArctan() is the inverse of MathTan(), in other words, whatever MathTan() does, MathArctan() un-does.

Just a thought...

I'm curious also about your curious .

As I know, Most pople want to know how to get proper X and Y, I think all know MathArctan() is the inverse of MathTan().

Since Angle need use screen coodinates, so how to get properly X and Y is most important !

 
WindowPriceMax() and WindowPriceMin() return 0 in EA. WindowBarsPerChart() return -5 in EA, who have the other good method to get the angle in EA??
 

"Since Angle need use screen coodinates, so how to get properly X and Y is most important !"

In my opinion, chasing pixels to find angles is a waste of time. The TrendlineByAngle tool will always give an accurate
angle on the screen, but it is useless (exception is when the chart is square, that is, the option for Scale Fix 1:1 is selected)

Draw a TrendlineByAngle on a chart. Now zoom in, zoom out, change timeframe, adjust the vertical scale. The line remains
constant, it is completely unrelated to what goes on with the charted prices.

The angles of interest should be based on Price ( in pips ) and Time (as in bar counts, ie, units of time).

 
phy:

"Since Angle need use screen coodinates, so how to get properly X and Y is most important !"

In my opinion, chasing pixels to find angles is a waste of time. The TrendlineByAngle tool will always give an accurate
angle on the screen, but it is useless (exception is when the chart is square, that is, the option for Scale Fix 1:1 is selected)

Draw a TrendlineByAngle on a chart. Now zoom in, zoom out, change timeframe, adjust the vertical scale. The line remains
constant, it is completely unrelated to what goes on with the charted prices.

The angles of interest should be based on Price ( in pips ) and Time (as in bar counts, ie, units of time).


That is another problem, why use angle.

In my opinion, Angle now is used for visualization for people, not for math of EA.

TrendlineByAngle is an object , which need a angle, not give an angle!

"The angles of interest should be based on Price ( in pips ) and Time (as in bar counts, ie, units of time)."

No, based on Price ( in pips ) and Time (as in bar counts, ie, units of time) is slope or delt on 1 unit-of-time !! not for visualization .

So only Angle using screen coodinates give people right feeling !

 

Okay, from what I've read and personally experienced with great frustration, attempting to find the angle of a moving average on an MT4 screen is useless since the screen does not remain consistent and will produce different angles at different places for a single moving average angle. So, how can the moving average angle be determined without reliance upon the screen? For instance, given the information of using a 30-day period moving average, how does one use that information to go about figuring the lowest moving average angle pertaining to prices located above the moving average?

 

Good grief, this old one again :(

> attempting to find the angle of a moving average on an MT4 screen is useless

and unnecessary...

Because you know the angle already - as phy says...

You know the start and finish price and the time difference & hence could work out the arbitrary angle from a tangent calculation

But there's no need, you know the pips/bar being moved do you can project that into the future if you wish

-BB-

 
ASAR:

So, how can the moving average angle be determined without reliance upon the screen?

You cannot determine it because an angle does not exist in the price chart. Calculate and use the slope instead.


Example: The word population is rising.

  • wrong: the world population is rising at an angle of 42 degrees. <-- WTF?
  • right: the world population is rising at a rate of 220000 humans per day

Example: The silver price is rising.

  • wrong: the silver price is rising at an angle of 23 degrees <-- WTF???
  • right: the silver price is rising at a rate of 3 dollar per month
 

My thanks for the valuable understanding provided by both replies.

Reason: