array variables availability in ProRealTime – examples and discussions

Forums ProRealTime English forum ProBuilder support array variables availability in ProRealTime – examples and discussions

Viewing 15 posts - 241 through 255 (of 255 total)
  • #235300

    A strategy application, well that will take some time, I’ll have to sleep on that one.

    Regarding volume, if you replace the ‘close’ on line 10, with volume,

    that appears to display the volume values of the 1 tick chart I believe.

    Dam, I told everyone, doh

    #235368

    Not sure how this will work out :


    @Nicolas
    , page 15 of this topic presents a black screen. This is how the topic “don’t know what happened, but this was the ‘Array Post'” emerged (a continuation of the original topic).
    I am now responding to page 14 – maybe that recovers page 15. But if not, I will post it in that 2nd topic (see below). And in that case ? can the Array Topic be repaired ?

    #235370

    Not sure how this will work out :


    @Nicolas
    , page 15 of this topic (see 2nd pic) presents a black screen. This is how the topic “don’t know what happened, but this was the ‘Array Post'” emerged (a continuation of the original topic).
    I am now responding to page 14 – maybe that recovers page 15. But if not, I will post it in that 2nd topic (see below). And in that case ? can the Array Topic be repaired ?

    … so it did not work out. See the 2nd pic below for the topic which is stuck.

    #235374

    Ok, I will look at what happened in the original topic, thanks for let me know!

    #235379

    It should work by now.

    #235382

    Yes, super. Thank you @Nicolas.
    You could consider to merge this topic here (the “Don’t know what happened”) with the original ?

    #235457

    The topics are merged, have a nice day! 🙂

    #238980

    Recovering historical values of an array.
    Compared to normal variables, arrays don’t create their historical values at the end of bar but retain their current value.

    Using simple maths:
    A + B = C , which can be transposed to , C – A = B or C – B = A
    Also, A – B = D which is the difference between A and B.

    Looking at the sequence of events, the first formula, takes value A then adds value B, which results in C.
    The transposed formula, take the result , C and subtracts either A or B which gets the missing value.
    Looking closer at this sequence, you could say the later value C, requires an earlier value, A or B, to find the missing value.

    So applying that to arrays, arr[0] =10, needs the value prior to it which could be store in arr-1[0] = 6.
    Therefore, arr[0] – arr-1[0] = 10 – 6 = 4 the difference is the missing value, A – B = D.

    Looking at the history values of 1 element, with original values in arr.
    See table 1.

     

    res = arr-arr-1 gives the difference between the current and prior value, A – B = D.
    Instead of storing the original values, we store the sum of the values. Which is like adding the difference between new and current value. Therefore D – B = A or C – B = A if your following.
    Here, D is the accumulated value and B is the prior accumulated value.
    Doing this, encodes the original data values or information. In normal array operation, the current value, is lost when the original element values get overwritten. Or to put it another way, originally we have A = C where A and C don’t retain any information from the earlier values as they go forward and just represents the new value.

    Looking at the history values of 1 element, with an accumulated value in arr.
    See table 2.

     

     

    Note: the difference value of Res=arr-arr-1 is now the same as the original arr values.
    Magic…

    Using the two arrays, along with the accumulative values, allows, not only to find a specific prior value of an array, but depending on the range of element index for both arrays chosen, you can get a summed value over a range of array elements.

    A few things to point out,
    Using the barindex value for the array index, aligns the arrays with respect to the chart bars, which is helpful when trying to look-back to recover values. This also means that the arrays need to be updated each bar to keep the alignment.
    Now the above is the Rule and I’m sure there could be exception to it, depending on application, type of data, and context.

    In simple example, the look-back value is retrieved from both CLOSE[LB] and from the arrays.

     

     

     

    #238982

    Hello moderators…

    My above post, ‘Recovering historic values of an array’ was posted in wrong topic, should have gone in , see link

    https://www.prorealcode.com/topic/array-variables-availability-in-prorealtime/

    Additionally the rouge image above it, was my pathetic attempt to embed an image gone horribly wrong.

    If possible, could you move the relevant post, and delete the rogue image along with this post.

    Thankyou.

    My bad… druby

    #239075

    @druby

    Done

    1 user thanked author for this post.
    #239185

    Hi Roberto @robertogozzi,

    A small reminder : the merge with the other topic was applied, but the merged posts in this topic you look at now, are still there.

    Regards,
    Peter

    #239189

    An update, correct table 2.

    Not only  I can’t embed images and post in right place, it seems I can’t add up number either.

    #239217

    Hi Roberto @robertogozzi,

    A small reminder : the merge with the other topic was applied, but the merged posts in this topic you look at now, are still there.

    Regards,

    Peter

    This is the topic where he wanted them to be, they come from elewhere, thanks 🙂

     

    #239265

    I was nicely confusing myself there.  Plus I was addressing you, Roberto, while it should have been Nicolas.
    I guess part of the confusion springs from the fact that that picture is still there in this other topic, plus that druby now (implicitly) links to the topic over here (a few posts back).

    Only justifying my “error” … 😉

    1 user thanked author for this post.
    #239267

    I was addressing you, Roberto, while it should have been Nicolas.

    Actually you were right, as I had made the SPLIT + MERGE, not Nicolas 🙂

     

    1 user thanked author for this post.
Viewing 15 posts - 241 through 255 (of 255 total)
Similar topics:

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