![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Thank you, abolk, for the clarification.
It looks like several functions need to be combined into one. The logic is the same everywhere
-Good afternoon.
In our old Expert Advisor we used this opening of positions (I. Kim's function):
Now I'm writing another EA and I'm copying this bit of code
and suddenly I get the following message when I try to compile it
I cannot figure out why I get errors! The code is strictly balanced.
What's more! When I remove the parameter ti(which is declared in global variables), the compilation errors disappear:
But I need exactly with a ticket (ti), in order to realize MessageBox's execution afterwards.
I cannot figure it out since this morning. Please advise where it is inaccurate?
Why all of a sudden I get errors when adding ti= before OpenPosition( - why?
OpenPosition() must be declared as void and should be int.
int OpenPosition(....){ .... }
Thank you, Integer!
Yes, - that's exactly what happened! Now I've corrected it and it all compiled properly!
Afternoon.
The EA suddenly started to print on every tick for no apparent reason:
2012.01.11 22:28:19 Complex_Common_01mod EURCHF,H1: unknown subwindow number -1 for ObjectCreate function
I am calling the custom indicator in the code (see fig.):
Could you please tell me where the error is coming from? It wasn't there before. I have changed the code a bit, without even touching the indicator part!
And the journal on every tick started giving me this message...
ObjectCreate function - do not use in code at all
Thank you, Integer!
Yes, - that's exactly what happened! Now I've corrected it and it all compiled properly!
Indicator searches for its window name and doesn't find it. seehttps://docs.mql4.com/ru/customind/IndicatorShortName
So it turns out that this is a defect of the indicator? And not a glitch in the Expert Advisor? I am not sure what to do with it? I don't require in the code of the EA to call the window of this indicator!
Please advise how to fix this defect, if possible. (- unknown subwindow number -1 for ObjectCreate function ) ?
Here is indicator code:
Don't tie the window name to the object name, just name the objects with unique names.
Thank you, I think I got it - I'll try naming and finding the window now.