Forum

Spontaneous terminal restart

Hi, I am using MT5 with 2 instances on the same VPS. Installed is the same EA. The instances are installed as /portable instances. The problem I get is, that one instance runs in automatical OnDeinit() 1x a day, the other 5x a day. The best would be for both 0x a day. I will log the reason for the

Limiting trade duration according to working day

Dear all, I am trying to limit the duration of my trade in my ea. In this example to 1 day. int openTime = PositionGetInteger ( POSITION_TIME ); int inpCheckMaxTradeDuration = 1 ; int time = TimeCurrent (); if (openTime > 0 && ((openTime + (inpCheckMaxTradeDuration * 86400 )) < TimeCurrent