array variables availability in ProRealTime – examples and discussions

Viewing 15 posts - 61 through 75 (of 255 total)
  • Author
    Posts
  • #125693 quote
    Nicolas
    Keymaster
    Master

    Sorry,  but you can’t get the whole data contained in an array through a CALL.

    MPL thanked this post
    #125718 quote
    MPL
    Participant
    Average

    Ok, thank you for your answer

    #126262 quote
    Vonasi
    Moderator
    Master

    You can find here another version of the benefit of arrays. In this example we calculate weekly bollinger bands to display on any faster time framed chart. The code could easily be adapted to calculate the standard deviation for any period for anything!

    Standard deviation calculation using arrays.

    #126640 quote
    neal parma
    Participant
    New

    HI

    i would like to chat to you could u email me pls——————–

    #126643 quote
    robertogozzi
    Moderator
    Master
    @neal parma when you posted you had a chance to read a full set of rules to stick to. You probably did not pay attention to them and broke this one:

               Do not include personal information such as email addresses, telephone numbers, etc… in your posts

    Please share our common rules. Thank you 🙂
    #126647 quote
    JMat45
    Participant
    Senior
    Hi Nicolas, any update on the array sort functionality? I appreciate things will take longer to implement given the current situation. Again, what am I trying to do is to percentile rank price moves (of say DAX Futures) from 8.00am (UK time) to 8.00am + x minutes.
    #126679 quote
    Nicolas
    Keymaster
    Master
    Still no update on that new instruction, sorry. How do you want the percentile to be plotted?
    #126691 quote
    JMat45
    Participant
    Senior
    Thanks for your quick reply, Nicolas. I was hoping to plot it as a simple histogram in a separate panel on the close of each bar, building up cumulatively from the 8.00am open to a designated finish time, similar to your separate buy/sell volumes on the same candle indicator. So when price falls relative to the open, it displays a red histogram with the value equal to the percentile rank of the decline (in terms of % of x-day ATR, vs the open) measured over the previous y days; and likewise when price rises relative to the open, it displays a green histogram with the value equal to the percentile rank of the rise (in terms of % of x-day ATR, vs the open) measured over the previous y days. The thinking behind it is to try and take advantage of the early morning reversals (in both directions, but typically a sharp drop followed by a snap back up on light news days) on the DAX, but using a ‘smart’ way to measure it and incorporate some historical context as opposed to just an oscillator like RSI or Stochastics that tells you nothing about previous days’ price action.
    #127380 quote
    s00071609
    Participant
    Senior
    So, will this allow creation of indicator similar to MT4 ZUP? Also, the 3 point based Fibonacci Time projection into future?
    #129544 quote
    robdav
    Participant
    Veteran
    Hi Experimenting with my first array and seem to have fallen at the first hurdle, so help would be appreciated. If we wanted to return a set of non consecutive numbers of exponential moving averages by using an array, how would we do it please. My attempt below doesn’t work, what am I missing? Thanks as always! Rob  
    $period[0] = 5
    $period[1] = 10
    $period[2] = 20
    $period[3] = 50
    $period[4] = 100
    $period[5] = 200
    
    for i = 0 to lastset($period) do
    $ema[i] = ExponentialAverage($period[i])(Close)
    next
    
    return $ema[i]
    #129547 quote
    Vonasi
    Moderator
    Master
    First of all you can’t have a position zero in an array. The RETURN line will then just return the value in position 5 of the array because that is the last known value of ‘i’.
    robdav thanked this post
    #129575 quote
    robdav
    Participant
    Veteran
    So in this example I’m trying to add the Exponential Moving Average for periods 5, 10, 20, 50, 100 & 200 all at the same time, is that possible?
    #129580 quote
    Vonasi
    Moderator
    Master
    There is no need to quote me (twice!) when I am the only person you are talking with! I’ve deleted the quotes in your post. Yes your code does that $ema[0 to 5] (should be 1 to 6) will have the latest values for ema5, ema10, ema20, ema50, ema100 and ema200. I notice now that your EXPONENTIALAVERAGE is incorrect it should be with [] and not ()
    $ema[i] = ExponentialAverage[$period[i])(Close)
      The only thing it does not do is display them in a RETURN line. You could do it like this to avoid adding them all to the return line. Not tested
    $period[1] = 5
    $period[2] = 10
    $period[3] = 20
    $period[4] = 50
    $period[5] = 100
    $period[6] = 200
    
    for i = 1 to lastset($period) do
    $ema[i] = ExponentialAverage[$period[i]](Close)
    if $ema[i][1] <> 0 then
    drawsegment(barindex,$ema[i],barindex-1,$ema[i][1])
    endif
    next
     
    return
    robdav thanked this post
    #129585 quote
    robdav
    Participant
    Veteran
    If I did want to return them on the RETURN statement, how would I do that?
    #129594 quote
    Vonasi
    Moderator
    Master
    Please stop using the ‘Quote’ button unnecessarily! Especially if it then includes masses of code! Just put your reply in the box and press submit! I’ve had to edit your post again. Just put:
    return $ema[1], $ema[2], $ema[3], $ema[4], $ema[5], $ema[6]
    You are not really achieving anything with your code that you couldn’t achieve with the following:
    ema1 = exponentalaverage[5]
    ema2 = exponentalaverage[10]
    ema3 = exponentalaverage[20]
    ema4 = exponentalaverage[50]
    ema5 = exponentalaverage[100]
    ema6 = exponentalaverage[200]
    
    
    return ema1, ema2, ema3, ema4, ema5, ema6
Viewing 15 posts - 61 through 75 (of 255 total)
  • You must be logged in to reply to this topic.

array variables availability in ProRealTime – examples and discussions


ProBuilder support

New Reply
Author
author-avatar
Nicolas @nicolas Keymaster
Summary

This topic contains 254 replies,
has 50 voices, and was last updated by robertogozzi
1 year, 3 months ago.

Topic Details
Forum: ProBuilder support
Language: English
Started: 02/06/2020
Status: Active
Attachments: 59 files
Logo Logo
Loading...