Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1076
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
Hello. Can you help me if you have time Question is this, I need the EA to open an order on each signal of two indicators, (they give a signal when they are in certain combination) in a word, there should be several orders to buy or to sell in the market, accordingly, according to the signals of the indicators. But I have only one order in the market and until it closes the next one does not open...... Is it a matter of counting orders? Please give me a hint. If you need it, i can send you the code.
Thanks in advance!
remove "if (OrdersTotal()==0)...." condition. - They just say: search for entries and open new orders only when there are no orders at all.
If you do not want to open a big pack of new orders without such a condition, you need to create an additional condition. And this depends on your strategy: not to open a new one within time T of the previous one, or to control the bars or to keep distances in pips between orders...
Hello. I will start by saying thank you very much for helping newbies. I wouldn't be able to answer elementary questions for myself day after day to one newbie and then another.
And the question is this:
I thought before, when mql4 was a bit different, that any order processing, like opening/closing/modifying after possible error should be interrupted by return(0) function. Because of that, if I had to close several open orders at the current price, the tester would close them one by one on every new bar and that would probably distort the real picture (quite dramatically, sometimes) in the tester (for every tick of a frame). The new EA has to close several orders exactly by the signal and partially.
Question: Is it possible to process all of them (close them partially) in a loop, without interrupting the loop each time? Will the tester be able to handle it? I.e., will it be able to partially close all of them on one bar?
Hello. I will start by saying thank you very much for helping newbies. I wouldn't be able to answer elementary questions for myself day after day to one newbie and then another.
And the question is this:
I thought before, when mql4 was a bit different, that any order processing, like opening/closing/modifying after possible error should be interrupted by return(0) function. Because of that, if I had to close several open orders at the current price, the tester would close them one by one on every new bar and that would probably distort the real picture (quite dramatically, sometimes) in the tester (for every tick of a frame). The new EA has to close several orders exactly by the signal and partially.
Question: Is it possible to process all of them (close them partially) in a loop, without interrupting the loop each time? Will the tester be able to handle it? I.e., will it be able to partially close all of them on one bar?
It can do it without any problems on one small condition. The code must be written correctly.
If there are 2 functions (possibly overloaded), for example, int Funkz(int a) int Funkz(int a, int b, int w), and then the program is compiled, which function will work faster, the first considering that it has one argument or it does not matter, because the program is already built and what is described in the body, or all the same there is a small effect, because the function arguments represent a stack for which the memory is reserved?
If you have two functions of the same name with different number of arguments, it's not a question of which one will be called faster. When you call a function, you don't write Funkz(), you specify the number of arguments.
The question is whether the compiler will chew up functions with the same name.
As I understand it, we are not talking about the code, but about the compiled file?
If you have two functions of the same name with different number of arguments, it's not a question of which one will be called faster. When you call a function, you don't write Funkz(), you specify the number of arguments.
The question is whether the compiler will chew up functions with the same name.
You mean the compiled file, not the code?
And if the functions are different, then which one will work faster with fewer or more arguments? I think overloading with different numbers also carries a load or is it just for convenience?
Please tell me how to write #define ?
I write it like this
#define my_POS cst_Position.my_Position
If I change this construction to def - everything works.
But when I just write my_POS., the function list won't pop up after a dot.
Same for
#define pos_DATA cst_Position.getPositionData
there are no hints after the pos_DATA(.
What am I doing wrong?
Hello, dear experts!
Please help me to solve this problem.
When testing any pair, everything works properly, but when working with other currencies, the pending orders are not placed (I have to expose the pending order) and are not closed after take profit triggering.
Please advise how to change the code, if possible:
Thank you very much in advance
Hello, dear experts!
Please help me to solve this problem.
...Please insert the code correctly: