Close and open a new order

 

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.

 
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.
 
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?
 
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?
Reason: