Alma, WI
Experience: Advanced
Platform: Sierra Chart, TOS
Trading: NQ, ES, ZB, CL
Posts: 2 since Mar 2019
Thanks Given: 0
Thanks Received: 0
|
(quirk: sometimes I saw the sma1 value in the data box, not the chart for say Weekly until something changed on the chart and it recalc'd) but try:
input sma_len_1 = 10;
input sma_len_2 = 20;
input sma_len_3 = 50;
input sma_len_4 = 200;
def agg = GetAggregationPeriod();
plot sma1 = MovingAverage(AverageType.SIMPLE, close, sma_len_1);
sma1.SetHiding (Agg > AggregationPeriod.DAY or Agg < AggregationPeriod.DAY);
plot sma2 = MovingAverage(AverageType.Simple,Close,sma_len_2);
sma2.SetHiding (Agg < AggregationPeriod.Week);
plot sma3 = MovingAverage(AverageType.SIMPLE, close, sma_len_3);
sma3.SetHiding (Agg < AggregationPeriod.Week);
plot sma4 = MovingAverage(AverageType.SIMPLE, close, sma_len_4);
sma4.SetHiding (Agg < AggregationPeriod.Week);
|