당사 팬 페이지에 가입하십시오
CSetFileReader - MetaTrader 5용 라이브러리
- 조회수:
- 3580
- 평가:
- 게시됨:
- 2020.01.27 10:10
- 업데이트됨:
- 2020.01.27 15:12
- 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
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
The first really 3D indicator "Moving Average".
CHistoryPositionInfo ClassA class for easy access to the closed position properties.
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.0The good old MT4 indicator! Now for MetaTrader 5.