거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
2480
평가:
(24)
게시됨:
2017.01.18 09:05
\MQL5\Experts\ \MQL5\Indicators\ \MQL5\Include\
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Why this is needed:

This class can help organize data exchange between your programs in case you create products for the Market or if you do not want to use system DLLs.

For other cases, there are more reliable and faster methods for connecting applications. The exchange is implemented using simple structures.

Usage options:

  1. It is necessary to pass data from an expert to indicator or to another expert;
  2. It is necessary to create an indicator that displays information to multiple windows (or to the main window and subwindow);
  3. It is necessary to set up visualization of the calculated values for an expert, in which all the required calculations are made.

How to work with it:

Here is an example of transferring data from an expert to an indicator.

  1. In the expert

    1.1. Create an instance of the class:

    CInterchange Exp_buffer;

    1.2. In the OnInit() set the prefix for names of the global variables. To avoid conflicts with other instances of the class, set a unique name for each of them:

    Exp_buffer.SetPrefixNameForSave(_Symbol+"_"+(string)_Period);

    1.3. The algorithm operation is implemented using custom events. Simple add the line below to the OnChartEvent() handler:

    Exp_buffer.OnEvent(id,lparam,dparam,sparam);

    If the data for transferring is ready (in the example it is the Exp_Data structure), it is necessary to call the method:

    Exp_buffer.SendDataStart(Exp_Data);
    1.4. Do not forget to destroy the class instance during the program deinitialization:
    Exp_buffer.Destroy();

  2. In the indicator

    2.1. Create an instance of the class:

    CInterchange Ind_buffer;
    2.2. In the OnInit() set the prefix for names of the global variables. It has to match the source - must be the same as in point 1.1.
    Ind_buffer.SetPrefixNameForLoad(_Symbol+"_"+(string)_Period);

    2.3. To start the process of data transfer, it is necessary to call the GetDataStart() with the Ind_data parameter (structure to write the data from the expert);

    Ind_buffer.GetDataStart(Ind_data);

    2.4. The algorithm operation is implemented using custom events. Add the line below to the OnChartEvent() handler:

    Ind_buffer.OnEvent(id,lparam,dparam,sparam);

    If the data transfer process is completed, the method:

    Ind_buffer.GetDataFinish(Ind_data)

    returns true.

    2.5. Do not forget to destroy the class instance during the program deinitialization:

    Ind_buffer.Destroy();

Video with example of operation:


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

Stat Stat

The script displays the brief statistics for trading on the instrument over the specified period - the number of deals, profit, profit factor.

Switching charts Switching charts

The script switches all opened charts at a certain interval. It is also possible to display only the charts of certain symbols.

Trade on Timer Trade on Timer

Simple code that illustrates trading based on the OnTimer event. When the timer triggers, the robot alternately performs buy and sell deals with fixed stop loss and take profit values.

ZZ Fibo Trader ZZ Fibo Trader

The ZZ Fibo Trader is a simple illustration of the use of the Simple ZZ Fibo, which plots Fibonacci lines on long impulse waves of the ZigZag. In addition, the algorithm illustrates operation of the parabolic system for moving the stop loss.