Errors, bugs, questions - page 2153
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How do i know what time forex symbol trades close?
Forum on trading, automated trading systems and trading strategies testing
Features of mql5 language, tips and tricks
fxsaber, 2017.02.25 16:39
{
MqlDateTime sTime = {0};
::TimeToStruct(time, sTime);
return((ENUM_DAY_OF_WEEK)sTime.day_of_week);
}
// true - находимся в торговой сессии
bool SessionTrade( const string Symb )
{
datetime TimeNow = ::TimeTradeServer();
const ENUM_DAY_OF_WEEK DayOfWeek = GetDayOfWeek(TimeNow);
TimeNow %= 24 * 60 * 60;
bool Res = false;
datetime From, To;
for (int i = 0; (!Res) && ::SymbolInfoSessionTrade(Symb, DayOfWeek, i, From, To); i++)
Res = ((From <= TimeNow) && (TimeNow < To));
return(Res);
}
// Возвращает true, если символ торгуемый. Иначе - false.
bool SymbolTrade( const string Symb )
{
MqlTick Tick;
return(::SymbolInfoTick(Symb, Tick) ? ((Tick.bid != 0) && (Tick.ask != 0) && SessionTrade(Symb) /* &&
((ENUM_SYMBOL_TRADE_MODE)::SymbolInfoInteger(Symb, SYMBOL_TRADE_MODE) == SYMBOL_TRADE_MODE_FULL) */) : false);
}
Using
OrderSend(Request, Result);
A very unpleasant bug with custom characters. The tick history of the custom characters can completely disappear.
There were several dozen hours of Optimize on the real ticks of the custom character. No one came near the computer and did nothing.
After 15 hours of Optimization came to see the results. Using the menu item "Run Single Test" at any run is not possible - the tester starts and ends immediately.
The log is
Found that the ticks of all custom characters have been deleted.
If you use XML export
350,000 passes are written to a 320 MB XML file. This automatically opens the XML file for some reason. I have Notepad trying to do this, which hangs up when reading such monsters. Please warn in advance what the approximate size of the file will be when selecting the XML menu and what the consequences might be when opening it further.
Error during compilation
no code fragment can be selected yet
If you use XML export
350,000 passes are written to a 320 MB XML file. This automatically opens the XML file for some reason. I have Notepad trying to do this, which hangs up when reading such monsters. Please, when selecting the XML-menu, please tell in advance what the approximate size of the file will be and what the consequences will be when opening it further.
I agree, but it is not necessary to warn, it is necessary to prohibit opening of the file, and the user will decide how to open it
Error during compilation
Otherwise:
It's fine. What difference does it make?
Compilation error
For several dozen hours there was Optimisation by real ticks of the custom character. No one approached the computer and did nothing.
After 15 hours of Optimization I came to see the results. Using the menu item "Run Single Test" on any pass is not possible - the tester starts and ends immediately.
The log is
Found that the ticks of all custom symbols have been removed.
Reproducible. Need to run Tester/Optimizer. Wait a few hours after it finishes. I have exactly 10 hours later all custom character ticks are deleted.