Searching for elegant way of triggering at MA interesection

kervin

Newbie
Messages
1
Likes
0
Hi ,
Any coders here?? I'm trying to programme a basic EA using MA.
I can't seem to find an elegant way of trigger at an intersection of the 2 moving averages. Is this the only way??

if(ma_fast[1]<ma_slow[1] &&
ma_fast[0]>ma_slow[0] &&
fastGradient > 0 &&
!tradedInBarOP(OP_BUY)
 
Top