Prorealcode for standard PRT stochastic and RSI
Forums › ProRealTime English forum › ProRealTime platform support › Prorealcode for standard PRT stochastic and RSI
- This topic has 7 replies, 2 voices, and was last updated 2 years ago by mwilkens111.
Tagged: RSI, Stochastic
-
-
03/06/2022 at 3:38 PM #189450
When adding indicators in PRT, the standard stochastic is a good starting point. Is the prorealcode for this standard indicator as included in PRT available?
Would like to expand on it, but need code to get started.
Markus
03/06/2022 at 6:20 PM #189453This is the standard formula:
123456789101112131415//--------------------------------------------------------------------------------------// Formula://// https://en.wikipedia.org/wiki/Stochastic_oscillator// https://www.investopedia.com/terms/s/stochasticoscillator.asp//DEFPARAM CalculateOnLastBars = 2000// settings for Stochastic 10,5,3)// Periods = 10// Kline = 5// Dline = 3// AvgType = 1 //EmaK = average[Kline,AvgType](((close - lowest[Periods](low)) / (highest[Periods](high) - lowest[Periods](low))) * 100)D = average[Dline,AvgType](K)RETURN K AS "%K",D AS "%D"1 user thanked author for this post.
03/07/2022 at 8:50 AM #189466Perfect, thanks a lot!
It seems with Stochstic there is also a “slow” one, will this only relate to the “K” number of days to average?
Thank you for the super fast assistance!
Markus
03/07/2022 at 9:15 AM #189467Yes, slow and fast are determined by settings only.
03/07/2022 at 8:29 PM #189577is there also a chance to get the code for the standard PRT RSI indicator with a few variables to play with period and average Type?
Markus
03/08/2022 at 2:50 PM #189605Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
Your request will be addressed asap.
Thank you 🙂
03/08/2022 at 4:04 PM #189618There you go:
123456789101112131415161718192021// RSI indicator//// Formula://// (https://www.prorealcode.com/topic/indicatore-rsi/#post-51250)// (https://www.investopedia.com/terms/r/rsi.asp)//p = 14 //periodsOb = 70 //OverBoughtOs = 100 - Ob //OverSold//Bullish = MAX(0, CLOSE - CLOSE[1])Bearish = MAX(0, CLOSE[1] - CLOSE)//mmBullish = WILDERAVERAGE[p](Bullish)mmBearish = WILDERAVERAGE[p](Bearish)//RS = mmBullish / mmBearishmyRSI = 100 - (100 / (1 + RS))//RETURN MyRSI AS "Rsi",Os AS "Os",Ob AS "Ob"03/08/2022 at 5:37 PM #189635thank you! very helpful indeed.
-
AuthorPosts
Find exclusive trading pro-tools on