I was able to recreate a close representation of the Dyno Trading Volume indicator (Which I do not believe is based on volume but a Linear Regression crossover). I saw an article from Lizard Indicators (Link provided in the commented section of the code) and basically recreated their version in TOS and it looks fairly close.
Please review and let me know what you think. I also combine this with the VWAP and 200 EMA. The bars are color coded and this does not repaint. Green bars = Buy, Red bars = Sell and Yellow bars = Stay out (Neutral).
# LinearRegCh100 RegressionDivergence - Trigger Lines - Trend Cross
# From Lizard Indicators Link: https://www.lizardindicators.com/trigger-lines-cross-vs-thrust/
# Line #1 - Fast = LinReg (80)
# Line #2 - Slow = EXPEMA[LinReg (80)]
input price = close;
input displace = 0;
input LinRegLength = 80;
input EMAlength = 20;
#Definitions
def LinReg = Inertia(price[-displace], LinRegLength);
def EMA_LR = ExpAverage(LinReg[-displace], EMAlength);
def Body = (open + close)/2;
# Defining Long/Short Filters (these instructions determine entries / exits)
# Entry Requirements
def Long_Entry = close > LinReg and close > EMA_LR and body > LinReg and body > EMA_LR and close > high[1] and body > body[1];
# LinReg > LinReg[1] and
def Long_Stay_In = close > LinReg and close > EMA_LR;
def Long_Exit = (close < LinReg or close < EMA_LR) or Long_Stay_In == 0;
def Long_State = If Long_Entry then 1 else if Long_Exit then 0 else Long_State[1];
plot Long = Long_State;
# Exit Requirements
def Short_Entry = close < LinReg and close < EMA_LR and body < LinReg and body < EMA_LR and close < low[1] and body < body[1];
# LinReg < LinReg[1] and
def Short_Stay_In = close < LinReg and close < EMA_LR;
def Short_Exit = (close > LinReg or close > EMA_LR) or Short_Stay_In == 0;
def Short_State = If Short_Entry then 1 else if Short_Exit then 0 else Short_State[1];
plot Short = Short_State;
#Adding Linear Regression Plots
plot LR = LinReg;
LR.SetDefaultColor(Color.BLUE);
plot EMA_LinReg = EMA_LR;
# Coloring Bars
AssignPriceColor(if Long_State then Color.GREEN else if Short_State then Color.RED else Color.Yellow);
DefineGlobalColor("Bullish", Color.Green);
DefineGlobalColor("Bearish", Color.Red);
AddCloud(EMA_LR, LinReg, GlobalColor("Bearish"), GlobalColor("Bullish"));
# End
Please review and let me know what you think. I also combine this with the VWAP and 200 EMA. The bars are color coded and this does not repaint. Green bars = Buy, Red bars = Sell and Yellow bars = Stay out (Neutral).
# LinearRegCh100 RegressionDivergence - Trigger Lines - Trend Cross
# From Lizard Indicators Link: https://www.lizardindicators.com/trigger-lines-cross-vs-thrust/
# Line #1 - Fast = LinReg (80)
# Line #2 - Slow = EXPEMA[LinReg (80)]
input price = close;
input displace = 0;
input LinRegLength = 80;
input EMAlength = 20;
#Definitions
def LinReg = Inertia(price[-displace], LinRegLength);
def EMA_LR = ExpAverage(LinReg[-displace], EMAlength);
def Body = (open + close)/2;
# Defining Long/Short Filters (these instructions determine entries / exits)
# Entry Requirements
def Long_Entry = close > LinReg and close > EMA_LR and body > LinReg and body > EMA_LR and close > high[1] and body > body[1];
# LinReg > LinReg[1] and
def Long_Stay_In = close > LinReg and close > EMA_LR;
def Long_Exit = (close < LinReg or close < EMA_LR) or Long_Stay_In == 0;
def Long_State = If Long_Entry then 1 else if Long_Exit then 0 else Long_State[1];
plot Long = Long_State;
# Exit Requirements
def Short_Entry = close < LinReg and close < EMA_LR and body < LinReg and body < EMA_LR and close < low[1] and body < body[1];
# LinReg < LinReg[1] and
def Short_Stay_In = close < LinReg and close < EMA_LR;
def Short_Exit = (close > LinReg or close > EMA_LR) or Short_Stay_In == 0;
def Short_State = If Short_Entry then 1 else if Short_Exit then 0 else Short_State[1];
plot Short = Short_State;
#Adding Linear Regression Plots
plot LR = LinReg;
LR.SetDefaultColor(Color.BLUE);
plot EMA_LinReg = EMA_LR;
# Coloring Bars
AssignPriceColor(if Long_State then Color.GREEN else if Short_State then Color.RED else Color.Yellow);
DefineGlobalColor("Bullish", Color.Green);
DefineGlobalColor("Bearish", Color.Red);
AddCloud(EMA_LR, LinReg, GlobalColor("Bearish"), GlobalColor("Bullish"));
# End