Download MetaTrader 5

Open an order

To add comments, please log in or register
18081961
682
18081961 2015.06.09 17:35 

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
31085
Alain Verleyen 2015.06.09 18:37  
Click on the "New order" button.
Osama Shaban
1463
Osama Shaban 2015.06.09 18:56  

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