What causes stack overflow error in mql4? Im suspecting using a function to create objects. Below is the function that has been called over a hundred times to create objects.
Below is one usage example
Ive created other same number of objects the normal way without getting this error but when i introduced and used this function to create the remaining objects is when the error popped out. See the sample below that doesnt introduce the error even though its more labour intensive for the number of objects.
One more thing, the values for OBJPROP_XDISTANCE and OBJPROP_YDISTANCE are supposed to int not double.
I've never had a stack overflow, from what I have read they are often caused by recursion but I don't see that in the code you have posted . . . why is your function type int ? what is the point in passing the variable double zoom when you don't use it ?
One more thing, the values for OBJPROP_XDISTANCE and OBJPROP_YDISTANCE are supposed to int not double.
Thats what puzzles me.
I've never had a stack overflow, from what I have read they are often caused by recursion but I don't see that in the code you have posted . . . why is your function type int ? what is the point in passing the variable double zoom when you don't use it ?
One more thing, the values for OBJPROP_XDISTANCE and OBJPROP_YDISTANCE are supposed to int not double.
I did some find and replace and im yet to correct the lower part of the indicator.
I've never had a stack overflow, from what I have read they are often caused by recursion but I don't see that in the code you have posted . . . why is your function type int ? what is the point in passing the variable double zoom when you don't use it ?
One more thing, the values for OBJPROP_XDISTANCE and OBJPROP_YDISTANCE are supposed to int not double.
Man please read more book on ObjectSet(). Wait let me help. Below is an excerpt.
bool ObjectSet( string name, int index, double value)
I'll see your quote and raise you with this . . .
OBJPROP_XDISTANCE | 102 | int | Integer value to set/get anchor X distance object property in pixels. |
OBJPROP_YDISTANCE | 103 | int | Integer value is to set/get anchor Y distance object property in pixels. |
would you use a double for these ?
OBJPROP_BACK | 9 | bool | Boolean value to set/get background drawing flag for object. |
OBJPROP_RAY | 10 | bool | Boolean value to set/get ray flag of object. |
OBJPROP_ELLIPSE | 11 | bool | Boolean value to set/get ellipse flag for fibo arcs. |
tonny: I really got lost in what you expected. I never got the "stack overflow" error during compilation either. Could you give us exact guidelines how we should reproduce the issue?
I'll see your quote and raise you with this . . .
would you use a double for these ?
In what im doing it makes no difference there is more to it than the little ive posted here.
If you don't want to post all the code, so that the error can be reproduced, please code something that you can post in full that will reproduce the same error.
I did an experiment and replaced some of this kind of objects
ObjectCreate("EURUSD", OBJ_LABEL, 0, 0, 0); // Creating obj. ObjectSet("EURUSD", OBJPROP_CORNER, 0); // Reference corner ObjectSet("EURUSD", OBJPROP_XDISTANCE, Column1x*ZoomTimes);// X coordinate ObjectSet("EURUSD", OBJPROP_YDISTANCE, ZoomTimes*15);// Y coordinate
And used function style like below and the error went away. Its like the IDE can take fewer of the above than of the below. Ill try replacing all of the above style with the below style and see if something else might pop up.
ObCreate("EURUSD",Column1x,15,ZoomTimes);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
What causes stack overflow error in mql4 during compiling? Im suspecting using a function to create objects. Below is the function that has been called over a hundred times to create objects.
Below is one usage example
Ive created other same number of objects the normal way without getting this error but when i introduced and used this function to create the remaining objects is when the error popped out. See the sample below that doesnt introduce the error even though its more labour intensive for the number of objects.