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

 
AlexeyVik:
Specify, did you fix everything I wrote or just TimeLocal() to TimeCurrent()


Fixed the thongs to ints, removed the inverted commas, and tried it without a shift - just when crossing, and tried it with iTime everywhere and there to be. I don't understand it at all. Now I rewrote it to immediately open loop there after finding time, and this is what I got:

extern int Magic = 66622210;
extern double Lot = 400.0;
color Colorrr;
datetime Vremyaaa;
//datetime shi = 120;
color col = Black; 
int operacia;
//-
void OnTick()
{
   int AllObject = ObjectsTotal(); 
   for ( int i = 0; i < AllObject; i++)
   {
    int kolpos = 0;
    string NameObj = ObjectName(i); 
    Colorrr = ObjectGet(NameObj, OBJPROP_COLOR);
    Vremyaaa = ObjectGet(NameObj, OBJPROP_TIME);
    if((Colorrr == Green)||(Colorrr == Aqua)){operacia = OP_BUY;}
    if((Colorrr == Red)||(Colorrr == Purple)){operacia = OP_SELL;}
    if(Vremyaaa == TimeCurrent())
      {
       for (int pos = 0; pos < OrdersTotal(); pos++)
          {
           if(OrderSelect(pos, SELECT_BY_POS, MODE_TRADES) == true)
             {
              if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic)
                {
                 kolpos++;
                }
             }   
          }
          
       if(kolpos == 0)
         {
           printf("otkrivaem order");
           int ticket = OrderSend(Symbol(), operacia, Lot, Bid, 10, 0, 0, "5", Magic, 0, col);
         }  
              
            
      }
    }
 
}

Maybe it's because iTimeCurrent gives the time down to seconds and slips in an even time?

 

Is there a function or variable that returns the EA's forced stop status (this is when "Stop" is pressed) in test mode?

 
dmitriyriy666:

Fixed the thongs to ints, removed the inverted commas, and tried it without a shift - just when crossing, and tried it with iTime everywhere and there to be. I don't understand it at all. Now I rewrote it to immediately open loop there after finding time, and this is what I got:

Maybe the thing is that TimeCurrent gives time to seconds and slips even time?

Yes, most likely, I didn't pay attention to it. Better set Time[0] or you can use . several TimeCurrent() conversions to string to minutes and back from string to datetime
 
qomment:

Is there a function or variable that returns the EA's forced stop status (this is when "Stop" is pressed) in test mode?

IsStopped()
 
AlexeyVik:
Yes, I probably didn't pay attention to that. Better put Time[0] or you can through . several TimeCurrent() conversions to string to minutes and back from string to datetime


Time[0] didn't work either. Need time without seconds - how do I achieve that? I tried if(Vremyaaa == TimeToString(TimeCurrent(), TIME_DATE|TIME_MINUTES)) does not work...
 
is there a tick indicator that displays the time of each tick instead of just showing ticks like a normal mt4
 

Good afternoon,

I get a warning during compilation

possible loss of data due to type conversion

on the line:

int Stop_Loss = MarketInfo(Symbol(),MODE_STOPLEVEL);

The description of MarketInfo says that it returns type double.

But the stop level is an integer and I want to use it

as an integer...

..Is it the developers' fault, or is the warning correct and I don't understand it?

 

Good time, gentlemen, decided to start posting in this dumb topic, if anyone has any advice.

MT4 is losing the network - the server clock is not ticking, but the "connection status" shows that everything is OK. Internet is guaranteed and not busy in any way.

This happens many times a day, change of the broker does not affect a situation. The terminal just gets stuck in some position and it feels like it can stay in this position forever.

Any tips would be appreciated.

 

Good afternoon.

Can you tell me which broker has the minimum delay (ping) on MT4?

 
greyfenrir:

Good time, gentlemen, decided to start posting in this dumb topic, if anyone has any advice.

MT4 is losing the network - the server clock is not ticking, but the "connection status" shows that everything is OK. Internet is guaranteed and not busy in any way.

This happens many times a day, change of the broker does not affect a situation. The terminal just gets stuck in some position and it feels like it can stay in this position forever.

Any tips would be appreciated.

Maybe some adviser or indicator is letting the MT down with its long calculations...
Reason: