This is standard behaviour. The countdown starts from the current bar which is under construction. Accordingly, with the appearance of a new bar, in the absence of autoscrolling, its number is incremented by one.
Ok, then please add somewhere in the documentation that it is not the "first visible bar", but the first bar starting from the current (unfinished) one.
It helps to restart with a slight delay, of sorts:
int err=-1; int count=5; {while((err!=0)&&(count>0)) { ResetLastError(); EventSetMillisecondTimer(MSTimerSet); //Установка таймера XXX миллисекунд err=GetLastError(); Print("EventSetMillisecondTimer n=",count," err >>",err); {if(err!=0){Sleep(50);}} }}//while((err!=0)&&(count>0))
I found out by experience that the timer hangs up when the internet glitches. The terminal freezes and the timer hangs up. I.e. It can hang up for no reason. When the Internet is slow.
So I did it differently, namely. Running the timer in a tick.
typedefvoid (*fn)(); class A { public: fn a; }; class B : public A { public: void a() { Print( __FUNCSIG__ ); } }; voidOnStart() { B b; b.a(); }
Result: invalid function pointer call; execution of B::a() was expected
and here -> compile error
typedefvoid (*fn)( int ); class A { public: fn a; }; class B : public A { public: void a() { Print( __FUNCSIG__ ); } }; voidOnStart() { B b; b.a(); //Error: 'a' - wrong parameters count }
just checked on the dashboard - all is OK, all events are working as normal
I've run spies on a few symbols and the EA gets events from these spies when the ticks come in. On MT5 all events have time to come, but on MT4 I can see freezes sometimes for a second or more. Nothing heavy is running, one chart is open.
I cannot get an adequate value of margin requirement to open a position. I get the same value for all symbols, different brokers have different values, one shows 0.0 for all symbols, another shows 100000.0.
What is going on with MT4? Win 10 64, MT4 build 1031
Andrey Dik: I cannot get an adequate value of margin requirement to open a position. I get the same value for all symbols, different brokers have different values, one shows 0.0 for all symbols, another shows 100000.0.
What is going on with MT4? Win 10 64, MT4 build 1031
Good afternoon!
This is standard behaviour. The countdown starts from the current bar which is under construction. Accordingly, with the appearance of a new bar, in the absence of autoscrolling, its number is incremented by one.
Error during execution as a result of compilation
void OnStart()
{
Print( MACRO( "1\0" )); //равносильно Print( "\"1\\0\"" );
}
Result : 1
Expected: "1\0".
2 errors: Quote marks missing " and misinterpreted \ character
and then
{
Print( MACRO( 1\0 )); //Error: '\' - illegal escape sequence
}
Yes, but you can't explain that to customers, can you?
Imagine that the expert is working, it works, you go to sleep, you go to sleep, you wake up and the expert is not working, why?
It helps to restart with a short delay, something like this:
int count=5;
{while((err!=0)&&(count>0))
{
ResetLastError();
EventSetMillisecondTimer(MSTimerSet); //Установка таймера XXX миллисекунд
err=GetLastError();
Print("EventSetMillisecondTimer n=",count," err >>",err);
{if(err!=0){Sleep(50);}}
}}//while((err!=0)&&(count>0))
It helps to restart with a slight delay, of sorts:
int count=5;
{while((err!=0)&&(count>0))
{
ResetLastError();
EventSetMillisecondTimer(MSTimerSet); //Установка таймера XXX миллисекунд
err=GetLastError();
Print("EventSetMillisecondTimer n=",count," err >>",err);
{if(err!=0){Sleep(50);}}
}}//while((err!=0)&&(count>0))
Execution error
class A { public:
fn a;
};
class B : public A { public:
void a() { Print( __FUNCSIG__ ); }
};
void OnStart()
{
B b;
b.a();
}
Result: invalid function pointer call; execution of B::a() was expected
and here -> compile error
class A { public:
fn a;
};
class B : public A { public:
void a() { Print( __FUNCSIG__ ); }
};
void OnStart()
{
B b;
b.a(); //Error: 'a' - wrong parameters count
}
MT4 is skipping user events in packs. Is this a bug or a bug?
just checked on the dashboard - all is ok, all events are working fine
just checked on the dashboard - all is OK, all events are working as normal
Nothing heavy is running, one chart is open.
What is going on with MT4? Win 10 64, MT4 build 1031
doing so:
{
Print(MarketInfo (Symbol (), MODE_MARGININIT));
Print(MarketInfo (Symbol (), MODE_MARGINMAINTENANCE));
Print(MarketInfo (Symbol (), MODE_MARGINHEDGED));
Print(MarketInfo (Symbol (), MODE_MARGINREQUIRED));
Print(SymbolInfoDouble (Symbol (),SYMBOL_MARGIN_INITIAL));
}
Here are the values obtained from 2 brokers:
2017.01.31 22:15:59.312 Script MarginReq AUDCHF,M15: removed
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: uninit reason 0
2017.01.31 22:15:59310 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 1000.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:15:59.309 MarginReq AUDCHF,M15: initialized
2017.01.31 22:15:59.300 MarginReq AUDCHF,M15 inputs: Input1=0;
2017.01.31 22:15:57.899 Script MarginReq AUDCHF,M15: loaded successfully
2017.01.01.31 22:13:38.077 Script MarginReq AUDCHF,M15: removed
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: uninit reason 0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 1000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: initialized
2017.01.01.31 22:13:38.066 MarginReq AUDCHF,M15 inputs: Input1=0;
2017.01.31 22:13:36.806 Script MarginReq AUDCHF,M15: loaded successfully
I cannot get an adequate value of margin requirement to open a position. I get the same value for all symbols, different brokers have different values, one shows 0.0 for all symbols, another shows 100000.0.
What is going on with MT4? Win 10 64, MT4 build 1031
doing so:
{
Print(MarketInfo (Symbol (), MODE_MARGININIT));
Print(MarketInfo (Symbol (), MODE_MARGINMAINTENANCE));
Print(MarketInfo (Symbol (), MODE_MARGINHEDGED));
Print(MarketInfo (Symbol (), MODE_MARGINREQUIRED));
Print(SymbolInfoDouble (Symbol (),SYMBOL_MARGIN_INITIAL));
}
Here are the values obtained from 2 brokers:
2017.01.31 22:15:59.312 Script MarginReq AUDCHF,M15: removed
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: uninit reason 0
2017.01.31 22:15:59310 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 1000.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:15:59.310 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:15:59.309 MarginReq AUDCHF,M15: initialized
2017.01.31 22:15:59.300 MarginReq AUDCHF,M15 inputs: Input1=0;
2017.01.31 22:15:57.899 Script MarginReq AUDCHF,M15: loaded successfully
2017.01.01.31 22:13:38.077 Script MarginReq AUDCHF,M15: removed
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: uninit reason 0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 1000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 0.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: 100000.0
2017.01.31 22:13:38.075 MarginReq AUDCHF,M15: initialized
2017.01.01.31 22:13:38.066 MarginReq AUDCHF,M15 inputs: Input1=0;
2017.01.31 22:13:36.806 Script MarginReq AUDCHF,M15: loaded successfully
try
AccountFreeMarginCheck