Finding slope of 50 Day EMA

 

Hello fellow coders/traders:

I'm trying to think of a good way to determine an uptrend in a moving average. I'm classifying an "uptrend" as a 50DMA at a 25º angle. So I want to be able to say:

Buying =IF MA > 25º (but how do i quantify 25º) && [Other trading criteria]

MA = iMA(NULL,0,13,8,MODE_EMA,PRICE_MEDIAN,0);

I'm really kind of stuck on this one so any help would be much appreciated :)

Thanks,

Pat

 
Don't use angles at all. Your charts scaling is changing permanently, so angles can change as well.
 

Yes,

Instead of angle use pips/bar. E.g 

double MASteepness = iMA(NULL,0,13,0,MODE_EMA,PRICE_MEDIAN,0) - iMA(NULL,0,13,0,MODE_EMA,PRICE_MEDIAN,8);//This is actually RateOfChange...


if(MASteepness < -0.003) 
{
OpenSell(Lots, SL, TP)
}
 
Thanks I'll give it a shot!
 
DayTrader wrote >>

Yes,

Instead of angle use pips/bar. E.g

It would be a little out of my mathematical league to calculate, but what value in difference (

 
It would be a little out of my mathematical league to calculate, but what value in difference (you chose .003)
 
FXpipclash wrote >>

It would be a little out of my mathematical league to calculate, but what value in difference (

FXpipclash
wrote
>>
It would be a little out of my mathematical league to calculate, but what value in difference (you chose .003)


It would be a little out of my mathematical league to calculate, but what value in difference (you chose .003) would equate to a 25 degree angle? Also, why did you choose a shift of 8?

Thanks again!

Pat

Reason: