♥ 0 |
Hi Pete, Please help setting up scan for Buy and Sell with following conditions: Scan for Buy: KPeriod and DPeriod must both be below “20” (over_sold) and cross over. Scan for Sell: KPeriod and DPeriod must both be above “80” (over_bought) and cross over. Here’s the StochasticFast: # declare lower; input over_bought = 80; plot FastK = reference StochasticFull(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, 1, averageType).FullK; def upK = FastK crosses above OverSold; plot UpSignal;
Marked as spam
|
Private answer
In response to Kim’s reply on August 18th, here is the solution I would use. I examined Kim’s code and found it jumps through a lot of hoops that I find unnecessary. If you check if FullD of the previous bar is above overbought or below oversold, you already know that FullK is also in that condition, because it is on the other side of FullD before the cross. So just create the statements that define the crosses and then check for when a cross has occurred. The final condition is to check if FullD was in correct relation to overbought/oversold on the bar immediately prior to the cross. I am sure this has already been demonstrated on the site. Everyone seems to find a use for this sort of thing. So I suppose adding one more solution on this topic will make it that much easier for folks to find.
Marked as spam
|
|||
Private answer
This is a very common request and a search of our Q&A forum should turn up numerous examples you can use. https://www.hahn-tech.com/ans/stochastic-1-and-4-hour-scan/ https://www.hahn-tech.com/ans/macd-stochastics-scan/ https://www.hahn-tech.com/thinkorswim-custom-scan-stochastic-macd/ Marked as spam
|
Please log in to post questions.
Wow! This code is much simpler. Thank you, Pete!