stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Multi-Dimensional Arrays
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=2874
Page 2 of 2
Author:  snailbeard [ Sun Nov 17, 2013 8:59 am ]
Post subject:  Re: Multi-Dimensional Arrays

Great work Radar!

I did look at the built-in functions, but I had some difficulties getting it to work with 3 dimensions,
probably a mistake on my part or because of the way in which I work with different time frames.

I don't update the whole array each time, so the dimension for timeframe PERIOD_M15 gets updated only once every 15 minutes etc.

If I shifted the PERIOD_H1 data each time I shifted PERIOD_M15 the data would get skewed.

I am not holding much data or the regular shuffling would be very inefficient.

It would have been simpler to keep the different timeframes in different arrays.

Also one can use a circular index and circular buffer so that the data never needs to be shuffled if the arrays are fixed sized.

If I was able to use objects and pass objects by reference none of this half cocked array management would be required :lol:

Speed is a major aspect as I cannot wait an hour per each 12 month back-test.
If the back-test completes in 30 seconds then I am confident that the real-time response is adequate.

The built in functions will definitely be faster for large amounts of data.
Author:  Radar [ Sat Dec 07, 2013 4:26 am ]
Post subject:  Re: Multi-Dimensional Arrays

I've tried to reply to this a few times, and each time, my mind went totally blank...

Which just shows that this is way above my level of experience in planning, coding, and comprehending other people's code ;)

Looks like I've got a lot of reading to do, as well as quite a lot of practise ;)

Have fun!

Radar =8^)
All times are UTC Page 2 of 2