StarBuck99: I need some help, since I keep getting the "array out of range" error.
Of course, you do. Your arrays have no size.
ArrayResize(sum.Magic00SLBuyticket,0); ArrayResize (sum.Magic00Alltickets,0); int countM0Buy = 0; int count00All = 0; ⋮ if (Profit>0) {sum.Magic00SLBuyticket[countM0Buy] = ticket;countM0Buy +=1;} sum.Magic00Alltickets[count00All] = ticket; count00All+=1;
Where do you resize those arrays before storing?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have the following code...
From the Main Program I am trying to call a function which would populate variable and arrays which I can use later in order to close specific orders.
I need some help, since I keep getting the "array out of range" error.
My purpose is to go once through all the Opentrades.. and populate the necessary variables once.
I would also like to know, if I need to use the elements in the arrays... how do I pass them to a function in order to either put stoplosses using the stored ticket numbers or close all trades using the stored ticket numbers in the arrays.
Any help is greatly appreciated.
Sample CODE BELOW;