Rate of Change Indicator for Stochastic SlowK

6

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:
markos

markos

Well-known member
VIP
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:
horserider

horserider

Well-known member
VIP
@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.
 
6

68sooner

New member
VIP
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!
 
horserider

horserider

Well-known member
VIP
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;
 
D

diazlaz

Well-known member
2019 Donor
VIP
@horserider this typically works best on higher time frame charts, than lower time frames to calc this slope. please share your findings.
 

Similar threads

Top