Hi folks, I need a function that will stop trading after 1 trade, for expert adviser…
So, once trade is made by my perimeters, it will just stop trading till i reset the perimeters.
How would I go about this?
Thanks
Hi folks, I need a function that will stop trading after 1 trade, for expert adviser…
So, once trade is made by my perimeters, it will just stop trading till i reset the perimeters.
How would I go about this?
Thanks
Just look at the trade history records for any trades within the last xx hours.
thanks for the reply CodeMeister, but i have no idea what that means.
I need a code to insert in my EA to stop trading after 1 trade.
OrderSelect()?
Then play around with OrderCloseTime().
I used to have some code that did this, but I can’t seem to locate it. A description is all I can offer.
It’s not that difficult. Just create a boolean which controls the state of the EA. If OrdersClosed >= 1, then false. You can find OrdersClosed using the functions I posted above. You can have the EA Alert or SendMail to notify you when the state is false, and you can reset the EA manually. If you wanted to go more advanced you can automate that process as well. Just requires some extra coding.
Thanks Clark, And thanks again CodeMeister, I will give this a try a bit later, busy busy…
Great pips to you both!!
Hi MoneyNVRSleeps,
I found the book “Expert Advisor Programming” by Andrew R Young to be excellent, as it has enabled me to write my own EA’s. All the code in the book is also down loadable from their website. I got mine from Amazon for about £17.00.
There are lots of examples in the book on order control with all the code, including complete systems.
Cheaper than your next trading loss.
I believe you will always want to make small changes or understand how your EA works, so in the end you need to rely upon yourself and this is a good place to start.
I have no financial interests in this book, but it worked for me and the author did answer a personnel email when I had a problem.
Regards, Trader009.