Bull bear absolute strength indicator For ThinkOrSwim
Tip:
Use the Donchian channel indicator I posted here (post #11):
https://usethinkscript.com/threads/donchian-channel-mods-for-thinkorswim.11159/#post-97589
Donchian channels are basically trend following system.
Avoid entry when the bull bear indicator width is narrow (indicating consolidation.) Another strategy is to enter a trade as the bull or bear line touches the signal line .
Appreciate it if can let me know how does it work for you.
Tip:
Use the Donchian channel indicator I posted here (post #11):
https://usethinkscript.com/threads/donchian-channel-mods-for-thinkorswim.11159/#post-97589
Donchian channels are basically trend following system.
Avoid entry when the bull bear indicator width is narrow (indicating consolidation.) Another strategy is to enter a trade as the bull or bear line touches the signal line .
Appreciate it if can let me know how does it work for you.
Ruby:
#BullBearStrength_v1
# @mpardesi 5/4/2022
declare lower;
input length = 26;
input over_bought = 60;
input signal_line = 50;
input over_sold = 10;
input averageType = AverageType.EXPONENTIAL;
Assert(length > 1 , "'length' must be greater than one: " + length);
def HH = if high > high[1] then (high - Lowest(high, length)) / (Highest(high, length) - Lowest(high, length)) else 0;
def LL = if low < low[1] then (Highest(low, length) - low) / (Highest(low, length) - Lowest(low, length)) else 0;
plot BullS = 100 * MovingAverage(averageType, HH, length);
plot BearS = 100 * MovingAverage(averageType, LL, length);
plot OverBought = over_bought;
plot SignalLine = signal_line;
plot OverSold = over_sold;
BullS.SetDefaultColor(color.green);
BearS.SetDefaultColor(color.red);
OverBought.SetDefaultColor(GetColor(7));
SignalLine.SetDefaultColor(GetColor(7));
OverSold.SetDefaultColor(GetColor(7));
def WAD = AccumDistBuyPr();
DefineGlobalColor("BuyersMarket", Color.GREEN);
DefineGlobalColor("SellersMarket", Color.RED);
DefineGlobalColor("NeutralMarket", Color.YELLOW);
AddLabel(yes, if WAD > 0 then "Buyers/Bullish Market" else if WAD < 0 then "Sellers/Bearish Market" else
"Neutral Market" , if WAD > 0 then GlobalColor("BuyersMarket") else if WAD < 0 then GlobalColor
("SellersMarket") else GlobalColor("NeutralMarket") );
DefineGlobalColor("TrendUp", Color.LIGHT_GREEN);
DefineGlobalColor("TrendDown", CreateColor(139,34,82));
DefineGlobalColor("SuperTrendUp", color.Blue);
DefineGlobalColor("SuperTrendDown", color.Magenta);
AddCloud(BullS, BearS,GlobalColor("TrendUp"),GlobalColor("TrendDown"));
AddCloud(if WAD > 0 and BullS > BearS and BullS[1] > BearS[1] then BullS else double.NaN, BearS ,GlobalColor("SuperTrendUp"),GlobalColor("TrendDown"));
AddCloud(if WAD < 0 and BullS < BearS and BullS[1] < BearS[1] then BearS else double.NaN, BullS,GlobalColor("SuperTrendDown"),GlobalColor("TrendDown"));
Last edited by a moderator: