Einzelnen Beitrag anzeigen
  #18 (permalink)  
Alt 14.09.15
janosch72 janosch72 ist offline
Neues Mitglied
 
Registriert seit: Oct 2013
Beiträge: 7
janosch72 befindet sich auf einem aufstrebenden Ast
Standard

Hallo,

ich habe meinen EA angepasst. Die Order werden erstellt, bloss es werden innerhalb dr einen Minute unzählige Order erstellt. Ich habe nach dem OrderSend in den vier Varianten den Status=True gesetzt, den ich weiter oben abfange. Irgendwie greift dieser nicht, oder hab ich da einen Denkfehler?

Code:
//---- input parameters
extern int      OpenHour      = 9;        // Time to open, hours
extern int      OpenMinute    = 0;        // Time to open, minutes
extern bool     UseCurrSymbol = False;    // Use one symbol only
extern bool     UseOneAccount = False;    // Use one account only
extern int      NumberAccount = 1238827;  // Account number
extern int      Slippage      = 3;        // Slippage
extern double   LongEntryV1   = 0;
extern double   ShortEntryV1  = 0;
extern double   LongEntryV2   = 0;
extern double   ShortEntryV2  = 0;
extern double   LongEntryV3   = 0;
extern double   ShortEntryV3  = 0;
extern double   LongEntryV4   = 0;
extern double   ShortEntryV4  = 0;
extern double   Lots          = 3;
extern int      StopLossV1    = 140;
extern int      TakeProfitV1  = 160;
extern datetime ExpV1         = D'14.09.2015 18:29:00';
extern int      StopLossV2    = 250;
extern int      TakeProfitV2  = 130;
extern datetime ExpV2         = D'14.09.2015 18:29:00';
extern int      StopLossV3    = 190;
extern int      TakeProfitV3  = 140;
extern datetime ExpV3         = D'14.09.2015 18:29:00';
extern int      StopLossV4    = 80;
extern int      TakeProfitV4  = 190;
extern datetime ExpV4         = D'14.09.2015 13:59:00';
extern bool     Status        = False;     // wurden die Order gesetzt?


void start() {

  if (UseOneAccount && AccountNumber()!=NumberAccount) {
    Comment("Working on the account: "+AccountNumber()+"is PROHIBITED!");
    return;
  } else Comment("");


  if (Hour()==OpenHour && Minute()==OpenMinute) {
    if(Status==False) {
       if(LongEntryV1  > 0) OrderSend(Symbol(),OP_BUY,Lots,LongEntryV1,Slippage,StopLossV1,TakeProfitV1,"V1 Buy",0,ExpV1,Blue);
       if(ShortEntryV1 > 0) OrderSend(Symbol(),OP_SELL,Lots,ShortEntryV1,Slippage,StopLossV1,TakeProfitV1,"V1 Sell",0,ExpV1,Red);
     
       if(LongEntryV2  > 0) OrderSend(Symbol(),OP_BUY,Lots,LongEntryV2,Slippage,StopLossV2,TakeProfitV2,"V2 Buy",0,ExpV2,Blue);
       if(ShortEntryV2 > 0) OrderSend(Symbol(),OP_SELL,Lots,ShortEntryV2,Slippage,StopLossV2,TakeProfitV2,"V2 Sell",0,ExpV2,Red);
     
       if(LongEntryV3  > 0) OrderSend(Symbol(),OP_BUY,Lots,LongEntryV3,Slippage,StopLossV3,TakeProfitV3,"V3 Buy",0,ExpV3,Blue);
       if(ShortEntryV3 > 0) OrderSend(Symbol(),OP_SELL,Lots,ShortEntryV3,Slippage,StopLossV3,TakeProfitV3,"V3 Sell",0,ExpV3,Red);

       if(LongEntryV4  > 0) OrderSend(Symbol(),OP_BUY,Lots,LongEntryV4,Slippage,StopLossV4,TakeProfitV4,"V4 Buy",0,ExpV4,Blue);
       if(ShortEntryV4 > 0) OrderSend(Symbol(),OP_SELL,Lots,ShortEntryV4,Slippage,StopLossV4,TakeProfitV4,"V4 Sell",0,ExpV4,Red);
     
       int exitday = DayOfWeek()+1;
        if(exitday == 6)
           exitday = 0;
              
       Status=True;
    } else Status=False;
  }
}
Danke im Voraus für eure Hilfe.

Grüße, Janosch