Hi! I can not seem to figure out how to edit MACD TwoLines code to use a different aggregation on a given chart. For example, I am needing the MACD TwoLines 30minute aggregation, but viewed on a 5minute chart. I thought simply adding "input agg = AggregationPeriod.thirty_MIN;" would do the trick, but I, of course, was wrong. It displays exactly the same as the MACD TwoLines on the 5minute chart. Any help would be greatly appreciated.
# # TD Ameritrade IP Company, Inc. (c) 2007-2020 # declare lower; input fastLength = 8; input slowLength = 21; input MACDLength = 5; input averageType = AverageType.EXPONENTIAL; input agg = AggregationPeriod.thirty_MIN; plot Value = MACD(fastLength, slowLength, MACDLength, averageType).Value; plot Avg = MACD(fastLength, slowLength, MACDLength, averageType).Avg; plot ZeroLine = 0; Value.SetDefaultColor(GetColor(1)); Avg.SetDefaultColor(GetColor(8)); ZeroLine.SetDefaultColor(GetColor(0));
Last edited by a moderator: