Looking for DTOSC indicator

metaller

New member
VIP
Hi !
Does anybody know where to find thinkScript version if DTOSC indicator (Dynamic Trader OSCillator) from Robert C. Miner book "High probability trading strategies" ?
 

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

Here is my version of DTOSC for ThinkOrSwim :
Code:
declare lower;

input paramSet = 2;
input MAType = AverageType.EXPONENTIAL;

# parameter sets
def a = if paramSet == 1 then 8
   else if paramSet == 2 then 13
   else if paramSet == 3 then 21
                         else 34;

def b = if paramSet == 1 then 5
   else if paramSet == 2 then 8
   else if paramSet == 3 then 13
                         else 21;

def c = if paramSet == 1 then 3
   else if paramSet == 2 then 5
   else if paramSet == 3 then 8
                         else 13;

def d = if paramSet == 1 then 3
   else if paramSet == 2 then 5
   else if paramSet == 3 then 8
                         else 13;

# debug
# AddLabel(visible = Yes, text = "a=" + a + " b=" + b + " c=" + c + " d=" + d, color = Color.WHITE);

# logic
def storsi = 100 * ((rsi(a) - lowest(rsi(a), b))) / (highest(rsi(a), b) - lowest(rsi(a), b));

# main plots
plot dtosck = MovingAverage(MAType, storsi, c);
dtosck.SetDefaultColor(color.red);
dtosck.setLineWeight(1);

plot dtoscd = MovingAverage(MAType, dtosck, d);
dtoscd.SetDefaultColor(color.cyan);
dtoscd.setLineWeight(1);

# indicator lines cross - reversal
def bullish = dtosck crosses above dtoscd;
def bearish = dtosck crosses below dtoscd;

plot bullishArrow = if bullish then dtoscd else double.NaN;
bullishArrow.SetDefaultColor(color.white);
bullishArrow.SetLineWeight(5);
bullishArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

plot bearishArrow = if bearish then dtoscd else double.NaN;
bearishArrow.SetDefaultColor(color.white);
bearishArrow.SetLineWeight(5);
bearishArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

# static plots
plot overbought = 75;
overbought.SetDefaultColor(color.light_gray);
overbought.setLineWeight(1);
overbought.hideBubble();
overbought.hideTitle();

plot oversold = 25;
oversold.SetDefaultColor(color.light_gray);
oversold.setLineWeight(1);
oversold.hideBubble();
oversold.hideTitle();

# alerts
alert(bullish, "Bullish cross", alert.bar, sound.ring);
alert(bearish, "Bearish cross", alert.bar, sound.ring);
 
This is stochastic oscillator where input is RSI. This indicator was mentioned in "High probability trading strategies" book by Robert C. Miner. You can buy this book or download from Academia.edu for free.

Great! Im reading the book. "A trade execution may be made following a smaller time
frame momentum reversal in the direction of the larger time frame momentum
trend."

Very good indicator you got it. I appreciated too much.
 
Could you explain your idea in more details ?
The goal of this study, is to follow a smaller time frame momentum in the direction of the large timeframe momentum. If so, I imagine an indicator showing this situation between two timeframes. For example, a bullish arrow and bearish arrow appear in the study. The indicator that I was thinking is one where if in certain timeframes, the same arrow appears; it would be a buy signal. If and only if, it is above or below the white lines (oversold and overbought).
 
The goal of this study, is to follow a smaller time frame momentum in the direction of the large timeframe momentum. If so, I imagine an indicator showing this situation between two timeframes. For example, a bullish arrow and bearish arrow appear in the study. The indicator that I was thinking is one where if in certain timeframes, the same arrow appears; it would be a buy signal. If and only if, it is above or below the white lines (oversold and overbought).
I see.
You have core functionality in script above. Feel free to update it according to your plan.
 
Hi,

I revised the code above for the DTOSC to allow input of the four parameters rather than only having a few set choices.

Enjoy!

Code:
declare lower;

input paramSet = 2;
input MAType = AverageType.EXPONENTIAL;
input RSIperiod = 8;
input StochPeriod = 5;
input StochSlowing = 3;
input StochSignal = 3;



# debug
# AddLabel(visible = Yes, text = "a=" + a + " b=" + b + " c=" + c + " d=" + d, color = Color.WHITE);

# logic
def storsi = 100 * ((rsi(RSIPeriod) - lowest(rsi(RSIPeriod), StochPeriod))) / (highest(rsi(RSIPeriod), StochPeriod) - lowest(rsi(RSIPeriod), StochPeriod));

# main plots
plot dtosck = MovingAverage(MAType, storsi, StochSlowing);
dtosck.SetDefaultColor(color.red);
dtosck.setLineWeight(1);

plot dtoscd = MovingAverage(MAType, dtosck, StochSignal);
dtoscd.SetDefaultColor(color.cyan);
dtoscd.setLineWeight(1);

# indicator lines cross - reversal
def bullish = dtosck crosses above dtoscd;
def bearish = dtosck crosses below dtoscd;

plot bullishArrow = if bullish then dtoscd else double.NaN;
bullishArrow.SetDefaultColor(color.white);
bullishArrow.SetLineWeight(5);
bullishArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

plot bearishArrow = if bearish then dtoscd else double.NaN;
bearishArrow.SetDefaultColor(color.white);
bearishArrow.SetLineWeight(5);
bearishArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

# static plots
plot overbought = 75;
overbought.SetDefaultColor(color.light_gray);
overbought.setLineWeight(1);
overbought.hideBubble();
overbought.hideTitle();

plot oversold = 25;
oversold.SetDefaultColor(color.light_gray);
oversold.setLineWeight(1);
oversold.hideBubble();
oversold.hideTitle();

# alerts
alert(bullish, "Bullish cross", alert.bar, sound.ring);
alert(bearish, "Bearish cross", alert.bar, sound.ring);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
459 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