i need to break my code ... and for this i have to use another function than OnStart.
could i use as input for the function these kind of arrays?
...and how ?
note: these matrixes are loaded during OnStart computations.
I believe you could just define your function as:
void ProcessArray(<type> &arr[])
for one dimensional arrays... as for multi-dimensional ones, I don't know...
A quick and dirty way is to move the declaration of all these arrays to global - that way, you need not pass them as function parameters.
struct currency { double a, b, c, d, e[]; } gbp1[10], gbp2[], aud1[10], aud2[], eur1[10], eur2[], csd1[10], cad2[];
Structures are easier to use
CB:
could i use as input for the function these kind of arrays?
note: these matrixes are loaded during OnStart computations.- Perhaps you should read the manual.
Note: Arrays and variables of complex types can't act as input variables.
Language Basics / Variables / Input Variables - Reference on algorithmic/automated trading language for MetaTrader 5 - I agree, Structures are easier to use. Keep the double and the string together.
- Either initialize them with constants or read in a file
can i declare multiple types in the struct in mql4 ? in C++ i know i can...
this was my initial hunch as well... I will have to work hard to test it.
appreciated !
Structures, Classes and Interfaces - Data Types - Language Basics - MQL4 Reference
You can state how much you need. And what you need.
thank you Konstantin !
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
dear friends,
i need to break my code ... and for this i have to use another function than OnStart.
could i use as input for the function these kind of arrays?
double AUD1[10][4], AUD2[10][4], CAD1[10][4], CAD2[10][4], CHF1[10][4], CHF2[10][4], EUR1[10][4], EUR2[10][4], GBP1[10][4], GBP2[10][4], NZD1[10][4], NZD2[10][4], USD1[10][4], USD2[10][4], JPY2[10][4], XAU1[10][4],
string AUD1S[], AUD2S[], CAD1S[], CAD2S[], CHF1S[], CHF2S[], EUR1S[], EUR2S[], GBP1S[], GBP2S[], NZD1S[], NZD2S[], USD1S[], USD2S[], JPY2S[], XAU1S[];
AUD1[][4], AUD2[][], CAD1[][], CAD2[][], CHF1[][], CHF2[][], EUR1[][], EUR2[][], GBP1[][], GBP2[][], NZD1[][], NZD2[][], USD1[][], USD2[][], JPY2[][], XAU1[][], AUD1S[], AUD2S[], CAD1S[], CAD2S[], CHF1S[], CHF2S[], EUR1S[], EUR2S[], GBP1S[], GBP2S[], NZD1S[], NZD2S[], USD1S[], USD2S[], JPY2S[], XAU1S[], AUD1S[], AUD2S[], CAD1S[], CAD2S[], CHF1S[], CHF2S[], EUR1S[], EUR2S[], GBP1S[], GBP2S[], NZD1S[], NZD2S[], USD1S[], USD2S[], JPY2S[], XAU1S[];
...and how ?
note: these matrixes are loaded during OnStart computations.
very much appreciated !!