Dyno Trading Volume indicator For ThinkOrSwim

Investingtogive

Member
VIP
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
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

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
Interesting indicator! Thank you for sharing this:)

I really like the color coding of bars but i already have another study that also paints bars so i was wondering if it´s possible to modify this study so that it instead painting bars, only show labels on upper chart using the green, red & yellow colors and the labels can say "buy", "sell" and "neutral"

Appreciate if you can help me with this modification.
 
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
Looks very interesting. I have been watching DynoTreading for a while now and can't tell if it's a bunch of crap but always wanted to test it out. Please keep us apprised of how this works on live charts. :). thanks for the effort and sharing.
 
@Investingtogive thank you!

Can you help me with a simple indicator that has some similar aspects to yours above. I'm trying to make bands/lines in which each point on the line is the terminating mean, +1,-1 of Standard Dev Channel, from previous prints.

Does that make sense? Maybe this will be easy for you?
Thanks!
 
@Investingtogive another question on this great indicator. Is there a way to make a watchlist code that tells if theres a red/green ribbon, and if so what that thickness of the ribbon/trend is?

Thanks!!!
 
HI all, I am in the middle of a kitchen remodel while also working so I won't have much time in the next two weeks to look into your requests. I just didn't want you to think that I was ignoring you. I'll l et you know when I get a chance to look into them.
Thanks,
 
@Investingtogive Great job! You have the right idea but Dyno Trading "Volume" indicator is not based on Linear Regression but two EMA or rather an EMA of an EMA if that makes sense.
 
@ Tradegeek Thanks for the info. Much appreciated. That does makes sense. Do you know what the two EMAs are (1st EMA and the 2nd EMA of the 1 EMA ) ? I would love to code this.
 
Yes I know exactly what the two EMAs are. They’re both 20 EMA. So instead of the EMA of the Linear Regression, it’s an 20 Exponential Average of the 20 EMA. I’ve already recreated this on Ninjatrader.
Perfect. I just created it on TOS with Heikin Ashi candles. Thanks. How do you Enter and Exit your trades using this ?
 
this is pretty straight forward.. stop/exit if candles turn yellow. will try this tomorrow. thanks.
 
Good morning all, with help from members in the group I have been able to replicate the Dyno Trading indicator into TOS script. Mine is not Volume based but uses two EMAs. I have compared these charts to his they they look identical. What I am providing here is a work in progress and not completed yet. I also added color dots to the 200 EMA Cloud that work off of the 34 EMA, 68EMA and 116 SMA lines. These help gage the overall Trend of the market. Combine these with the EMA Clouds for trades. I hope to add better Entry and Exit graphics into the code as well as scanners. Please review, test and provide feedback / suggestions.
I use (3) indicators here in my Strategy (Study):
1. EMA Clouds
2. Price Line (This gives me the real time price because I set my charts to Heikin Ashi - which doesn't display the actual real time price))
3. VWAP


1. EMA Clouds:

# Begin of EMA Clouds

input price = close;
input EMA_1 = 20;
input EMA_2 = 20;
input showBreakoutSignals = no;

def EMA34 = ExpAverage(price, 34);
def EMA68 = ExpAverage(price, 68);
def SMA116 = Average(price, 116);
def Body = (open + close) / 2;

plot AvgExp_1 = ExpAverage(price, EMA_1);
plot AvgExp_2 = ExpAverage(AvgExp_1, EMA_2);

DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Bearish", Color.RED);
AddCloud(AvgExp_1, AvgExp_2, GlobalColor("Bullish"), GlobalColor("Bearish"));

def Up = EMA34 > EMA68 and EMA68 > SMA116;
def Down = EMA34 < EMA68 and EMA68 < SMA116;
plot UpSignal = Up and Up[1] == 0;
plot DownSignal = Down and Down[1] == 0;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);


# Combining the EMA 200 Cloud and the 34EMA, 68EMA and 116 EMA Trend
def EMA_200_High = MovAvgExponential(high, 200)."AvgExp";
def EMA_200_Low = MovAvgExponential(low, 200)."AvgExp";
def Bull = EMA_200_High > EMA_200_High[1] and EMA_200_Low > EMA_200_Low[1];
def Bear = EMA_200_High < EMA_200_High[1] and EMA_200_Low < EMA_200_Low[1];

DefineGlobalColor("Bull", Color.GRAY);
DefineGlobalColor("Bear", Color.GRAY);
AddCloud(EMA_200_High, EMA_200_Low, GlobalColor("Bull"), GlobalColor("Bear"), yes);


# Trend Dots on 200 EMA
plot EMA200 = ExpAverage(price, 200);
EMA200.SetDefaultColor(GetColor(0));
DefineGlobalColor("Bull Trend Color", Color.RED);
DefineGlobalColor("Bear Trend Color", Color.GREEN);
DefineGlobalColor("Neutral Trend Color", Color.YELLOW);
EMA200.SetLineWeight( 2 );
EMA200.SetPaintingStrategy(PaintingStrategy.POINTS);
# VWAP.AssignValueColor(GlobalColor("Bear Trend Color"));

EMA200.AssignValueColor( if Up then Color.GREEN else if Down then Color.RED else Color.YELLOW);

# End
 
2. Price Line:

#Plots a Horizontal Line that follows the price value selected
input price=close;
input offset=0;
input length = 300;

def sma = SimpleMovingAvg(price, 1, length);
rec line = if IsNaN(sma) then line[1] else sma[offset];
plot priceline=if isnan(sma) then line else double.nan;
priceline.setpaintingStrategy(paintingStrategy.LINE);
priceline.setlineWeight(3);
priceline.setdefaultColor(color.green);
priceline.hideBubble();

# End
 
gOXhCk5.png
 
What I have been doing is only Entering when the Trend dots are Green (Buy) or Red (Sell) and a Pullback into the EMA Cloud with the same Color.

1. Buy:
Entry: Green Trend Dots and Green Cloud and a Pullback into that Green Cloud
Exit : Heikin Ashi bars close below the EMA Cloud or a Cloud Crossover.
1. Sell:
Entry: Red Trend Dots and Red Cloud and a Pullback into that Red Cloud
Exit : Heikin Ashi bars close above the EMA Cloud or a Cloud Crossover.

Hope this helps. Please provide feedback because my code is not totally clean up but a work in progress.

Thanks,
 
What I have been doing is only Entering when the Trend dots are Green (Buy) or Red (Sell) and a Pullback into the EMA Cloud with the same Color.

1. Buy:
Entry: Green Trend Dots and Green Cloud and a Pullback into that Green Cloud
Exit : Heikin Ashi bars close below the EMA Cloud or a Cloud Crossover.
1. Sell:
Entry: Red Trend Dots and Red Cloud and a Pullback into that Red Cloud
Exit : Heikin Ashi bars close above the EMA Cloud or a Cloud Crossover.

Hope this helps. Please provide feedback because my code is not totally clean up but a work in progress.

Thanks,
Using it now on a 2min setup, working nicely. i have these 2 indicators sharing the same space below on the bottom

declare Lower;
input Show81321Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 3;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
THEN WaveState.Bullish
ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
THEN WaveState.Bearish
ELSE WaveState.SW;


def IsBullishWave = WaveState == WaveState.Bullish;
def IsBearishWave = WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;
plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);
plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);
AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

and MACD with Breakouts plottod on same chart as above code

## Archive Name: MACD_withBreakoutSignals_InvTools
## Archive Section: Momentum
## Suggested Tos Name: MACD_withBreakoutSignals_InvTools
## Archive Date: 5.13.2018
## Archive Notes:

## "##" indicates an addition by the Archivist

#Number Two MACD with Breakout Signals [email protected]
declare lower;

input fastLength = 8;
input slowLength = 17;
input MACDLength = 9;
input AverageType = {SMA, default EMA};

plot Diff = MACD(fastLength, slowLength, MACDLength, AverageType).Diff;

Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.Color("Positive and Up") else Diff.Color("Positive and Down") else if Diff < Diff[1] then Diff.Color("Negative and Down") else Diff.Color("Negative and Up"));

plot zeroline = 0;
zeroline.assignValueColor(getcolor(7));

def crossedb = Crosses(diff, 0, CrossingDirection.BELOW);
plot crossbelow = if crossedb then crossedb-1 else double.NaN;
crossbelow.AssignValueColor(getcolor(5));
crossbelow.SetPaintingStrategy(PaintingStrategy.arrow_DOWN);

def crossedu = Crosses(diff, 0, CrossingDirection.above);
plot crossabove = if crossedu then crossedu-1 else double.NaN;
crossabove.AssignValueColor(getcolor(1));
crossabove.SetPaintingStrategy(PaintingStrategy.arrow_up);
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
352 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top