Higher time frame exp moving avg on a lower time frame?

D

Dan205

New member
Is this possible on thinkorswim maybe someone has posted the code already on here?

For example... 5min moving avg on a 1min chart... If anyone can help that would be nice ;)
 
H

HighBredCloud

Well-known member
VIP
Is this possible on thinkorswim maybe someone has posted the code already on here?

For example... 5min moving avg on a 1min chart... If anyone can help that would be nice ;)


This is color coded to show the change in direction of the moving average...

Code:
# MTF Moving Average

input Period = AggregationPeriod.FIFTEEN_MIN;
input AvgType = AverageType.HULL;
input Length = 20;
input priceclose = close;

plot AVG = MovingAverage(AvgType, close(period = Period), Length);
AVG.SetDefaultColor(Color.YELLOW);

def sState2 = if AVG > AVG[1] then 100 else -100;
AVG.AssignValueColor(if sState2 == 100 then Color.MAGENTA else Color.CYAN);
AVG.SetLineWeight(2);
 

Similar threads

Top