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

 
serjlarkin:
Hi, can you tell me why i can't tune any EA in mt4, all of them show negative values when i test the strategy!

The problem is that you have bad EAs. They are not making money, they are losing money. Write a good EA that will make money, and then the test will have a positive value.
 
serjlarkin:
Hi, can you tell me why I can't set any of the Mt4 EAs, all of them show negative values when I test the strategy!

in the strategy
 
_Pushok_:

Hello!

Need some help! Is it possible to create an indicator of the following nature: - counting ticks according to this principle https://www.mql5.com/ru/code/9915 - this is already half of the indicator .... But to refine as follows and depict it graphically with the following parameters:

Help, for whom it is a piece of cake)

Maybe someone here can help.
 
Hello! I got stuck on such a small thing. I need to close the open trade at the moment of price crossing (exactly at zero bar) the MA line. I have such a code - it does not work.
 void CheckForClose()
  {   
   double MA1Low = iMA(NULL,0,MA_Period_2,MA_Shift_2,MA_Method_2,Applied_Price_2,1); 
   double MA11Low = iMA(NULL,0,MA_Period_2,MA_Shift_2,MA_Method_2,Applied_Price_2,0); 
   double MA2High = iMA(NULL,0,MA_Period_3,MA_Shift_3,MA_Method_3,Applied_Price_3,1);
   double MA21High = iMA(NULL,0,MA_Period_3,MA_Shift_3,MA_Method_3,Applied_Price_3,0);

   
   for(int i=0;i<OrdersTotal();i++)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false)        break;
      if(OrderMagicNumber()!=124 || OrderSymbol()!=Symbol()) continue;
      //---- check order type 
      if(OrderType()==OP_BUY)
        {
         if(Bid > MA2High) OrderClose(OrderTicket(),OrderLots(),Bid,2,White);
         break;
        }
      if(OrderType()==OP_SELL)
        {
         if(Ask < MA1Low) OrderClose(OrderTicket(),OrderLots(),Ask,2,White);
         break;
        }
     }

And one more question - how can I programmatically set the price to pass through 30 pips in a certain period of time, say 1 hour, 2 hours. I am using M15 timeframe.

Many thanks in advance.

 
Please advise what to do, advisor does not continue to work after the closing of orders, I mean I put the advisor on the chart and it started to work pending orders and after it fulfills its orders does not continue to work at all, it keeps working only when I remove the advisor from the chart and put it back on the chart again or turn off the terminal and then turn it on again, advise what to do if possible in private
 
uranov:
Hello Dear Sir, could you please advise what to do, the EA does not continue to work after the closing of orders, I mean I put the EA on the chart and it started to work with pending orders and after it fulfills its orders does not continue to work at all, it keeps working only when I remove the EA from the chart and put it on the chart again or turn off the terminal and then on again, please advise what to do if possible in your room
You will get good advice here
 
alexey1979621:
Greetings, I'm stuck on this little thing. I need to close an open trade at the moment the price crosses (exactly on the zero bar) the MA line. I have this code - it doesn't work.

 if(OrderType()==OP_BUY)
        {
         if(Bid > MA2High) OrderClose(OrderTicket(),OrderLots(),Bid,2,White);
         break; // может все же нада continue ??? и проверку на ошибки c реквотами, и тд
        }
+ I read somewhere that it's useful to check the OrderClosetime when selecting an open ticket ( they have it = 0 ).
 
Folks, can you tell me. An indicator that would be able to identify targets. At which to set a takeprofit...
 
alexey1979621:
Greetings, I got stuck on such a small thing. I need to close the open trade at the moment of price crossing (exactly at zero bar) the MA line. I have this code - it doesn't work.

And one more question - how can I programmatically set the price to pass through 30 pips in a certain period of time, say 1 hour, 2 hours. I am working on M15 timeframe

Thanks in advance.

The first thing that catches my eye (substitute):

for (int i = OrdersTotal() - 1; i >= 0; i--)

Second: read about rules of comparison of real numbers.

 
ALXIMIKS:

+ I read somewhere that it's useful to also check the OrderClosetime of open tickets when selecting (they have it = 0).
This is for selection by ticket. Here it is selection by index.
Reason: