Download MetaTrader 5

Close and open a new order

To add comments, please log in or register
domdix27
13
domdix27  

Hi, I want to do a bot that will do these steps :

When i open an order ( for example in long position) and the price reaches a X number of  pips close in "take profit".

But if the price go down of X number of pips open a new order in sell.

How can do it? Thanks and sorry for my bad english.


P.S : I'm newbie in mql4, but i have experiences with other programming languages.

whroeder1
15086
whroeder1  
domdix27: , I want to do a bot
You have only four choices: We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using SRC) and the nature of your problem.
domdix27
13
domdix27  
whroeder1:
You have only four choices: We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using SRC) and the nature of your problem.

Ok thanks, so if i do  a code and i post it here you will say to me what i do wrong, true?
domdix27
13
domdix27  
int Order;

void OnStart()

  {


   Order = OrderSend("EURUSD", OP_BUY, 1.0, Ask, 10,);// I copy this.. can you explain me what I should put here?
   
   if(....)//How I can make a condition that when the price increase for example 30 pips the "bot" should close the order in profit?
   {
     OrderClose(Order, 1.0, Bid, 10);
   }
   else
   {

   
   }
Any help please?
To add comments, please log in or register