How can i automaticly repeat the task of my EA when it's done can you help please thanks. - page 2
![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
it is not working !!
Exactly.
I removed the Count variable after i tried it without doing Count==1 but just Count and still does not repeat the task it does it once a nothing after that i dont understand what is the problem if i got the function OnClick() why it does not repeat the task ????
There may be a problem with your platform and it will not work, but your EA does not make sense anyway. With the Count variable what you are doing is counting ticks, and all other functions are only executed on the first tick.
To know if the EA is running and you have a connection to the broker you can add the following line:
If in the Experts tab, in the Terminal window, you will see messages like the ones I show you in the image, then the EA is working and receiving ticks. If so, the problem lies in the logic of your EA.
Greetings.
There may be a problem with your platform and it will not work, but your EA does not make sense anyway. With the Count variable what you are doing is counting ticks, and all other functions are only executed on the first tick.
To know if the EA is running and you have a connection to the broker you can add the following line:
If in the Experts tab, in the Terminal window, you will see messages like the ones I show you in the image, then the EA is working and receiving ticks. If so, the problem lies in the logic of your EA.
Greetings.
I added the small code that you send me to my source and it did not do the count like you send me in th picture here what i got from the code :
Below is my source code when the task is done i want it to be repeated automaticly i cant find the way to do it any help will be apreciated.
Maybe try using OnTimer instead of OnTick and set it to repeat at some interval in OnInit
Maybe try using OnTimer instead of OnTick and set it to repeat at some interval in OnInit
I will try that thanks.
I will try that thanks.
Are you going to add OnInit() to your code ?
I added the small code that you send me to my source and it did not do the count like you send me in th picture here what i got from the code :
Have you kept the command Count ++ ??
Have you tried other EAs on that platform ??
Have you tried your EA on other platforms ??
Could you try this EA and see what messages appear on the Experts tab ??
Have you kept the command Count ++ ??
Have you tried other EAs on that platform ??
Have you tried your EA on other platforms ??
Could you try this EA and see what messages appear on the Experts tab ??
when i try your code the first time it did not worked the command Count++ was there.
i never try ther EA on the platform.
i never try My EA on other platform
here what i got from your code it worked fine :
well it will only work once when there are no more orders because:
TotalNumberOfOrders=OrdersTotal();
well it will only work once when there are no more orders because:
Ok i went step by step with my source code and i realise that the while(true) is the reason why the EA does not repeat the task so i replace it with while(ticket1==true && ticket2==true) but now it send orders NON STOP i can close all orderS and it start by itself on every tick so now i need to find a way so it send the order ONLY ONCE instead of sending an order on each tick.