Multiple timeframe stochastic crossover
Forums › ProRealTime English forum › ProScreener support › Multiple timeframe stochastic crossover
- This topic has 26 replies, 4 voices, and was last updated 6 years ago by MrMagic.
-
-
06/12/2018 at 11:25 AM #72982
Robertogozzi. Aside from the fact that the criteria for the screener is now totally different – going back to your original code I do not understand how the latest candle can meet the criteria. There are three candles in a row with no change in the relationship between the two lines.
Maybe I’m missing something as I say I don’t really do screeners – but it seems to me this is not doing what it says in the code. Please educate me as to how this meets the screener criteria?
1 user thanked author for this post.
06/12/2018 at 11:48 AM #72991Hi there. I’d like some help with getting the code/s for setting up stochastic crossover across 3 timeframes so I can get a signal/alert whenever my chosen timeframes are in the same direction.
Thanks.
KR.
MrMagic
Vonasi, that’s what my code is scanning for. Simply the same directions on all TFs.
1 user thanked author for this post.
06/12/2018 at 11:57 AM #72992The relationship is among 3 different TFs, not among candles within the same TF.
1 user thanked author for this post.
06/12/2018 at 12:02 PM #72993Aaah! My mistake because I misread your code. The OP had requested crossovers on all three time frames so that is what I read when I glanced at your code but now I see that you have > > and < < rather than > < !
1 user thanked author for this post.
06/12/2018 at 1:03 PM #73004Thanks for that robertogozzi. It’s given a list of securites that fit the criteria though it’s still listing those with ongoing crossovers (for example, USDCAD is still forming a bullish crossover on the Daily chart and it’s included this. However, I’m satified with the results; at least it narrows my choice to a few securities. Thanks.
As you can see in my attached photo, though stoch is up on d daily chart, it won’t be complete till the end of today, but it’s already picked this up.
06/12/2018 at 1:27 PM #73006It’s correct, since ProScreener scans charts LIVE, so during the week or the day, whenever a spike or slide affects prices, the NAME listed onscreen may appear/disappear many times.
06/12/2018 at 1:43 PM #73009Since ProScreener detects those securities/pairs meeting the desired conditions LIVE, it may happen that, when the two lines are close to each other, in one candle that name may be listed, while not in the next one. In such case you may miss a scan.
Moreover, you may want to know, despite the 4-hour TF might not meet the conditions anymore, that it MET the conditions one or more bars ago.
So I coded this modified version to accomodate for a validity period (number of candles). In my example I wrote 3 (line 1), you can increase it or reduce it to 1, in which case it behaves as the previous version:
12345678910111213141516171819202122232425262728293031ONCE LookBack = 3 //3 bars to keep alert visibleTIMEFRAME(weekly)StocK1 = Stochastic[14,3](close) //14, 3StocD1 = Average[5](StocK1) //5WeekDN = StocK1 < StocD1 AND StocK1 < StocK1[1] //K < D (southbound)WeekUP = StocK1 > StocD1 AND StocK1 > StocK1[1] //K > D (northbound)TIMEFRAME(daily)StocK2 = Stochastic[14,3](close) //14, 3StocD2 = Average[5](StocK2) //5DailyDN = StocK2 < StocD2 AND StocK2 < StocK2[1] //K < D (southbound)DailyUP = StocK2 > StocD2 AND StocK2 > StocK2[1] //K > D (northbound)TIMEFRAME(4 hours)StocK3 = Stochastic[14,3](close) //14, 3StocD3 = Average[5](StocK3) //5HourDN = StocK3 < StocD3 AND StocK3 < StocK3[1] //K < D (southbound)HourUP = StocK3 > StocD3 AND StocK3 > StocK3[1] //K > D (northbound)Dn = summation[LookBack](WeekDN AND DailyDN AND HourDN)Up = summation[LookBack](WeekUP AND DailyUP AND HourUP)ReturnValue = 0IF Dn THENReturnValue = -1ELSIF Up THENReturnValue = 1ENDIFSCREENER[ReturnValue] (ReturnValue AS "1=Up / -1=Dn")1 user thanked author for this post.
06/12/2018 at 1:44 PM #73010It’s correct, since ProScreener scans charts LIVE, so during the week or the day, whenever a spike or slide affects prices, the NAME listed onscreen may appear/disappear many times.
So in reality if you are a trader who checks the screener once a day then you are better to set your screener up to look at yesterdays results rather than today’s.
1 user thanked author for this post.
06/12/2018 at 1:50 PM #73013We posted something simultaneously, ma latter post deals a bit with that.
But a screener is not an indicator, it spares you hours to manually scan instruments to find those meeting your requirements.
If you want to scan a 4-hour chart but want to look at it once a day, well… an indicator is by far what suits you best.
My solution to keep a scan active for 2-3 bars is intended to be of help when you cannot be onscreen every 4 hours. But my solutions has two drawbacks:
- it increases the number of items listed (I think ProScreener allows a max. 100 items)
- some items in the list used to meet all conditions some bars ago, not now!
1 user thanked author for this post.
07/11/2018 at 8:01 PM #75829Hello robertogozzi, thanks for your help thus far. The screener has been of use. Can you advise please on how to modify the screener to monthly and weekly. I changed the contents as below but it keeps telling me that Line 1, character 11 syntax is wrong but I ‘ve tried ‘month’ and also ‘monthly’. What have I missed out?
Cheers.
Monthly/Weekly stochastic123456789101112131415161718192021222324TIMEFRAME(monthly)StocK1 = Stochastic[14,3](close) //14, 3StocD1 = Average[5](StocK1) //5MonthDN = StocK1 < StocD1 AND StocK1 < StocK1[1] //K < D (southbound)MonthUP = StocK1 > StocD1 AND StocK1 > StocK1[1] //K > D (northbound)TIMEFRAME(weekly)StocK2 = Stochastic[14,3](close) //14, 3StocD2 = Average[5](StocK2) //5WeeklyDN = StocK2 < StocD2 AND StocK2 < StocK2[1] //K < D (southbound)WeeklyUP = StocK2 > StocD2 AND StocK2 > StocK2[1] //K > D (northbound)Dn = MonthDN and WeekDNUp = MonthUP and WeekUPReturnValue = 0IF Dn THENReturnValue = -1ELSIF Up THENReturnValue = 1ENDIFSCREENER[ReturnValue] (ReturnValue AS "1=Up / -1=Dn")07/11/2018 at 8:58 PM #7583107/11/2018 at 9:16 PM #75832 -
AuthorPosts
Find exclusive trading pro-tools on