Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

SingleTesterCache - MetaTrader 5 Library | MT5 EA Download

author EAcpu | 3 reads | 0 comments |

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

This library allows you to read/write tst files - MT5-Tester single channel format.

Some usage variations

Forum for trading, automated trading systems and testing trading strategies

MetaTrader 5 platform beta version 2155: global updates for visibility areas, strategy tester and built-in hosting in MQL5

FXSABER , 2019.10.04 07:18 pm.

If they open the tst file format and put Tester's cache folder into a sandbox , a new type of market product can be created that will become an analyzer/corrector of the tester's results.

For example, a market portfolio can be written to display all single channels available in the cache.

You don't need to launch a tester to implement each project.

All this can now be done if you put the cache folder into the sandbox via mklink. You only need the tst format.

Anyone who feels empowered should start writing a product like this. I would happily join its development team and buy it. The niche is completely empty.

If the cache folder is not sandboxed, there may be an increased chance that similar products will appear outside the MQ ecosystem because they will be written in other languages.

 #include //Tester's single pass data.

blank start ()
{ 
   SINGLETESTERCACHE SingleTesterCache; // Create a tester cache object. 
   SingleTesterCache.Set(); // Put the real story of the bid into it. // ..\.\.\MQL5\Files/Test.tst. print (SingleTesterCache.Save( "test.tst" )); // Write this to a file that can be imported into the tester. }

This script converts live account transaction history into tst format. Import it into the tester as follows.

SingleTesterCache - library for MetaTrader 5

It turns out that's the case.

SingleTesterCache - library for MetaTrader 5

SingleTesterCache - library for MetaTrader 5

The DLL solution cannot be placed in the KB, so below is the source code for another script that is not included in the KB delivery.

#include //Tester's single pass data.

#include <Graphic\Graphic.mqh> #include // https://www.mql5.com/en/code/26132

#Define minimum width 10

//Create a chart.
String graph ( constant double &Y1[], constant double &Y2[],
Integer width = 0 , integer height = 0 , constant ENUM_CURVE_TYPE type = CURVE_NONE,
Constant String Curve Name 1 = Invalid , Constant String Curve Name 2 = Invalid , String Object Name = Invalid )
{
  width=width? Width: ( integer ):: chart gets integer ( 0 , CHART_WIDTH_IN_PIXELS );
  height=height? height: ( integer ):: Chart GetInteger ( 0 , CHART_HEIGHT_IN_PIXELS );
  object name = (object name == invalid )? __Function__ : object name;

  CGraphic graphics;

const boolean resolution = (:: object_find ( 0 , object_name) >= 0 )? Graphic.Append( 0 , object name): Graphic.Create( 0 , object name, 0 , 0 , 0 , width, height);

if (research)
  {
Constant integer size 1=:: array size (Y1);
Constant integer size 2=:: array size (Y2);

    Graphic.CurveAdd(Y1, ((Type == CURVE_NONE) && Size1) ? ((Width / Size1 < MIN_WIDTH) ? CURVE_LINES : CURVE_POINTS_AND_LINES) : Type, CurveName1);
    Graphic.CurveAdd(Y2, ((Type == CURVE_NONE) && Size2) ? ((Width / Size2 < MIN_WIDTH) ? CURVE_LINES : CURVE_POINTS_AND_LINES) : Type, CurveName2);

    Graphic.CurvePlotAll();
    graphics.update();
  }

return (Res?Graphic.ChartObjectName(): void );
} Blank start ()
{ 
uchalbyte2 [];
 
If (MTTESTER::GetLastTstCache(Bytes2) != - 1 ) // Is it possible to read the last cache record of a single run {
Constant SINGLETESTERCACHE SingleTesterCache(Bytes2); // Drive it to the corresponding object.    SingleTesterCache.SaveSet( void , true , "creator" + __file__ ); // Save the settings file containing the details. 
double balance[];
double fair[];
 
//Print balance and equity charts. if (SingleTesterCache.GetBalance(Balance) && SingleTesterCache.GetEquity(Equity))
      GraphPlot(Balance, Net Worth, 1200 , 500 , Curve_None, "Balance" , "Fairness" );
 
Print (SingleTesterCache.Header.ToString()); // Output the header of a single pass. Print (SingleTesterCache.Summary.ToString()); // Statistics. print (SingleTesterCache.Inputs);ckground-color:rgb(255, 246, 200);">//Input parameters. } }


The script will automatically take the last passed data and output its data, including a balance/equity graph.

SingleTesterCache - library for MetaTrader 5

Thanks to the developers for creating the tester cache and helping me unpack its format.


Attachment download

📎 exptradesummarysingle.mqh (10.32 KB)

📎 testerpositionprofit.mqh (1.4 KB)

📎 testertradestate.mqh (1.06 KB)

📎 tradeorder.mqh (8.38 KB)

📎 exptradesummaryext.mqh (10.08 KB)

📎 tradedeal.mqh (16.52 KB)

📎 string.mqh (1.79 KB)

📎 singletestcacheheader.mqh (14.58 KB)

📎 singletestercache.mqh (33.39 KB)

📎 singletestercache_example.mq5 (0.4 KB)

📎 typetobytes.mqh (20.45 KB)

Source: MQL5 #27611

Verification code Refresh