Hi SleepyZ,
I have added a couple of more periods to the script so I can use them as reference but this particular script works only on the 5mns time frame. The chart keeps notifying a message saying that the secondary period cannot be less than the primary, and I need this to also work on different time frames but specifically on the daily time frame. Could you take a look and see what needs to be fixed?
def SMA50_5MN = SimpleMovingAvg (close (period = AggregationPeriod.FIVE_MIN), 50) ;
def SMA50_15MN = SimpleMovingAvg (close (period = AggregationPeriod.FIFTEEN_MIN), 50) ;
def SMA50_30MN = SimpleMovingAvg (close (period = AggregationPeriod.THIRTY_MIN), 50) ;
def SMA50_1HR = SimpleMovingAvg (close (period = AggregationPeriod.HOUR), 50) ;
def SMA50_4HR = SimpleMovingAvg (close (period = AggregationPeriod.FOUR_HOURS), 50) ;
def SMA50_D = SimpleMovingAvg (close (period = AggregationPeriod.DAY), 50) ;
input showlabels = yes;
AddLabel(showlabels, "SMA50_D " + AsDollars(SMA50_D), if close > SMA50_D then Color.GREEN else Color.RED);
AddLabel(showlabels, "SMA50_4HR " + AsDollars(SMA50_4HR), if close > SMA50_4HR then Color.GREEN else Color.RED);
AddLabel(showlabels, "SMA50_1HR " + AsDollars(SMA50_1HR), if close > SMA50_1HR then Color.GREEN else Color.RED);
AddLabel(showlabels, "SMA50_30MN " + AsDollars(SMA50_30MN), if close > SMA50_30MN then Color.GREEN else Color.RED);
AddLabel(showlabels, "SMA50_15MN " + AsDollars(SMA50_15MN), if close > SMA50_15MN then Color.GREEN else Color.RED);
AddLabel(showlabels, "SMA50_5MN " + AsDollars(SMA50_5MN), if close > SMA50_5MN then Color.GREEN else Color.RED);
AddLabel(showlabels, "|", Color.YELLOW);