MQL4 - automated forex trading   /  

Forum

How to place (and close correctly) multiple orders on one EA

Back to topics list To post a new topic, please log in or register

avatar
4
samson 2006.07.14 08:39 
Hello moderators and friends,

I posted a question under this heading, but it might have been overlooked, (since the original author had their part answered) so I'm reposting it as a new subject.

How can I write an EA to open multiple orders and close them independantly. Ex: go in on a buy, then a buy if conditions are met again, and then a sell. If you can't explain it in detail in english, (explaining things like "flag") then could you do an example with a basic Moving Average EA? I'm sorry, but I couldn't understand the answer given in the other topic.

thanks!
Samson
Poll: Traders’ Estimate of the Mobile Terminal

Poll: Traders’ Estimate of the Mobile Terminal

Unfortunately, there are no clear projections available at this moment about the future of the mobile trading. However, there are a lot of speculations surrounding this matter. In our attempt to resolve this ambiguity we decided to conduct a survey among traders to find out their opinion about our mobile terminals. Through the efforts of this survey, we have managed to established a clear picture of what our clients currently think about the product as well as their requests and wishes in future developments of our mobile terminals.


avatar
Moderator
2824
Tatyana 2006.07.14 18:09 
You can use the Trading functions for this.

And you have to use magic numbers to open multiple orders.

Also try to refer to 'How to place (and close correctly) multiple orders in an EA'


avatar
4
samson 2006.07.15 23:30 
I'm sorry. The site you refered to is the one that I already posted the question but people might have overlooked. As I said in that original post, I am not getting it, and would appreciate more details like:

1) Do I have to change "CalculateCurrentOrders" function from basic Moving Average program? How?
2) Do I just add another "OrderSend" in my open and close section with a different magic number?
3) I'm still confused how the Start function part is supposed to look exactly.

If someone doesn't want to answer these questions than could you just post an example with the Moving Average EA?

thanks!
Samson

avatar
4
lmazon 2006.07.19 20:02 
Opening and closing multiple orders on one EA is not as cut and dry as you might like, and there are considerations. For instance, an EA attached to a particular chart can only access data from that chart. Unless you're doing inverse/parallel pair stuff, you probably won't get exactly what you're hoping for using this method. Further, there is a strictly enforced 10 second delay between order functions. For instance, if you open a ticket, you cannot open another ticket for 10 seconds. Some things for you to think about anyway...

Lance...

Back to topics list  

To add comments, please log in or register