mod note:
Moving averages help identify and confirm trends, reducing the likelihood of trading against the dominant trend.
Traders use two moving averages—one short-term x length and one longer 2x length
—to spot changes in the trend. When the short-term line (which reacts faster to price moves) crosses above the longer-term line, it is used to confirm the uptrend. When it crosses below, confirmed downtrend.
This is a simple visualization of 2 moving averages - nothing too special. It is a slight improvement on code found here. The poster claims it was originally written by Robert Payne.
Moving averages lag behind price action, so the signals may not always be the most timely on lower timeframes:
https://usethinkscript.com/threads/lagging-indicator-accuracy-in-thinkorswim.15624/
Moving averages help identify and confirm trends, reducing the likelihood of trading against the dominant trend.
Traders use two moving averages—one short-term x length and one longer 2x length
—to spot changes in the trend. When the short-term line (which reacts faster to price moves) crosses above the longer-term line, it is used to confirm the uptrend. When it crosses below, confirmed downtrend.
This is a simple visualization of 2 moving averages - nothing too special. It is a slight improvement on code found here. The poster claims it was originally written by Robert Payne.
Code:
input price = close;
input averageType1 = { default Simple, Exponential, Weighted, Wilders, Hull };
input averageType2 = { default Simple, Exponential, Weighted, Wilders, Hull };
input length1 = 10;
input length2 = 20;
def ma1 = MovingAverage(averageType = averageType1, price, length1);
def ma2 = MovingAverage(averageType = averageType2, price, length2);
DefineGlobalColor("Bull", Color.GREEN);
DefineGlobalColor("Bear", Color.RED);
AddCloud(ma1, ma2, GlobalColor("Bull"), GlobalColor("Bear"));
Moving averages lag behind price action, so the signals may not always be the most timely on lower timeframes:
https://usethinkscript.com/threads/lagging-indicator-accuracy-in-thinkorswim.15624/
Last edited by a moderator: