Download MetaTrader 5

Can I include multiple currencies in a single EA?

To add comments, please log in or register
How to test a program before buying?
Kevin Kim
35
Kevin Kim 2016.04.18 14:05 

i apologize in advance as I'm sure there were questions similar to this like thousands of times

 but currently, I'm in the process of developing a single EA with multiple currencies including OrderSend and OrderClose functions for several currencies so that the EA can screen currencies simultaneously and trade appropriately

 (as it is that my strategy relies on hedging)

 

So, my question is, if I were to develop a single EA with multiple currencies, and apply it to all the applicable currencies individually, then would it work?

 if not, how would I go about achieving this? 

Marco vd Heijden
Moderator
4685
Marco vd Heijden 2016.04.18 14:08  
Yes.
Osama Shaban
1447
Osama Shaban 2016.04.19 00:13  

Yes, you can ...

You almost need to use MarketInfo( ) function to get price of Ask and Bid.  

Kevin Kim
35
Kevin Kim 2016.04.19 02:48  
Osama Shaban:

Yes, you can ...

You almost need to use MarketInfo( ) function to get price of Ask and Bid.  

yeah, I did include MarketInfo() for all applicable currencies including spread and point ...etc 

 

I understand how OrderSend() works very well but as for OrderClose() function, how is it possible to obtain the ticket number?

 

like would it be okay if, in the ticket number section, I just put the entire OrderSend("XYZ",1,Ask,2,Bid-15*Point,Bid+15*Point) ?  

Daniela Bluemel
586
Daniela Bluemel 2016.04.19 07:19  
i think you can loop through them with orderselect by pos and then check the currency pair before you check the ticket number
To add comments, please log in or register