Hi Adele
Without seeing those 2 functions this has to be a guess, but try removing the quotes from the function call parameter:
Cheers
Cheers
Stu
You're very welcome :)
If you want to give it a go yourself (which I think is fantastic!) using the same logic that's in there, all you really need to do is create one function to close everything. So you could try something like this. Remove those CloseAllBuy() & CloseAllSell() calls and replace it with CloseAllOrders(). Then create that Function like this:
void CloseAllOrders() { for (int i = OrdersTotal(); i >=0; i--) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); // Add logic here for closing orders } }
I've left the logic blank so you can have a crack at it. Let me know if you're still struggling with it, post up your code for that function and we'll walk you through it :)
Cheers
You're very welcome :)
If you want to give it a go yourself (which I think is fantastic!) using the same logic that's in there, all you really need to do is create one function to close everything. So you could try something like this. Remove those CloseAllBuy() & CloseAllSell() calls and replace it with CloseAllOrders(). Then create that Function like this:
I've left the logic blank so you can have a crack at it. Let me know if you're still struggling with it, post up your code for that function and we'll walk you through it :)
Cheers
Ok thanks! I am going to get some sleep now as I've been starring t the screen way too long. I will have a look at that tomorrow afternoon though and let you know how I get on!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, in my last post I asked how to change barcount in my ea code to something more reliable but was told that the barcount was fine in my code.. So I'm going to leave that now. I now have an issue with this code though. It is great and works perfectly to choose when to start and end the trading week, however the lines that say CloseAllBuy(""); and CloseAllSell(""); show up as errors when compiling so I can't get the function to work where I can choose to close all open trades at a certain time. What do I need to change to lose these errors and to make the code work for this? Thank you!