I would like to know if the platform has been implemented with arrays
Good evening, it would be possible to have a matrix?
For example:
$example[1,3]=arrayvalue13
Currently arrays have only 1 dimension, so no that’s not possible to build matrix.
Hi
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
Hi 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!
MaaParticipant
Junior
Hi,
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?
It will not plot anything for the data history, but only with live data on each received tick.
MaaParticipant
Junior
Hi 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.
Insert at line 4: once $upvol[0]=0, once $dnvol[0]=0 to reinstate previous behaviour
MaaParticipant
Junior
Great, now it is working!
Thanks!
Apologies if this has been asked already but I have been unable to find it, if it has.
Is there the ability to sort the contents of an array yet?
Thanks
Rob
Will 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
Hi,
Is it possible to initialize an array with only one line?
Let’s take this example :
$period[1] = 10
$period[2] = 20
$period[3] = 50
$period[4] = 100
$period[5] = 200
Could it be replaced by
$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