input ChartBubblesOn = no;
input price = close;
input length = 10;
def tmp1 = if price > price[1] then price - price[1] else 0;
def tmp2 = if price[1] > price then price[1] - price else 0;
def d2 = sum(tmp1, length);
def d4 = sum(tmp2, length);
def cond = d2 + d4 == 0;
def ad3 = if cond then 0 else (d2 - d4) / (d2 + d4) * 100;
def coeff = 2 / (length + 1) * AbsValue(ad3) / 100;
def asd = compoundValue("visible data" = coeff * price + (if IsNaN(asd[1]) then 0 else asd[1]) * (1 - coeff), "historical data" = price
);
plot VMA = asd;
VMA.setDefaultColor(GetColor(0));
def vwma8 = sum(volume * close, 8) / sum(volume, 8);
def vwma13 = sum(volume * close, 13) / sum(volume, 13);
def vwma34 = sum(volume * close, 34) / sum(volume, 34);
def bullish = if vwma8 > vwma13 and vwma13 > vwma34 then 1 else 0;
def bearish = if vwma8 < vwma13 and vwma13 < vwma34 then 1 else 0;
def distribution = if !bullish and !bearish then 1 else 0;
AddLabel(yes, if bullish then "Stage: Acceleration" else if bearish then "Stage: Deceleration" else if close>=VMA then "Stage: Accumulation" else "Stage: Distribution", if bullish then color.orange else if bearish then color.blue else if close >=VMA then color.black else color.light_GRAY);
VMA.AssignValueColor(if bearish and close<= VMA then color.blue
else if bullish and close >= VMA then color.orange
else color.black);
def accumulationToAcceleration = if (bullish and close>=VMA) then 1 else 0;
AddChartBubble(ChartBubblesOn and accumulationToAcceleration and !accumulationToAcceleration[1], close, "Entering Acceleration", color.blue);
def distributionToDeceleration = if (bearish and close <= VMA) then 1 else 0;
AddChartBubble(ChartBubblesOn and distributionToDeceleration and !distributionToDeceleration[1], close, "Entering Deceleration", color.orange);
AddLabel(yes, if bullish then "Stage: Acceleration" else if bearish then "Stage: Deceleration" else if close>=VMA then "Stage: Accumulation" else "Stage: Distribution", if bullish then color.orange else if bearish then color.blue else if close >=VMA then color.black else color.light_GRAY);
input labels = yes;
AddLabel(yes and labels, if bullish then "Stage: Acceleration" else if bearish then "Stage: Deceleration" else if close>=VMA then "Stage: Accumulation" else "Stage: Distribution", if bullish then color.orange else if bearish then color.blue else if close >=VMA then color.black else color.light_GRAY);
# cabe1332 20210115_1700
# I have made some modifications customize to my needs and requirements.
# Credit to team TOSindicators [URL]https://tosindicators.com/indicators[/URL]
# Market Pulse, a powerful tool that lets you identify which one of the four market stages ( accumulation, distribution, acceleration) we are currently in.
# It uses Moving Average along with Volume Weighted Moving Averages to try and identify which one of the four market stages.
# I've added Stage Label, indicator bubbles on a plotline that indicates buying increase/decrease (V+/V- bubble) with the price on which candle.
# start of code
input price = close;
input length = 9;
def tmp1 = if price > price[1] then price - price[1] else 0;
def tmp2 = if price[1] > price then price[1] - price else 0;
def d2 = sum(tmp1, length);
def d4 = sum(tmp2, length);
def cond = d2 + d4 == 0;
def ad3 = if cond then 0 else (d2 - d4) / (d2 + d4) * 100;
def coeff = 2 / (length + 1) * AbsValue(ad3) / 100;
def asd = compoundValue("visible data" = coeff * price + (if IsNaN(asd[1]) then 0 else asd[1]) * (1 - coeff), "historical data" = price);
plot VMA = asd;
VMA.setDefaultColor(GetColor(0));
def vma8 = sum(volume * close,8) / sum(volume,8);
def vma21 = sum(volume * close,21) / sum(volume,21);
def vma34 = sum(volume * close,34) / sum(volume,34);
def bullish = if vma8 > vma21 and vma21 > vma34 then 1 else 0;
def bearish = if vma8 < vma21 and vma21 < vma34 then 1 else 0;
def distribution = if !bullish and !bearish then 1 else 0;
AddLabel(yes, if bullish then "Stage: Accelerating " else if bearish then "Stage: Decelerating " else if close >= VMA then "Stage: Accumulation " else "Stage: Distribution ", if bullish then color.green else if bearish then color.red else if close >= VMA then color.yellow else color.orange);
VMA.assignValueColor(if bearish and close<= VMA then color.red else if bullish and close >= VMA then color.green else color.gray);
def accumulationtoaccelation = if (bullish and close>=VMA) then 1 else 0;
def distributiontoacceleration = if (bearish and close <= VMA) then 1 else 0;
AddChartBubble(accumulationtoaccelation and !accumulationtoaccelation[1] and close <= close[1], close, "V+ " + round(close,2), color.light_green);
AddChartBubble(distributiontoacceleration and !distributiontoacceleration[1] and close <= close[1], close, "V- " + round(close,2), color.light_orange);
def accelationtoaccumulation = if (bullish and close<=VMA) then 1 else 0;
AddChartBubble(accelationtoaccumulation and !accelationtoaccumulation[1], close, "Accum", color.light_gray);
def distributiontoaccumulationton = if (bearish and close>=VMA) then 1 else 0;
AddChartBubble(distributiontoaccumulationton and !distributiontoaccumulationton[1], close, "Dist", color.light_gray);
# end of code
is this base on vma= 10 (days)? if not what line do I change on the script? thks.Customized Market Pulse For ThinkOrSwim
Code:# cabe1332 20210115_1700 # I have made some modifications customize to my needs and requirements. # Credit to team TOSindicators [URL]https://tosindicators.com/indicators[/URL] # Market Pulse, a powerful tool that lets you identify which one of the four market stages ( accumulation, distribution, acceleration) we are currently in. # It uses Moving Average along with Volume Weighted Moving Averages to try and identify which one of the four market stages. # I've added Stage Label, indicator bubbles on a plotline that indicates buying increase/decrease (V+/V- bubble) with the price on which candle. # start of code input price = close; input length = 9; def tmp1 = if price > price[1] then price - price[1] else 0; def tmp2 = if price[1] > price then price[1] - price else 0; def d2 = sum(tmp1, length); def d4 = sum(tmp2, length); def cond = d2 + d4 == 0; def ad3 = if cond then 0 else (d2 - d4) / (d2 + d4) * 100; def coeff = 2 / (length + 1) * AbsValue(ad3) / 100; def asd = compoundValue("visible data" = coeff * price + (if IsNaN(asd[1]) then 0 else asd[1]) * (1 - coeff), "historical data" = price); plot VMA = asd; VMA.setDefaultColor(GetColor(0)); def vma8 = sum(volume * close,8) / sum(volume,8); def vma21 = sum(volume * close,21) / sum(volume,21); def vma34 = sum(volume * close,34) / sum(volume,34); def bullish = if vma8 > vma21 and vma21 > vma34 then 1 else 0; def bearish = if vma8 < vma21 and vma21 < vma34 then 1 else 0; def distribution = if !bullish and !bearish then 1 else 0; AddLabel(yes, if bullish then "Stage: Accelerating " else if bearish then "Stage: Decelerating " else if close >= VMA then "Stage: Accumulation " else "Stage: Distribution ", if bullish then color.green else if bearish then color.red else if close >= VMA then color.yellow else color.orange); VMA.assignValueColor(if bearish and close<= VMA then color.red else if bullish and close >= VMA then color.green else color.gray); def accumulationtoaccelation = if (bullish and close>=VMA) then 1 else 0; def distributiontoacceleration = if (bearish and close <= VMA) then 1 else 0; AddChartBubble(accumulationtoaccelation and !accumulationtoaccelation[1] and close <= close[1], close, "V+ " + round(close,2), color.light_green); AddChartBubble(distributiontoacceleration and !distributiontoacceleration[1] and close <= close[1], close, "V- " + round(close,2), color.light_orange); def accelationtoaccumulation = if (bullish and close<=VMA) then 1 else 0; AddChartBubble(accelationtoaccumulation and !accelationtoaccumulation[1], close, "Accum", color.light_gray); def distributiontoaccumulationton = if (bearish and close>=VMA) then 1 else 0; AddChartBubble(distributiontoaccumulationton and !distributiontoaccumulationton[1], close, "Dist", color.light_gray); # end of code
change length to 10 on a daily chart.is this base on vma= 10 (days)? if not what line do I change on the script? thks.
Forex lacks a centralized marketplace therefore therefore volume data cannot be collected.Is there a way to make some of these indicators work with forex, I find many great indicators I use for equities don't work on forex?? Is there something I should be looking up to change in some of these scripts??
The Top Indicators are the same across instruments:@MerryDay thank you for the information, I'm fairly new to forex, I really like it, love the price action and scalping, its been pretty simple using a 5 lot and just simple going for 15 pips on swing and lows!! I don't know if your a forex trader but any heads up on indicators would be greatly appreciated!!
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
C | MA Slope Scan For ThinkOrSwim | Indicators | 38 | |
J | CCI Watchlist / Scan / Label / Strategy for ThinkorSwim | Indicators | 49 | |
B | Scan for Stocks Above/Below Pre-Market in ThinkorSwim | Indicators | 6 | |
Volume Percent Breakout Indicator (with scan) for ThinkorSwim | Indicators | 7 | ||
Early Morning Movers Scan for ThinkorSwim | Indicators | 2 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.