article about backtesting and FXT file format coming soon
Slawa,
What is the estimation of getting this article about backtesting and the FXT file format ?
This is one of the areas I think many people are greatly interested in at the moment. Is it also worthwhile for users to perhaps add to this thread on what areas of the backtester need further explaination ?
Regards
Martin
What is the estimation of getting this article about backtesting and the FXT file format ?
This is one of the areas I think many people are greatly interested in at the moment. Is it also worthwhile for users to perhaps add to this thread on what areas of the backtester need further explaination ?
Regards
Martin
"Strategy Tester: Modes of Modeling during Testing"
"Testing Features and Limits in MetaTrader 4"
in half hour time i'll translate topic about FXT from russian forum
"Testing Features and Limits in MetaTrader 4"
in half hour time i'll translate topic about FXT from russian forum
Generated file begins with header
struct TestHistoryHeader
{
int version; // must be 402
char copyright[64];
char symbol[12];
int period;
int model; // 0-every tick 1-control points 2-open prices
int bars; // bars processed
time_t fromdate;
time_t todate;
double modelquality;
//---- common parameters
char currency[12];
int spread;
int digits;
double point;
int lot_min; // minimal lot-size multiplied by 100
int lot_max; // maximal lot-size multiplied by 100
int lot_step;
int stops_level; // minimal stops indentation in points
int gtc_pendings; // good till cancel
//---- profit calculation parameters
double contract_size;
double tick_value;
double tick_size;
int profit_mode; // profit calculation mode { PROFIT_CALC_FOREX=0, PROFIT_CALC_CFD=1, PROFIT_CALC_FUTURES=2 }
//---- swaps calculation
int swap_enable; // 0 - disable, 1-enable
int swap_type; // { SWAP_BY_POINTS=0, SWAP_BY_DOLLARS=1, SWAP_BY_INTEREST=2 }
double swap_long;
double swap_short; // swap sizes
int swap_rollover3days; // day (usually 3) of treble swaps
//---- margin calculation
int leverage;
int free_margin_mode; // { MARGIN_DONT_USE=0, MARGIN_USE_ALL=1, MARGIN_USE_PROFIT=2, MARGIN_USE_LOSS=3 }
int margin_mode; // { MARGIN_CALC_FOREX=0, MARGIN_CALC_CFD=1, MARGIN_CALC_FUTURES=2, MARGIN_CALC_CFDINDEX=3 };
int margin_stopout;
double margin_initial;
double margin_maintenance;
double margin_hedged;
double margin_divider;
char margin_currency[12];
//---- commission calculation
double comm_base; // base commission
int comm_type; // base commission type { COMM_TYPE_MONEY=0, COMM_TYPE_PIPS=1, COMM_TYPE_PERCENT=2 }
int comm_lots; // per lot or per deal { COMMISSION_PER_LOT=0, COMMISSION_PER_DEAL=1 }
//---- generation info
int from_bar; // bar number "fromdate"
int to_bar; // bar number "todate"
int start_period[6]; // lesser period beginning bar number
//----
int reserved[64];
};
then follows bar states array
#pragma pack(push,1)
struct TestHistory
{
time_t otm; // open time
double open; // current bar values
double low;
double high;
double close;
double volume;
time_t ctm; // current time (time of this bar state)
int flag; // expert launch flag (0-bar is modified but expert not launched)
};
#pragma pack(pop)
fxt file should be placed in the tester/history directory. name format is SSSSSSPP_M.fxt where
SSSSSS - symbol name same as in symbol field in the header
PP - timeframe period must be correspond with period field in the header
M - model number (0,1 or 2)
our source for check of adequacy for your information
_snprintf(tmp,sizeof(tmp)-1,"%s\\tester\\history\\%s%d_%d.fxt",ExtProgramPath,scheme->symbol,scheme->period,model);
if((m_file=fopen(tmp,"rb"))!=NULL)
{
//---- header adequacy check
if(fread(&m_header,sizeof(m_header),1,m_file)==1 &&
m_header.version==TestHistoryVersion &&
m_header.model==model && m_header.period==scheme->period &&
strcmp(m_header.symbol,scheme->symbol)==0)
{
//---- next check
if(m_header.bars<=100 || m_header.modelquality<0.0 ||
m_header.spread<0 || m_header.spread>100000 ||
m_header.digits<0 || m_header.digits>8 ||
m_header.lot_min<0 || m_header.lot_step<=0 ||
m_header.leverage<=0 || m_header.leverage>500 ||
m_header.swap_rollover3days<0 ||
m_header.swap_rollover3days>6 ||
m_header.stops_level<0) refresh=TRUE;
//---- if recalculation is not needed then set m_testes_total and exit
if(refresh==FALSE)
{
m_testes_total=(_filelength(_fileno(m_file))-sizeof(m_header))/sizeof(TestHistory);
return(TRUE);
}
}
//----
fclose(m_file);
m_file=NULL;
}
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1. In the history center data columns, would the tick BID price be entered into all the price columns (OPEN, HIGH, LOW, CLOSE), and the VOLUME column be set to 1?
2. Would the tick data be imported into the existing M1 data set and be mixed with the M1 bar data? If so, how does the strategy tester differentiate between the tick data and the existing bar data?
Thanks for your help.