Need help with Stochastic syntax

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9432 quote
    chrille
    Participant
    New

    Hi,

    New to the forum, first post! 🙂

    I’m trying to reproduce an indicator I have in another platform in PRT, but can’t make it work. Results differ from the “orginal”.

    It’s using Slow Stochastics, %K=5, %D=3.

    First part of it is comparing Slow Stochastic from two periods back with current period. I’ve tried like this:

    Stochastic[3,5](Close[2]) < Stochastic[3,5]

    Also tried SmoothedStochastic. I’m not sure how to handle the Stochastic indicator in PRT. Any advice is greatly appreciated.

    Cheers,

    #9439 quote
    Nicolas
    Keymaster
    Master

    Hi chrille,

    You should code your stochastic comparing statement like this instead:

    sto = Stochastic[3,5](Close)
    
    condition = sto[2]<sto

    The “sto” variable array will be built on the fly by the platform, so you just have to refer to this array of data with number under bracket considering the last n value.

    #9473 quote
    chrille
    Participant
    New

    Hi Nicolas,

    Thanks for the suggestion, it works much better. Although I still get slightly different results compared to the”original”, but I’ll keep working on it. 🙂

    Cheers,

    #9475 quote
    Nicolas
    Keymaster
    Master

    Maybe you could share us the indicator you’d like to be converted, this is something I’m used to 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Need help with Stochastic syntax


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
chrille @chrille Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Nicolas
9 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/15/2016
Status: Active
Attachments: No files
Logo Logo
Loading...