Stochastic indicator in exponential calculation
Forums › ProRealTime English forum › ProBuilder support › Stochastic indicator in exponential calculation
- This topic has 6 replies, 4 voices, and was last updated 1 year ago by Sebastian.
-
-
02/06/2023 at 12:10 AM #209176
Hello all,
I am just starting to create simple customized indicators in ProBuilder, mainly with the purpose of combining several indicators in one chart.
Right at my first attempt I got stuck. When I select the stochastic indicator from the library, I can choose between different calculation methods (simple, exponential, weighted…). The functions in ProBuilder Stochastic[N,K](price) or Stochasticd[N,K,D](price) do not offer any parameter for this.
How can I calculate the stochastic indicator by exponential or weighted method? By default it is calculated in the standard way.
Thanks for your input!
02/06/2023 at 12:34 AM #209178Hi @Sebastian
The indicators in the library are all custom-made indicators and can be a variation of the standard indicators in PRT…
If you want to use the stochastics with a certain average, you will have to use the indicator from the library…
You can import from the library into the standard indicators of PRT…
(Download the .itf file of the relevant indicator from the library and import it into the (standard) indicators of PRT…)
02/06/2023 at 5:24 AM #209190Do 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.
Thanks 🙂
1 user thanked author for this post.
02/06/2023 at 12:52 PM #209227Sorry Roberto. I apologize and will consider for the future.
Thanks for replying!
I might not have pointed my problem out properly.
The standard stochastic indicator in PRT offers different calculation methods which the code from the ProBuilder library doesn’t. I would like to see the “exonential feature” for my customized indicator as well.
I found another thread inside this forum where a user seemed to have solved that exact problem but unfortunately I do not understand his solution:
https://www.prorealcode.com/topic/indicator-for-stochastic-exponential-method/#post-79281
02/06/2023 at 2:57 PM #209240You can change the moving average type in the code with:
1ma = average[period,type]where period is the period of calculation and type, the moving average type, you can modify with:
0 = SMA 1 = EMA 2 = WMA 3 = Wilder 4 = Triangular 5 = End point 6 = Time series 7 = Hull (PRT v11 only) 8 = ZeroLag (PRT v11 only)
You can also, add a MAtype as the variable definition, in the indicator settings, to let the user change it more user friendly.
1 user thanked author for this post.
02/06/2023 at 3:12 PM #209244Hi Sebastian,
Here is the calculation of the Stochastics…
As Nicolas pointed out, the second parameter of the Average[3,0] is the setting for your average…
Stochastics1234567891011//Stochastichi = highest[14](high)lo = lowest[14](low)oscillator = (close - lo) / (hi - lo) * 100ProcentK = average[3,0](oscillator) // 0=SMA, 1=EMA, 2=WMAProcentD = average[5,0](ProcentK) // 0=SMA, 1=EMA, 2=WMARETURN ProcentK AS "%K MA", ProcentD AS "%D MA"02/07/2023 at 12:09 AM #209265 -
AuthorPosts
Find exclusive trading pro-tools on