how would you code a trend line or tl_new statement to draw a line from a moving average crossing?? then maybe end on subsequent prices of moving averages, or high pivot or current high...
basically i'm having trouble capturing a MA cross for a trend line statement
here is a snippet of code that i've learned for pivots... how would i modify it for MA trend lines??
Code: Select all
condition1 = Pivot(L,25,leftstrength,rightstrength,1,-1,oPivotPrice1,oPivotBar1) <>-1;
{confirms most recent bottom pivot}
condition2 = Pivot(L,25,leftstrength,rightstrength,2,-1,oPivotPrice2,oPivotBar2) <>-1;
{confirms next most recent bottom pivot}
TL_new(D[oPivotBar2], T[oPivotBar2], L[oPivotBar2],
D[oPivotBar1], T[oPivotBar1], L[oPivotBar1]);