Download MetaTrader 5

Open an order

To add comments, please log in or register
18081961
682
18081961  

Hi to all,

 

Could you show me how to open an order in this situation;

After Bid passes up a line (could be a line from an indicator) and when Bid backs down from that line an order should be open. 

 Thank you in advance

Luis 

Alain Verleyen
Moderator
35109
Alain Verleyen  
Click on the "New order" button.
Osama Shaban
1584
Osama Shaban  

It depends on many concepts that you are thinking of ... but this is one of them ...

if(Open[1]>Indicator_variable && Close[1]<Indicator_variable)
   OpenBuy();

if(Open[1]<Indicator_variable && Close[1]>Indicator_variable)
   OpenSell();

 This is just if price of last bar opened in one side of the Indicator line and closed in the other side ...

So, logically you should write the right code that fits your idea.

Good luck ... 

To add comments, please log in or register