how can i calculate the slope of a curve with powerlanguage?
Code: Select all
value1=average(close,10);
Thanks yoy
Code: Select all
value1=average(close,10);
If you can "define" slope... you can code it.Hi, i ask a question...
how can i calculate the slope of a curve with powerlanguage?i must calculate slope in value1 and plot it...Code: Select all
value1=average(close,10);
Thanks yoy
I asked you the definition of slope because different people have different interpretation of a slope.The slope expressed in Degrees
Ex:
value1=3;
Plot1(3);
degree is 0(zero);
value1=close;
Plot1(close);
degrees vary depending on the slope of the curve
When the curve is flat ... i will be near zero degrees
I need to know when the curve is flat
see pics below..
Code: Select all
inputs:
MALength(20),
multiplier(5000) ;
variables:
MA(0),
MA1(0),
Angle(0);
MA = XAverage( C, MALength );
MA1 = XAverage( C[1], MALength );
Angle = (MA - MA1)/MA1*multiplier ;
MA1 = MA[1]Use my code.. It's a simple way of approaching this, but it does exactly what you want.
in your function you fixed the value of the volatility at 20..MA1 = MA[1]Use my code.. It's a simple way of approaching this, but it does exactly what you want.
Why do you need to recalculate?
Just keeping things clear for those who are less experienced...MA1 = MA[1]Use my code.. It's a simple way of approaching this, but it does exactly what you want.
Why do you need to recalculate MA1?