Errors, bugs, questions - page 1521
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
At the same time, the IsStopped function's help says that the program operation is forcibly terminated after 3 seconds if there is a command to terminate the mql-program.
And if while(true) is replaced with while(!IsStopped()), the indicator completes successfully when removed from the chart.
Everything is clear. We have made an indulgence for the normal deletion.
When the terminal closes, it will be hard. Not more than 3 seconds.
And I'm not sure we will write this in the documentation, 1. so as not to indulge in writing such reckless indicators (did you write this to check?) 2. As loosened up, so tightened up.
A funny cause of the Internal Compiler Error ( function used in the indicator):
...The cure is obvious, but agree - very funny glitch. :)))
Wrote you a private message.
Dmitri Custurov:
Здравствуйте. Не получается написать код, который открывал бы позицию через n-количество баров после открытия предыдущей позиции. Пробовал использовать Time[i], iBarShift, iTime. Все безуспешно. В программировании новичок. Поиск ничего не дал.
Here is the code:
if ((OrderSelect(0,SELECT_BY_POS,MODE_TRADES)==False)&&(Signal==1))Timer=Time[0];}
TimerNull=iBarShift(NULL,0,Timer,false);
if ((TimerNull>=n)&&(z==1))
{int send2=OrderSend(Symbol(), OP_SELL, Volume_, Bid, 0, 0, 0, NULL, 2, 0, Red);
z=2;}
I also tried this way:
Timer=Time[0];}
TimerNull=Time[0];
if ((TimerNull>=(Timer+2700))&&(z==1)) //as an example here I put 2700 seconds instead of n, which in testing meant 3 15-minute candles) {int send2=OrderSend(Symbol(), OP_SELL, Volume_, Bid, 0, 0, 0, NULL, 2, 0, Red);
z=2;}
And also like this:
Timer=Time[0];}
TimerNull=Time[0];
if ((CurrentTime()>=(Timer+2700))&&(z==1))
{int send2=OrderSend(Symbol(), OP_SELL, Volume_, Bid, 0, 0, 0, NULL, 2, 0, Red); //In this case when I removed 2700 the second trade was opened right after the first one in the same bar, it makes sense. And even when I put any value up to 600 instead of 2700, the second deal was opened in the same bar. With a value higher than 600 the second trade never opened. I cannot understand what the problem is. I would be very grateful to you for your help.
The Timer and TimerNull parameters are in datetime format.
in your example there is no enumeration of e.g. positions
if ((OrderSelect(0,SELECT_BY_POS,MODE_TRADES)==False)&&(Signal==1))
therefore it always selects position 0.
It all makes sense. Made an indulgence for normal deletion.
When you close the terminal, it will be hard. No more than 3 seconds.
And I'm not sure we will write this in the documentation, 1. so as not to indulge in writing such reckless indicators (did you write this to check?) 2. As loosened up, so tighten it up.
So tighten it up already, or fix the reference. Indulging not indulging is not a serious conversation. What programmers expect from you is not "coddling", but clear, well-documented software.
Of course this code has no purpose other than a demonstration, which you yourself have asked for. And it's quite harmless, harmless to get it, if you remove Sleep and replace Comment with Print. There is no protection against spamming gigabytes of Print into the log in either Quartet or Quartet 5.
Here is the code:
if ((OrderSelect(0,SELECT_BY_POS,MODE_TRADES)==False)&&(Signal==1))Timer=Time[0];}
TimerNull=iBarShift(NULL,0,Timer,false);
if ((TimerNull>=n)&&(z==1))
{int send2=OrderSend(Symbol(), OP_SELL, Volume_, Bid, 0, 0, 0, NULL, 2, 0, Red);
z=2;}
I also tried this way:
Timer=Time[0];}
TimerNull=Time[0];
if ((TimerNull>=(Timer+2700))&&(z==1)) //as an example here I put 2700 seconds instead of n, which in testing meant 3 15-minute candles) {int send2=OrderSend(Symbol(), OP_SELL, Volume_, Bid, 0, 0, 0, NULL, 2, 0, Red);
z=2;}
And also like this:
Timer=Time[0];}
TimerNull=Time[0];
if ((CurrentTime()>=(Timer+2700))&&(z==1))
{int send2=OrderSend(Symbol(), OP_SELL, Volume_, Bid, 0, 0, 0, NULL, 2, 0, Red); //In this case when I removed 2700 the second trade was opened right after the first one in the same bar, it makes sense. And even when I put any value up to 600 instead of 2700, the second deal was opened in the same bar. With a value higher than 600 the second trade never opened. I cannot understand what the problem is. I would be very grateful to you for your help.
The Timer and TimerNull parameters are in datetime format.
This is one of the possible implementations. This EA should open an order after the specified number of bars. And learn how to insert EA code correctly, the SRC button on the message bar.
111
The question is probably for the website developers or the Freelance service administrators
---
Used to be: 568 jobs completed, 75% personal
Added 13 jobs (all personal) and became: completed 581, 75% personal
---
Therefore the question: decipher please, what does 75% mean ?