Download MetaTrader 5
To add comments, please log in or register
Publish your article and win recognition from thousands of traders!
needamedic
34
needamedic 2014.03.25 14:59 

Hi everybody,
I am looking for a script to enter a limit order in opposite directions right after I open a position or ea to reverse position right after the sl has been reached. Basically what I want it to do is:
long x/y pair at 1.0000 with a sl at 0.9970 and tp at 1.0030. If the sl is triggered then the ea will open a new position but in the opposite direction.
size of orders, tp and sl should be adjustable.

if you have such EA/scrpit, please post here. thanks a lot!

needamedic
34
needamedic 2014.03.26 11:57  
any body?
qjol
3243
qjol 2014.03.26 13:48  
show your code and someone will assist you
if you don't have code at all
i'll be the first assistant
//+------------------------------------------------------------------+
//|                                                         Temp.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   EventSetTimer(60);
      
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();
      
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Tester function                                                  |
//+------------------------------------------------------------------+
double OnTester()
  {
//---
   double ret=0.0;
//---

//---
   return(ret);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   
  }
//+------------------------------------------------------------------+
/
To add comments, please log in or register