Rate of Change Indicator for Stochastic SlowK

68sooner

New member
VIP
I am trying to include an indicator of ROC on the SlowK, when it turns positive. I would like to experiment with different limits. I am lining up the SlowK turning positive and the MACD Histogram beginning to increase. Here is what I have so far...
Code:
declare lower;
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageTypeMACD = AverageType.EXPONENTIAL;
input showBreakoutSignalsMACD = no;
def Diff = MACD(fastLength, slowLength, MACDLength, averageTypeMACD).Diff;
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input averageTypeStoch = AverageType.SIMPLE;
input showBreakoutSignalsStoch = {default "No", "On SlowK", "On SlowD", "On SlowK & SlowD"};
def SlowK = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,averageTypeStoch).FullK;
def SlowD = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,averageTypeStoch).FullD;
Plot DataProfile = (SlowK[1] < SlowK) and (lowest(slowK[1],3) <30) and(Diff[1] < Diff);

I would like to narrow my results to a sharply turning SlowK. Any thoughts? Thanks,
 
Last edited by a moderator:
Hi Mark,

Welcome to useThinkscript. @BenTen is building a world wide website here and were glad your here. We need a bit more information to help you. Could you tell us why you have a focus on the ROC of the Slow K turn? I guess that I'm just wonering how using and indicator of an indicator will help because there could be a bit of lag with that @horserider , any thoughts?
 
Last edited by a moderator:
@markos Well as you have said avoid the same type indicators as they give the same information. Seems to be what is being worked on here. The MACD and stochastic show the same information. Should not be hard to align them but for what purpose. Not sure this will go anywhere.
 
Hi Mark,

Welcome to useThinkscript. @BenTen is building a world wide website here and were glad your here. We need a bit more information to help you. Could you tell us why you have a focus on the ROC of the Slow K turn? I guess that I'm just wonering how using and indicator of an indicator will help because there could be a bit of lag with that @horserider , any thoughts?
Hey markos, thanks for the reply. So, to be clear, this is more of a ThinkScript learning exercise for me. I have only just started looking into it this week and I have been trying some simple conditional code. I am a data junkie and am spending a lot of time trying different adjustments in scans and studies. Hoping in the near future to get to the point of being a contributing member. ; )

I was looking to study how the stochastic SlowK reversal angle (ROC may have been the wrong terminology) related to the percentage increase in price. Other variables include value prior to the reversal and the MACD Histogram peaking negatively. Haven't figured out how to post an image just yet, but you probably get the idea. Sometimes the SlowK comes in a sharp V shaped reversal and sometimes it is a lazy L. Not quite sure how to quantify the sharpness of the reversal. Thanks in advance!
 
Maybe calculate slope would help with part of what you want. Never done this but an example of how it might be done. Then you could color the slope plot or make a slope label.

input slopefactor = 10;
def slopebars=1;
def height = (yourstudy - yourstudy[slopebars]) * slopefactor;
def hypotenuse = Sqrt( Sqr(slopebars) + Sqr(height) );
plot slope = Tan(height / hypotenuse) * 180 / Double.Pi;
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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