[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Start / Stop plotting indicators



PureBytes Links

Trading Reference Links

Goldbug!  How you doing man?  Good to hear from you again!

Either use the attached ELA or be sure to format your plots for this code as "Point" style.



Input:

TickSize(.1),
XTics(3),
MA1Len(10),
MA2Len(10);


Var:

MA1(0),
MA2(0),
Mode(1);


MA1 = Average(L, MA1Len);
MA2 = Average(H, MA2Len);


If Mode = 1 and C < MA1 - XTics * TickSize then Mode = -1;
If Mode = -1 and C > MA2 + XTics * TickSize then Mode = 1;

If Mode = 1 then Plot1(MA1, "MA1");
If Mode = -1 then Plot2(MA2, "MA2");





 ---- you wrote: 
> Hello
> 
> Got stuck trying to program the following, can anyone help?
> 
> Two Mov Averages are involved and only one should be plotted based on market 
> action.
> 
> In an upward move plot MovAvg_1 and once market closes X tics below it to 
> stop plotting MovAvg_1 and 
> to start plotting MovAvg_2 until the market closes X tics above it. 
> 
> Both MovAvgs would be using the same number of X tics. (for example 5). 
> Mov Avgs are functions already written in EL.
> 
> A visual alert (arrow in the direction of the trade) would be great to be 
> displayed.
> 
> Thanks for the consideration and have a great weekend.
> 
> LG
> 
>