Epic_Trades
New member
Can the dailysma be coded to extend the sma to the left? I use tick charts and with the higher ticks the 200 sma will not display. I have to keep switching to a lower tick to check on the sma location. Thanks!
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2011-2023
#
input price = FundamentalType.CLOSE;
input aggregationPeriod = AggregationPeriod.DAY;
input length = 9;
input displace = 0;
input showOnlyLastPeriod = no;
plot DailySMA;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
DailySMA = Double.NaN;
} else {
DailySMA = Average(fundamental(price, period = aggregationPeriod)[-displace], length);
}
DailySMA.SetDefaultColor(GetColor(1));
DailySMA.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Last edited by a moderator: