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

Memory Mapping - MetaTrader 5용 라이브러리

조회수:
7791
평가:
(36)
게시됨:
2012.01.13 13:48
업데이트됨:
2016.11.22 07:32
memmap32.zip (754.96 KB)
memmapdll.zip (29.22 KB)
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This project (Visual C++ 2010) contains 2 classes - CMemMapApi и CMemMapFile.

They designed for working with memory mapped files. You can:

  • Create file in memory;
  • Write and read data from memory mapped file;
  • It provides an opportunity to exchange data between applications, including MetaTrader 4 и МetaТrader 5.
Using memory mapped files you can achieve a great performance in data exchange.

The main application is the data exchange:
  • Copying of the trades for several terminals on one PC
  • Quotes data exchange for the arbitrage Expert Advisors etc.

The memory mapped files can be used for a serve of the temporary data of the Expert Advisors.
The CMemMapApi class is just a wrapper of WinApi functions, that's the difference between CMemMapFile and CMemMapApi.

The CMemMapFile is useful, because it serves file name, file handle and controls the checkings of file size. In contrast, CMemMapApi class can work with several memory mapped files.

In current project the exported DLL functions are organized in CMemMapApi for working with several memory-mapped files.
The CMemMapFile class is designed for working with memory mapped files in other C++ projects.

Exported functions:
//--- open/create memory-mapped file and returns handle
int MemOpen(string path,int size,int mode,int &err[]);
//--- closes memory mapped file
void MemClose(int hmem);             
//--- increases the size of memory-mapped file
int MemGrows(int hmem,string path,int newsize,int &err[]);
//--- returns the size of memory mapped file
int MemGetSize(int hmem, int &err[]);
//--- sets the size of memory mapped file
int MemSetSize(int hmem, int size, int &err[]);
//--- writes v vector (size bytes) to memory-mapped file starting from position pos
int MemWrite(int hmem,int &v[], int pos, int size, int &err[]);       
//--- reads v vector (size bytes) to memory-mapped file starting from position pos
int MemRead(int hmem, int &v[], int pos, int size, int &err[]);
//--- writes a string (size bytes) to memory-mapped file starting from position pos
int MemWriteStr(int hmem, string buf, int pos, int size, int &err[]);
//--- reads a string (size bytes) from memory-mapped file starting from position pos
int MemReadStr(int hmem, string buf, int pos, int &size, int &err[]);

Example of the DLL use:  Quotes Monitoring (memory-mapped file)

12.03. 2012: Fixed an error in MemWriteStr


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

Quotes Monitoring  (memory-mapped file) Quotes Monitoring (memory-mapped file)

This Expert Advisor is example of use of the Memory Mapping DLL for working with File Mapping functions. In this example the Expert Advisor create a virtual (memory-mapped) file and start to update the quotes on symbol. Using this way, Expert Advisors can exchange data (for example, quotes) using common memory-mapped file.

IncRVIOnArray IncRVIOnArray

CRVIOnArray class is designed for calculation of RVI (Relative Vigor Index) values on indicator buffers. Test_RVIOnArray indicator is provided as the example of the class use.

File Mapping  without DLL File Mapping without DLL

The classes (conveted from C++ to MQL5) for working with memory mapped files.

BykovTrend_HTF_Signal BykovTrend_HTF_Signal

BykovTrend_HTF_Signal shows a trend direction or a signal for performing a deal generated by BykovTrend indicator as a graphic object with colored trend indication or deal direction.