• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 6:40am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 6:40am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Dynamic TakeProfit & Dynamic StopLoss EA/AI/Algorithm 0 replies

Multidimensional Arrays in MQL4 1 reply

Functions on a Multidimensional array? 2 replies

Help understanding multidimensional arrays, ...? 15 replies

Can arrays be boolean variables? 2 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: Dynamic Multidimensional Arrays
Exit Attachments
Tags: Dynamic Multidimensional Arrays
Cancel

Dynamic Multidimensional Arrays

  • Post #1
  • Quote
  • First Post: Apr 24, 2010 10:24am Apr 24, 2010 10:24am
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Okay so I'm trying to create a dynamic multidimensional array... but it doesn't seem like it's possible in metatrader?

We can do something like this

Inserted Code
int test[];

but this won't work...

Inserted Code
int test[][][];

Sorry if I'm not explaining this well
  • Post #2
  • Quote
  • Apr 24, 2010 10:40am Apr 24, 2010 10:40am
  •  sangmane
  • Joined Apr 2009 | Status: MT4 Programmer | 758 Posts
why it won't work? quoted from MQL4 Language Reference:
"Arrays are allowed to be maximum four-dimensional."
 
 
  • Post #3
  • Quote
  • Apr 24, 2010 10:47am Apr 24, 2010 10:47am
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Quoting sangmane
Disliked
why it won't work? quoted from MQL4 Language Reference:
"Arrays are allowed to be maximum four-dimensional."
Ignored
Yes I know that, but can all four be dynamic at the same time?

like this would work but it's limited...
Inserted Code
int test[][5][5];

otherwise can you resize other dimensions?
 
 
  • Post #4
  • Quote
  • Apr 25, 2010 1:48pm Apr 25, 2010 1:48pm
  •  rangebound
  • | Joined Aug 2006 | Status: Member | 237 Posts
No ... Only the first dimension can be dynamic so you can have

int one[];
int two[][6];
int three[][10][20];

etc.

Not sure if MT5 enhances this or not.
 
 
  • Post #5
  • Quote
  • Apr 25, 2010 3:24pm Apr 25, 2010 3:24pm
  •  Ronald Raygun
  • Joined Jul 2007 | Status: 32 y/o Investor/Trader/Programmer | 5,016 Posts
I wonder...

Would it be possible to have an array inside an array element?
 
 
  • Post #6
  • Quote
  • Apr 25, 2010 4:52pm Apr 25, 2010 4:52pm
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,636 Posts
Quoting MoForce
Disliked
Yes I know that, but can all four be dynamic at the same time?

like this would work but it's limited...
Inserted Code
int test[][5][5];
Ignored
hey mo..... out of couriosty, why is that limited..... obviously you are imposing a limit of 5, but you could just as easily have [][500][500]..... if it's not something you'd prefer to keep private, what is it your wanting to do..... why do all need to be dynamic....h

//-----

//----- fwiw

and i know i've been chastised by others for suggesting this, i understand their point completely, but still tend to set arrays with high values....
double array[20][700][700].....

my biggest hurdle was to developing a method of filling the arrays which could easily be recalled.... once that was accomplished, a single multidimensional array can now hold every conceivable indicator value along with every conceivable signal derived from those indicators, both past and present, on every single timeframe on every single pair.....

all in a single multidimensional array ...... which is why the 'limited' part of your post has me confused.....h
to trade and code, keep both simple... no call to impress....h
 
 
  • Post #7
  • Quote
  • Apr 25, 2010 6:46pm Apr 25, 2010 6:46pm
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Quoting hayseed
Disliked
hey mo..... out of couriosty, why is that limited..... obviously you are imposing a limit of 5, but you could just as easily have [][500][500]..... if it's not something you'd prefer to keep private, what is it your wanting to do..... why do all need to be dynamic....
Ignored
I've got an idea for a dynamic neural network which could help settle the question of whether the market is predictable or not. I've worked it out on paper and it looks good... putting it into code however... lol it's pretty hard with MQL. I might just end up creating something that just feeds the data from MT elsewhere to be processed.

I could have [][500][500] but that's limited for what I'm trying to accomplish. I can't say why since it might give away what my idea is.

Quoting Ronald Raygun
Disliked
I wonder...

Would it be possible to have an array inside an array element?
Ignored
Yeah I was messing around with that idea too... I don't think it's possible

Quoting rangebound
Disliked
No ... Only the first dimension can be dynamic so you can have

int one[];
int two[][6];
int three[][10][20];

etc.

Not sure if MT5 enhances this or not.
Ignored
Yeah I tried MT5 too and it doesn't offer too much help.

Anyway I think I've got something going I'll have to train it for a while though
 
 
  • Post #8
  • Quote
  • Apr 27, 2010 1:44am Apr 27, 2010 1:44am
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Here's a graphical representation of the growing network... it's based on the past 2 Months of 1Min data from G/U

If this is not successful I'll be back in a month or two with another crazy idea so until then...
Attached Image
 
 
  • Post #9
  • Quote
  • Apr 27, 2010 1:53am Apr 27, 2010 1:53am
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
and just for kicks... I did a 3D version of a portion of the network (just a portion so it renders quickly)
Attached Image (click to enlarge)
Click to Enlarge

Name: 3DNetwork.PNG
Size: 33 KB
 
 
  • Post #10
  • Quote
  • Apr 28, 2010 7:06pm Apr 28, 2010 7:06pm
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Uhhh I'm back to ask 1 question lol

when running the strategy tester in MT5... where are files stored (like ones created with FileOpen(name,FILE_READ|FILE_WRITE); )?

thanks
 
 
  • Post #11
  • Quote
  • Apr 28, 2010 7:16pm Apr 28, 2010 7:16pm
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,636 Posts
hey mo..... if your refering to files you are creating/writing, they can be found in the files folder in the experts folder......h
to trade and code, keep both simple... no call to impress....h
 
 
  • Post #12
  • Quote
  • Apr 28, 2010 11:24pm Apr 28, 2010 11:24pm
  •  Ronald Raygun
  • Joined Jul 2007 | Status: 32 y/o Investor/Trader/Programmer | 5,016 Posts
I think in MT5 it's stored in tester/files
 
 
  • Post #13
  • Quote
  • Apr 29, 2010 12:14am Apr 29, 2010 12:14am
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Quoting Ronald Raygun
Disliked
I think in MT5 it's stored in tester/files
Ignored
That's what I thought... but I don't see anything... in fact I don't think my EA is getting tested at all O.o Does this have something to do with http://www.forexfactory.com/showpost...60&postcount=4

do I need to download another copy of MT5?
 
 
  • Post #14
  • Quote
  • Apr 29, 2010 12:18am Apr 29, 2010 12:18am
  •  Ronald Raygun
  • Joined Jul 2007 | Status: 32 y/o Investor/Trader/Programmer | 5,016 Posts
Make sure you download the latest version.

Then make sure you load data into the strategy tester.

Then make sure that it actually can be backtested.

Use one of the sample EAs to try and run backtests.
 
 
  • Post #15
  • Quote
  • Apr 29, 2010 12:26am Apr 29, 2010 12:26am
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Quoting Ronald Raygun
Disliked
Make sure you download the latest version.

Then make sure you load data into the strategy tester.

Then make sure that it actually can be backtested.

Use one of the sample EAs to try and run backtests.
Ignored
Hmm ... I thought it updates automatically... upon checking it looks like I do have an older version

Will do

Thanks RR
 
 
  • Post #16
  • Quote
  • Apr 29, 2010 7:14am Apr 29, 2010 7:14am
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,636 Posts
hey mo..... sorry, my error....... somehow i was thinking you were using mq4..... if so, all my comments above might be incorrect..... this of course includes my post on arrays......

//----

so it's a neural network using multi-demensional arrays in mq5 ........ ..... you are definitely living up to the username moforce....... kinda wish i was that ambitious..... h
to trade and code, keep both simple... no call to impress....h
 
 
  • Post #17
  • Quote
  • May 1, 2010 12:23am May 1, 2010 12:23am
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Quoting hayseed
Disliked
hey mo..... sorry, my error....... somehow i was thinking you were using mq4..... if so, all my comments above might be incorrect..... this of course includes my post on arrays......

//----

so it's a neural network using multi-demensional arrays in mq5 ........ ..... you are definitely living up to the username moforce....... kinda wish i was that ambitious..... h
Ignored
lol it's cool... I was actually pretty much referring to both and it looks like MQL5 better supports what I'm up to so that's why I mentioned it. Only thing is it takes the EA I made FOREVER to process the history data in order for it to actually run lol.

And a lot of the projects I start up end up being useless in the end so don't feel bad I wish I didn't waste so much time on these things lol

btw so I'm wondering... if I have a loop like this

PHP Code
 int OnInit()
{
for(
i=Bars(NULL,0)-1;i<=1;i--)
{...
code...}
} 
which takes an hour to get through, does the EA ever get caught up to speed? (as in, does whatever new bars within that hour of calculation get factored in too? Or do they get skipped - in which case I'd have to add a timestamp to get the gaps filled x.x)

If the new bars that occur within the hour of processing time... I might be better off using it on a higher TF
 
 
  • Post #18
  • Quote
  • Last Post: Sep 21, 2010 7:02pm Sep 21, 2010 7:02pm
  •  MoForce
  • | Joined Jul 2007 | Status: BIG PIPIN' | 615 Posts
Quoting MoForce
Disliked
and just for kicks... I did a 3D version of a portion of the network (just a portion so it renders quickly)
Ignored
I saw an image of Brownian motion... http://upload.wikimedia.org/wikipedi...process_3d.png

it reminded me of this
 
 
  • Platform Tech
  • /
  • Dynamic Multidimensional Arrays
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023