array variables availability in ProRealTime – examples and discussions
Forums › ProRealTime English forum › ProBuilder support › array variables availability in ProRealTime – examples and discussions
- This topic has 254 replies, 50 voices, and was last updated 2 months ago by robertogozzi.
-
-
04/11/2020 at 1:22 PM #12569304/11/2020 at 7:27 PM #12571804/15/2020 at 12:20 PM #126262
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!
04/17/2020 at 8:06 PM #126640HI
i would like to chat to you could u email me pls——————–
04/17/2020 at 8:28 PM #126643@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 🙂
04/17/2020 at 9:08 PM #126647Hi 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.
04/18/2020 at 8:31 AM #12667904/18/2020 at 9:28 AM #126691Thanks 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.
04/22/2020 at 6:43 AM #12738005/03/2020 at 10:58 AM #129544Hi
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
EMA array?123456789101112$period[0] = 5$period[1] = 10$period[2] = 20$period[3] = 50$period[4] = 100$period[5] = 200for i = 0 to lastset($period) do$ema[i] = ExponentialAverage($period[i])(Close)nextreturn $ema[i]05/03/2020 at 12:16 PM #12954705/03/2020 at 2:15 PM #12957505/03/2020 at 2:39 PM #129580There 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 ()
1$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
123456789101112131415$period[1] = 5$period[2] = 10$period[3] = 20$period[4] = 50$period[5] = 100$period[6] = 200for i = 1 to lastset($period) do$ema[i] = ExponentialAverage[$period[i]](Close)if $ema[i][1] <> 0 thendrawsegment(barindex,$ema[i],barindex-1,$ema[i][1])endifnextreturn1 user thanked author for this post.
05/03/2020 at 2:46 PM #12958505/03/2020 at 2:58 PM #129594Please 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:
1return $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:
123456789ema1 = exponentalaverage[5]ema2 = exponentalaverage[10]ema3 = exponentalaverage[20]ema4 = exponentalaverage[50]ema5 = exponentalaverage[100]ema6 = exponentalaverage[200]return ema1, ema2, ema3, ema4, ema5, ema6 -
AuthorPosts
Find exclusive trading pro-tools on