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 1 month ago by robertogozzi.
-
-
05/04/2021 at 7:50 AM #168725
I would like to know if the platform has been implemented with arrays
05/04/2021 at 8:00 AM #168726Yes it is! there are a lot of examples listed in this post: https://www.prorealcode.com/topic/array-variables-availability-in-prorealtime/#post-118817
You can find others there:
05/04/2021 at 10:36 AM #168757GrazieThank you
05/25/2021 at 6:52 PM #17039905/25/2021 at 6:53 PM #17040007/16/2021 at 12:10 AM #173690Hi
I have begun to see a couple of systems that are self optimising and I feel like they may be using arrays (I may be wrong) based on the examples on the forum
If for example I wanted to go long when the EMA[8] cross the SMA[X], where X is the variable giving the most profitable outcome based on the last 500 bars, can I use arrays to find X? So my system could be self optimising for X as it ran rather than using a fixed value
Thanks
Ruark
08/08/2021 at 2:36 PM #174931Hi Ruark (@Robo Futures Trader), I’ve tried this manually using Python:
- backtest strategy over different historical samples (e.g. 4hr strategy, monthly samples, over 5 yrs)
- for each sample, optimise variables to find best gain (or other parameter, I personally like gain / drawdown)
- save optimum variables for each sample, together with some ‘average characteristic’ parameters to identify market conditions (trend strength, volatility etc)
- take results from python and then manually (Excel) plot optimum vars Vs ‘average characteristic’ parameters to look for trends
- curve-fit a function for each variable, for example, var1 = function of (macdline, or adx) could be a simple linear function, y = mx + c
- code the functions into the strategy to optimal adjust parameters based on market conditions
For the single strategy/example I tried, it seems to work and creates what appears to be an adaptive and more robust strategy… but to be honest it’s so much manual work that I gave up (day job, family, not enough time).
The next step in this journey was going to be using python to do the curve fitting automatically (steps 4,5 above) to identify best functions. As an engineer, this parameter curve-fitting process feels like a good direction to move in. I think the benefit could be a simpler strategy that it adapts to future changes in the market.
It would be great (@Nicolas ?) if PRT could do steps 1,2,3 above during a walkforward analysis. That would save a lot of time. Even better of PRT could do the whole process (1-6) 🙂
Also, it would be great if someone else has already worked out how to self-optimise in PRT.
Perhaps I’m going down the wrong track but I’ve not managed to develop a robust code using walkforward and most of my short-time-frame strategies are over-fitted. Basic daily strats are ok. BTW, I could really use a tutorial/lesson on how to develop a robust code using walkforward and then also how to actually manage the process during live running. Can you make a youtube video with the basics?
thanks all and hope to continue this discussion!
09/16/2021 at 7:09 PM #177743Hi,
I am trying to test the third example from page one (Example #3: separate buy/sell volumes on the same candle). I am not able to get it to work however, I only see a horizontal line with the value zero as shown in the picture.
Any ideas what might be causing this?
09/17/2021 at 7:55 AM #17776809/17/2021 at 2:28 PM #177812Hi Nicolas,
Yes but I am not able to see the live ticks either (like the bars in the picture you posted with the code).
I don’t know if I am missing something. I am adding the indicator as shown in the picture and I am using IG as broker.
09/17/2021 at 3:52 PM #17781709/17/2021 at 7:26 PM #17782510/08/2021 at 2:46 PM #17923410/08/2021 at 2:53 PM #179235Will be possible in a few days for ProRealTime software, then updates with new instructions will come to other versions dealed by brokers. I’m currently testing these new capabilities (with other many cool new instructions and not specific to arrays..).
The new instructions for arrays are:
Unset($var) Reset the whole array
ArraySort($var,mode) Sort ASCEND or DESCEND (mode) the whole data set of an array
01/01/2022 at 5:54 PM #184268Hi,
Is it possible to initialize an array with only one line?
Let’s take this example :
12345$period[1] = 10$period[2] = 20$period[3] = 50$period[4] = 100$period[5] = 200Could it be replaced by
1$period = [10, 20, 50, 100, 200]or something similar?
In my actual example, I have a llllooooonnnnnngggg list of values to initialize the array with.
Thanks in advance,
Nicolas
-
AuthorPosts
Find exclusive trading pro-tools on