無料でロボットをダウンロードする方法を見る
Twitter上で私たちを見つけてください。
私たちのファンページに参加してください
興味深いスクリプト?
それではリンクにそれを投稿してください。-
他の人にそれを評価してもらいます
記事を気に入りましたか?MetaTrader 5ターミナルの中でそれを試してみてください。
ライブラリ

Expert History Export - MetaTrader 4のためのライブラリ

ビュー:
2634
評価:
(23)
パブリッシュ済み:
2022.04.14 13:41
アップデート済み:
2022.06.29 11:52
\MQL4\Include\
このコードに基づいたロボットまたはインジケーターが必要なら、フリーランスでご注文ください フリーランスに移動

Adds the ability to automatically export the history of deals after running an Expert Advisor in the Strategy Tester.

The file is saved in the shared terminal folder   Common/Files or in the terminal folder   MQL4/Files.

The file name is generated automatically or set manually when calling the method   Export()

The history file can be used to simulate the same sequence of trades on another trading server using an EA Simple History Receiver .


Basic usage

1. Instantiate the object in the global scope:

CExpertHistory expertHistory();

2. Add to the function call   OnTester() method call   Export()   :

double OnTester(void) {

    ...

    expertHistory.Export();

    ...

}


Extended use

1. Instantiate the object in the global scope:

string expertName = "SomeExpert";
string expertVersion = "1.00";      // Not required
string dataSeparator = ",";         // Not required
string decimalPoint = ".";          // Not required

CExpertHistory expertHistory(expertName, expertVersion, dataSeparator, decimalPoint);


2. Add to function   OnInit()   any pairs of parameter names and values:

input double SL = 500;
input double TP = 1000;

int OnInit() {

    ...

    expertHistory.AddParam("Symbol", Symbol());
    expertHistory.AddParam("TP", TP);
    expertHistory.AddParam("SL", SL);

    ...

}


3. Add to the function call   OnTester() method call   Export() :

double OnTester(void) {

     ...

     if(!MQLInfoInteger(MQL_OPTIMIZATION)) { // If you want save history only in single tester run
         expertHistory.Export();
     }

     ...
}


At the method   Export()   there are options:

void Export(
   string export FileName = "", // The name of the file to export. If empty, it will be generated according to the exportFileNameFormat parameter

   ENUM_HISTORY_EXPORT_FORMAT exportFormat = HEF_INI_FULL, // Export format. By default, in the file in addition to the transactions
                                                           // account parameters are recorded, testing period, max. drawdown and so on.

   ENUM_HISTORY_FILENAME_FORMAT exportFileNameFormat = HFF_FULL, // File name format. By default, the file name includes the server name, the testing period, max. drawdown and so on.

   int commonFlag=FILE_COMMON // Save a file to a shared terminal folder. If it is equal to 0, then save to a non-shared folder.
);



    Chaikin Oscillator smoothed for MT4 Chaikin Oscillator smoothed for MT4

    Chaikin Oscillator with smoothing option.

    Simple Slope Oscillator Normalized with symbol overlay for MT4 Simple Slope Oscillator Normalized with symbol overlay for MT4

    Simple Slope Oscillator Normalized with symbol overlay for MT4

    Real Trade Copy MT4 Real Trade Copy MT4

    Adviser-Utility for copying transactions from one MT5 account or MT4 account to another MT4 account.

    ADXm (experiment) ADXm (experiment)

    ADXm experiment (metatrader 4 versions)