Paul Allen
New member
Evening, All. I love this code:
But if I want to see for example 5,9,21,50,100,200 I have to clog up my study set with 6 sepearate codes for each respective daily average. Is there any way we can code all of them into one study so when I go into settings, I can just pick the period and corresponding color for the line it generates vs. using individual studies for each MA? I hope this request makes sense... my currenty study set has over 25 studies and it is bogging down TOS. Please pardon my ignorance and thank you in advance for your kind consideration.
Code:
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);
But if I want to see for example 5,9,21,50,100,200 I have to clog up my study set with 6 sepearate codes for each respective daily average. Is there any way we can code all of them into one study so when I go into settings, I can just pick the period and corresponding color for the line it generates vs. using individual studies for each MA? I hope this request makes sense... my currenty study set has over 25 studies and it is bogging down TOS. Please pardon my ignorance and thank you in advance for your kind consideration.