Fast Stochastic Crossover Watchlist


Category:
0
0

I know you made a few posts and videos on custom watchlists, but I am having trouble being able to order my watchlist based on a Fast Stochastics crossover within 2 periods. I am not having trouble being able to put the Fast Stochastics’ value on one of my watchlist columns. I am having trouble with having a column for Fast Stochastics crossover within 2 periods.

 

P.S. The crossover I am looking for is the FastK crossing over the FastD

Marked as spam
Posted by (Questions: 34, Answers: 56)
Asked on March 11, 2017 9:37 am
307 views
0

I think I understand but let me state this in different terms to be sure. You want to be able to sort the watchlist so that those stocks who’s FastK has crossed above the FastD within the last two bars appear at the top of the list. Why didn’t you post your code? That would have really enhanced the learning opportunity for other viewers.

( at March 11, 2017 10:29 am)
0

Yes, you are understanding correctly. I didn’t have any code for this. I just clicked on my watchlist and clicked ”customize” then I added StochasticsFast.

( at March 11, 2017 3:17 pm)
1
Private answer

For this answer I copied the code from the built in study, StochasticFast. I then modified the code to work in a watchlist. I added several lines of code to look for FastK crossing above FastD two bars ago. I added tests to check that the FastK is still above FastD two bars later. A positive result prints a value of +1. Once you get to the third and consecutive bars the signal returns to -1.

Be sure to up-vote any answers that best solve your question. The code is posted below. Please leave comments if you need any further explanations or adjustments.

#
# TD Ameritrade IP Company, Inc. (c) 2008-2017
#
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 3;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
def FastK = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,1,averageType).FullK;
def FastD = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,1,averageType).FullD;
def kCrossesD = FastK[1] < FastD[1] and FastK > FastD;
def crossedTwoBarsAgo = kCrossesD[2];
def stillValid = FastK[1] > FastD[1] and FastK > FastD;
plot data = if crossedTwoBarsAgo and stillValid then 1 else -1;

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on March 11, 2017 10:35 pm
0
Private answer

Hi Pete , I have a challenge somewhat similar to the one listed above with two stochastics. I plot two full stochastics with different parameters in the same frame on one of my charts. I would like to calculate the value difference between  the %K of one stochastic and the %D of the other. Ideally, I’d like the resulting value in a watchlist. I have NO coding skill so would consider a reasonable fee for the effort.

Thank you

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on July 9, 2017 1:13 pm
0

Hi William, thanks for the note. If you are interested in pursuing this as a billable thinkscript project you can view our rates and get further details about submitting your request at this webpage: https://www.hahn-tech.com/about/

If you would rather pursue a free option, then go ahead and post a new request in the Q&A forum (start new thread). Be sure to include the settings you are using and any other additional details required for completion.

( at July 9, 2017 3:22 pm)