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

CSetFileReader - MetaTrader 5용 라이브러리

조회수:
3286
평가:
(12)
게시됨:
2020.01.27 10:10
업데이트됨:
2020.01.27 15:12
\MQL5\Include\ \MQL5\Experts\ \MQL5\Files\
audusd.set (0.46 KB)
eurusd.set (0.46 KB)
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Class to provide simple reading mechanism from MetaTrader set files.

//+------------------------------------------------------------------+
//| Class CSetFileReader.                                            |
//| Appointment: Class to provide reading mechanism from set file.   |
//+------------------------------------------------------------------+
class CSetFileReader
  {
public:
                     CSetFileReader(void)  {  }
                    ~CSetFileReader(void)  {  }

   //--- method of loading a set file
   bool              Load(const string file_name);

   //--- methods of access to protected data
   string            FileName(void)            const { return(m_name);   };
   int               Count(void)               const { return(ArraySize(m_entries)); }
   bool              ContainsKey(const string key) const;

   //--- methods of copy data from collection
   int               CopyTo(string &dst_keys[],const bool withValues=0) const;

   //--- method of access to the data
   template<typename T>
   bool              TryGetValue(const string key, T &ReturnedValue) const;
   bool              TryGetValue(const string key, string &ReturnedValue) const;
  };
//+------------------------------------------------------------------+

Usage Scenario:

An Expert Advisor is to be added to multiple charts with different symbols or timeframes.

Each instances of the Expert must have its own settings different from the others, depending on the current chart symbol, in addition to some other settings which are common to all charts.

Solution:

Copy the settings files from 'MQL5\Presets' to 'MQL5\Files' folder, use a text editor to modify them.

Then, each instance of the expert advisor will apply its new settings upon the Init event.

To start the Init event, simply switch the current chart timeframe.


Included a test expert advisor to explain the idea.

Advantages:

Settings of multiple running instances of the Expert advisor can be changed easily by using a text editor.

You edit the .set files, then switch the chart timeframe for the new settings to take effect.

Multi-symbol Expert Advisors:

The large amount of settings for multiple symbols cannot be managed easily from the user interface.


References:

https://www.mql5.com/en/articles/650

https://www.mql5.com/en/code/24777

https://www.mql5.com/en/docs/standardlibrary/generic/chashmap

https://github.com/EA31337/EA31337-classes/blob/eddf613bd81fbf9e001f5622c358ac1e76aeb2b3/SetFile.mqh

    3D Moving Average 3D Moving Average

    The first really 3D indicator "Moving Average".

    CHistoryPositionInfo Class CHistoryPositionInfo Class

    A class for easy access to the closed position properties.

    Trade Copier - Open Source - Multiplatform - Transmitter Side Trade Copier - Open Source - Multiplatform - Transmitter Side

    Trade Transmitter will Transmit Trades from MT5 Demo or Real accounts using CSV Files. Each trade request created manually or by other EAs on MT5 terminal will be automatically transmitted. Positions and orders summaries are also transmitted, so the receiver on the other platform can catch up, in case it misses any of the trade request transmissions. This Code will save your time if you are working on a bridge to copy trades between MT5 and any other platform.

    Forex_Market_Hours_GMT_v4.0 Forex_Market_Hours_GMT_v4.0

    The good old MT4 indicator! Now for MetaTrader 5.