Multi-Dimensional Arrays

The forum for experienced coders to upload their helpful hints, tips and lessons.
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Re: Multi-Dimensional Arrays

Post by snailbeard »

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.
Radar
Trader
Posts: 437
Joined: Fri Mar 23, 2012 5:39 pm
Location: Round the bend ;)

Re: Multi-Dimensional Arrays

Post by Radar »

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^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
Post Reply

Return to “Coding Lessons - info for all”