Distribution of returns using arrays in PRTv11

Forums ProRealTime English forum ProBuilder support Distribution of returns using arrays in PRTv11

Viewing 5 posts - 1 through 5 (of 5 total)
  • #123957

    I coded a distribution of returns indicator for v10.3 a while back and it was pretty slow and very clunky and I never really did get the auto scaling to work how I wanted it to plus the number of bars in the chart were limited by my patience for repetitive coding. Now that we have arrays in PRTv11 I decided to have another go. The results are much better!

    The indicator will analyse all of the history on the price chart and every time price is above or below price p bars ago it adds one to an array bucket for the exact percentage of price difference. The array buckets are 0.1% in size. Using LASTSET we are able to now easily auto scale the x axis and using ISLASTBARUPDATE the indicator is super fast to draw.

    The distribution of returns curve can be drawn as either a line chart or a histogram with the ‘LineChart’ setting.

    The current position on the curve that price is compared to price p bars ago is also displayed by a drawn point.

    I’ve put comments in the code to help everyone understand how the code works a little better. I will submit the indicator to the library.

     

     

    5 users thanked author for this post.
    #156511

    This is one of the most usefull instrument of the forum!

    Can i ask if is possible to do this distribution of returns in Standard Deviation?

    1 user thanked author for this post.
    #156528

    Thanks for the compliments. I just replied to your comment on the library post saying that it didn’t work! I assume all is good now and it was user error?

    As for basing the curves on standard deviations I will have to consider how to do this. I coded this almost ten months ago so I will have to remind myself of how the code works first! Strangely I found myself coding something similar yesterday before realising that I had already created an indicator to do almost the same thing. I must be losing some brain cells!

    #156609

    That’s exactly what I’m looking for, an indicator with lines (like the pivot point indicator) that would indicate 1, 2 and 3 standard deviations (https://www.prorealcode.com/topic/movement-indicator/)

    #156634

    Oliviertrader2020 – Yes you have already asked for that in the link that you have given. Asking twice is just double posting!

    • Do 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.
Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login