mql4 developers I need your help please!

 

Hello mql4 developers,


I need a very simple script that will open a buy and a sell order AT THE SAME time at market prices. Lot size, take profit and stop loss values should be parameters in the script. MetaTrader platform offers a buy script but I need to open a BUY and a SELL order at the same time due to my hedging trading strategy. To be more specific:

1) The script can be executed on any currency pairs.

2) The script should include 3 parameters:

a) Lot size (default=0.10)

b) Take Profit in pips (default = 10)

c) Stop Loss in pips (default=110)

3) Script should open the orders at current market prices. (current bid price for sell order and current ask price for buy order)

4) Script should open the buy and sell orders at the same time using the same lot, take profit and stop loss values.


Right now, I am opening these orders manually and utilize price fluctuations in my manual trades. So far so good. I would like to speed up the process by being able to open these orders just by executing the script.

I am not a developer, and I do not understand from mql4. Any help is greatly appreciated. Please send an e-mail to yalcinterlemez at yahoo dot com if you have any questions or need more info.


Thanks in advance,


Cheers!

Yarizona

 
#include <stdlib.mqh>
#include <WinUser32.mqh>
#property show_inputs
extern double Lots=0.1;
extern int SL=10;
extern int TP=10;
//+------------------------------------------------------------------+
//| script "trading for all money" |
//+------------------------------------------------------------------+
int start()

{
//----



{
  int ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-SL*Point,Ask+TP*Point,"",255,0,CLR_NONE);
  if(ticket<0)
  {
   int error=GetLastError();
   Print("Error = ",ErrorDescription(error));
   return;
  }
  int ticket1=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+SL*Point,Bid-TP*Point,"expert comment",255,0,CLR_NONE);
  if(ticket1<0)
  {
   error=GetLastError();
   Print("Error = ",ErrorDescription(error));
   return;
  }
}
//----
OrderPrint();
return(0);
}
 

hi pls show me how to place this script in my system