Download MetaTrader 5

Is it possibly to create just an exit rule for robot (semi-robot) ?

To add comments, please log in or register
c.robredo
26
c.robredo  

Is it possibly, that I decide when to buy, and the robot would finish the rest of trade ?

If it can be possible, Is there an special function to do this interaction between me and the robot, to don`t create any kind on conflict ?

 

Thank you so much 

Ronnie Mansolillo
5722
Ronnie Mansolillo  
c.robredo:

Is it possibly, that I decide when to buy, and the robot would finish the rest of trade ?

If it can be possible, Is there an special function to do this interaction between me and the robot, to don`t create any kind on conflict ?

 

Thank you so much 

Hi Robredo, for sure is possible. You may need an EA so after you place the order the EA can do what you need.

For example can place the stop loss, can move with a trailing stop or close the order based on an indicator or take profit. Maybe you just need to hire a coder to create your EA.

Suraj Neupane
199
Suraj Neupane  

If you are a coder than  

  1. Select order : OrderSelect()  
  2. Loop order by OrdersTotal() (gives all order) and select specific order.
  3. Close that order by OrderClose().

Mohammad Soubra
32593
Mohammad Soubra  

 To complete what Suraj said above

 

always use this loop in order to select orders and do what you want on them: 

     for (int cnt = 0; cnt < OrdersTotal(); cnt++)
     {
        int ticket_select = OrderSelect (cnt, SELECT_BY_POS, MODE_TRADES);
        
        if ( OrderType() <= OP_SELL
        &&   OrderSymbol() == Symbol() 
        &&   OrderMagicNumber() == magic_number) //optional
        {

//conditions and modifications

	}
}
Atsushi Yamanaka
5581
Atsushi Yamanaka  
Mohammad Soubra:

 To complete what Suraj said above

 

always use this loop in order to select orders and do what you want on them: 

To complete...

 for (int cnt = OrdersTotal()-1; cnt >= 0 ; cnt--)
     {
        int ticket_select = OrderSelect (cnt, SELECT_BY_POS, MODE_TRADES);
        
        if ( OrderType() <= OP_SELL
        &&   OrderSymbol() == Symbol() )
        //&&   OrderMagicNumber() == magic_number) //optional only when your entry was using a script to give them the magic_number.
        {

//conditions and modifications now include OrderClose

        }
}

 always use this Decrement loop in order to select orders and to close them: 

Roberto Jacobs
48873
Roberto Jacobs  
Atsushi Yamanaka:

To complete...

 always use this Decrement loop in order to select orders and to close them: 

good..!
Billy Angdijaya
10259
Billy Angdijaya  

hi robredo,


do you mean you want to open trade at a time you define?

yes, you can do it. just need some code.

To add comments, please log in or register