Download MetaTrader 5
To add comments, please log in or register
Register as a seller and start offering your signals!
suoxinyang
72
suoxinyang 2013.04.02 10:47 
Sometimes,The following code Expert advisors  to open new positions automatically After close out  position,We look at what is the problem?
//+------------------------------------------------------------------+
//|                                                            1.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"

#include <Trade\Trade.mqh>

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---   
       
                    CTrade trade;
                    trade.PositionClose(_Symbol,3);            
                          
  }
//+------------------------------------------------------------------+
//| Trade function                                                   |
//+------------------------------------------------------------------+
void OnTrade()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Tester function                                                  |
//+------------------------------------------------------------------+
double OnTester()
  {
//---
   double ret=0.0;
//---

//---
   return(ret);
  }
//+------------------------------------------------------------------+

Simon Gniadkowski
Moderator
17994
Simon Gniadkowski 2013.04.02 10:51  
suoxinyang:
Sometimes,The following code Expert advisors  to open new positions automatically After close out  position,We look at what is the problem?
How do I replicate this behaviour ?
suoxinyang
72
suoxinyang 2013.04.02 11:00  
suoxinyang:
Sometimes,The following code Expert advisors  to open new positions automatically After close out  position,We look at what is the problem?

Problem in Figure

 

 

Do you find? 

suoxinyang
72
suoxinyang 2013.04.02 11:02  
RaptorUK:
How do I replicate this behaviour ?
The same time close the positions and then open a new position, is not the problem of the code?
Alain Verleyen
Moderator
30295
Alain Verleyen 2013.04.02 11:40  
suoxinyang:
The same time close the positions and then open a new position, is not the problem of the code?
We can't help you if you don't show the code that open position.
Simon Gniadkowski
Moderator
17994
Simon Gniadkowski 2013.04.02 12:47  
suoxinyang:
The same time close the positions and then open a new position, is not the problem of the code?
Not if there is something else that is opening the position . . . no.  Tell me what to do to replicate your issue,  then when I have replicated it I can investigate it.
suoxinyang
72
suoxinyang 2013.04.02 16:04  
angevoyageur:
We can't help you if you don't show the code that open position.
Thank you very much, this problem has been solved, the opening conditions.
suoxinyang
72
suoxinyang 2013.04.02 16:04  
RaptorUK:
Not if there is something else that is opening the position . . . no.  Tell me what to do to replicate your issue,  then when I have replicated it I can investigate it.
Thank you very much, this problem has been solved, the opening conditions.
/
To add comments, please log in or register