Moving Average angle calculation

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
1252
onewithzachy 2012.04.18 03:04 #
 

Hate math :(

Did some angle calc back then - lots of them :(, for harmonic patterns, hopes this helps http://www.teacherschoice.com.au/Maths_Library/Trigonometry/solve_trig_ASS.htm

when you change the timeframe, your angle calc may no longer valid :(

why your angle variable is an integer, isn't it supposed to be a double ?

this comment is my 222

 
avatar
1752
DxdCn 2012.05.08 11:35 #
 

angle only a viasual effect, the realty is the change of price and time.

you can draw a 45o angel with screen scale no care the change of price and time.

 
avatar
146
erzo 2012.05.08 12:02 #
 
DxdCn:

angle only a viasual effect, the realty is the change of price and time.

But you can simulate a fixed size window inside the indicator, like: High[ArrayMaximum(High, WindowSizeInBars, i)]
Here is my attempt I have done a month ago:
Attached files:
  angleofma.mq4  (3.65 KB)
 
avatar
128
Dadas 2016.01.08 12:13 #
 
RaptorUK:
LOL . . . if you want to leave logic aside then any garbage answer is as good as any other as they will all be logically wrong . . .

Thanks to you all, Guys!

I have been enlightened!

Since we can't calculate MA angle, c/z it's relative, thus there is only one thing not relative on the charts, and that is PRICE CHANGE! 

avatar
1
francis2015 2016.01.08 15:22 #
 
VladiRozen:

hey everybody!

i would like to calc the angle of Moving Average 10.

i tried this:

double MAShift1 = iMA(NULL, 0, MA, 0, MODE_SMA, PRICE_CLOSE, 3);

double MAShift3 = iMA(NULL, 0, MA, 0, MODE_SMA, PRICE_CLOSE, 7);

double test = (SignalPeriod-0.0)/WindowBarsPerChart();

int angle = MathArctan(MathTan(((MAShift1-MAShift3)/(WindowPriceMax()- WindowPriceMin()))/((test-0.0)/WindowBarsPerChart())))*180/3.14;


it seem to be calculating wrong angles, i get answers without any sense,

i want to check whats the angle between 3 and 7 shifts back.

thanks.

moving average is good

but I did not trust only on moving average again, you have to  learn more better in order to attain a lot in the forex trade profit atmosphere

Back to topics list   | 1 2  

To add comments, please log in or register