거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
스크립트

ThirdPartyTicks - MetaTrader 5용 스크립트

조회수:
7204
평가:
(39)
게시됨:
2018.04.18 17:24
업데이트됨:
2018.08.30 13:12
\MQL5\Include\
Dictionary.mqh (38.15 KB) 조회
Symbol.mqh (5.32 KB) 조회
\MQL5\Include\fxsaber\ThirdPartyTicks\
Array.mqh (1.11 KB) 조회
Casting.mqh (0.48 KB) 조회
Data.mqh (1.12 KB) 조회
File.mqh (2.6 KB) 조회
Rates.mqh (2.35 KB) 조회
String.mqh (2.41 KB) 조회
Ticks.mqh (7.89 KB) 조회
Web.mqh (0.9 KB) 조회
\MQL5\Include\Zip\
Zip.mqh (17.22 KB) 조회
ZipContent.mqh (11.62 KB) 조회
ZipFile.mqh (5.91 KB) 조회
ZipHeader.mqh (12.47 KB) 조회
\MQL5\Scripts\fxsaber\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Third-party applications for MetaTrader 4 allowing to obtain a tick history from various sources have always been popular. This history is typically used in the Strategy Tester for checking the operation of Expert Advisors as well as for conducting research (such as machine learning, etc.). Some sources of quotes discussed by users have become almost standard in the search for a "grail."


Criterion

The given MQL5 library does not have any criterion for comparing ticks. The reasons for choosing the proposed source of the tick archive are not described. But this archive is absolutely fresh and therefore not fully studied. Therefore, in order to develop your own criterion of value, perform a simple action - run your Expert Advisor using the "Every tick is based on real ticks" mode on any built-in MetaTrader 5 symbol and on the custom symbol created by the script (based on a third-party real tick history), and then compare the results obtained. This process does not require any deep knowledge of the terminal or additional actions outside it.


Script

The script accesses the tick history from the built-in source and creates an appropriate custom symbols on its basis.

Comments in the source code partially explain the principle.

// https://www.mql5.com/en/code/20225
#property script_show_inputs

#include <fxsaber\ThirdPartyTicks\ThirdPartyTicks.mqh>

sinput bool   Sync = true; // Synchronization
sinput string symbol = ""; // Symbol (NULL - current, "AllSymbols" - All)

THIRDPARTYTICKS ThirdPartyTicks; // Connecting to a local archive of quotes

// One symbol
void CreateSymbol()
{
  // Defining the symbol to work with
  const string Symb = (symbol == "") ? StringSubstr(_Symbol, 0, 6) : symbol;

  if (Sync)
    ThirdPartyTicks.Refresh();                // Reading available data from the tick archive source

  ThirdPartyTicks[Symb].Update();             // Synchronizing the local archive with the source of the selected symbol
  ThirdPartyTicks[Symb].ToCustomSymbol(true); // Creating a custom symbol based on the local archive
}

// All symbols
void CreateAllSymbols()
{
  if (Sync)
    ThirdPartyTicks.Refresh();                     // Reading available data from the tick archive source

  const uint Amount = ThirdPartyTicks.GetAmount();

  for (uint i = 0; _CS(i < Amount); i++)
  {
    ThirdPartyTicks[i].Update();                   // Synchronizing the local archive with the source of the selected symbol
    ThirdPartyTicks[i].ToCustomSymbol();           // Creating a custom symbol based on the local archive
  }
}

void OnStart()
{
  if (symbol != "AllSymbols")
    CreateSymbol();
  else if (MessageBox("Creating all the symbols can take a long time. Do you agree?", __FILE__, MB_YESNO | MB_ICONQUESTION) == IDYES)
    CreateAllSymbols();
}

For a proper operation of the script, you should specify the address of the quotes source in Terminal Settings, for example:

Actions are written in details to logs during the script operation:

UnZip <source_name>\EURUSD.<suffix>\EURUSD.<suffix>_20180313.csv.zip 724002 bytes - unpack size 5466504 bytes.
Total Ticks (EURUSD.<suffix>) = 1645897
Corrected 3 ticks.
EURUSD.<suffix>_<source_name> saved ticks = 1645897

After that you can run your Expert Advisors in the Tester using new custom symbols:


Features

  • Only standard MQL5 features are used, so there are no DLLs and it is suitable for the Market.
  • The archive of quotes is saved on the local machine as ZIP archives with CSV-files.
  • The archive of quotes is synchronized with the source: only the missing data is downloaded.
  • The source files include the following libraries: ZIP and Symbol.
  • The script can work with a local archive without the Internet connection.
  • Data in the local archive can be edited or added manually.
  • The operation of the file storage does not depend on directories in it: you can create folders and save data there at your discretion.
  • The bar history is created taking into account the minimal loss of quality when switching from the "Every tick based on real ticks" testing mode to "Open Prices Only" - a trading system uses limit orders.
  • The core of the script is the library with the same name. It allows creating more interesting scenarios.
  • The source has not been optimized and is provided as is for educational purposes.
  • In order to make the library used as a core completely universal, you need to modify it for operation with arbitrary sources and with any format of quotes.

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/20225

Improve Improve

An Expert Advisor based on two iMAs (Moving Average,MA) and one iRSI (Relative Strength Index, RSI). It tracks virtual profit. Works on two symbols.

OnChart_Stochastic OnChart_Stochastic

Stochastic on the price chart.

Schaff Trend RSI MTF Schaff Trend RSI MTF

Schaff Trend RSI multi timeframe version.

Schaff trend RSX mtf Schaff trend RSX mtf

Schaff Trend RSX multi timeframe version.