Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 910

 
evillive:

The figure brackets are missing.

Thanks, got it sorted out! The problem was deeper, my misunderstanding of what the output would be in this way of writing, in general expectations did not match the result, screwed the counters - everything now works as I thought it would.
 

Help , why is the EA not opening orders during testing? (Doesn't do anything?) Please help, please!!!

extern double    OrderValue =  0.01;         
extern int       Up         =  70;
extern int       Dn         =  30;
extern int       rrr        =   5;
extern int       S1_period  =   5;
extern int       S1_slowing =   3;
extern double    TP         =  30;
extern double    SL         =  30;

double    S1a          = 0;
double    S1b          = 0;
      
double MyOrderStateB;
double MyOrderStateS;

int    OpenOrderB      ;   
int    OpenOrderS      ;   

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  
   {
    if (Digits == 3 || Digits == 5)
     {
       TP *=10;
       SL  *=10;
      
     }
  
  
  
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----

   S1a = NormalizeDouble(iStochastic(NULL, 0, S1_period, 3, S1_slowing, MODE_SMA, 1, MODE_MAIN, 1), 0);
   S1b = NormalizeDouble(iStochastic(NULL, 0, S1_period, 3, S1_slowing, MODE_SMA, 1, MODE_SIGNAL, 1), 0);
   
   if(MyOrderStateB == 1)Sleep(3000);
    else MyOrderStateB = 0;
   if(MyOrderStateS == 1)Sleep(3000);
    else MyOrderStateS = 0;
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

void GetBuy(){
     
   if(S1a == S1b && S1a<20.0000 && S1b<20.0000 )
 {OrderSend(Symbol(), OP_BUY, OrderValue, NormalizeDouble(Ask, Digits), 3, SL, TP, NULL, 0, 0,clrBlue);
     MyOrderStateB = 1; }
   else Sleep(2);
}
void GetSell(){
      
   if(S1a == S1b && S1a>80.0000 && S1b>80.0000 )

    {OrderSend(Symbol(), OP_SELL, OrderValue, NormalizeDouble(Bid, Digits), 3, SL, TP, NULL, 0, 0,clrRed);
      MyOrderStateS = 1; }    
       else Sleep(2);
   } 

 
Viktorline14:

Help , why is the EA not opening orders during testing? (Doesn't do anything?) Please help, please!!!


Can't you create a correct post?

There is no function call in the Start() function to open orders

 
Vinin:

Can't you create a correct post?

There are no function calls in Start() to open orders

 
Bro, how do you add this?
 
Viktorline14:
Brother, how do you add this?
I feel sorry for your mum and dad. They didn't teach you how to communicate.
 

Vinin:
Жалко мне твоих папу и маму. Не научили культуре общения

I'm sorry, I really need help as this is my first experience with EA writing.

Please help please

 

So I figured it out, no errors, but there are warnings.

This must be why the tester is giving out errors

 
Viktorline14:

So I figured it out, no errors, but there are warnings.

This must be why the tester is giving out errors

Guys, help please!!!
 
Viktorline14:
Guys help please!!!

Is it easier to make a screenshot and post it here than to copy the text of the EA? Do you think someone will manually type it into their ME from a screenshot and try to figure it out?

If the compiler says that it should check the result of the function, it must be checked. It's not hard:

if(!OrderSend(Symbol(), OP_BUY, OrderValue, NormalizeDouble(Ask, Digits), 3, SL, TP, NULL, 0, 0,clrBlue)) Print("Opening Buy error #", GetLastError()); //ну и другие действия по усмотрению, в случае ошибки
Reason: