strange so Print gives false even though the screenshot shows that AAPL is in the market overview ps I already wrote above: the point is to run on one instrument and get data from another... if I wanted AAPL data from AAPL I would have written _Symbol directly
strange so Print gives false even though on the screenshot you can see that there is a aapl in the market overview ps I already wrote above: The idea is to run on one instrument and get the data from another. If I wanted AAPL data from AAPL I would have written _Symbol
Account number and investor password from you. But I give 99.9% that the symbol "AAPL" on the trading server just does not exist :)
When creating a history file, MT4 tester puts TickValue=0, TickSize=0 in the header and the parameters related to the commission, I do not understand what and where? The values of margin fields are also filled then not - it's different for different brokers.
This is a bug or may be the wrong header structure? The help on the site says so. I've found that it is outdated and therefore I use this one.
#property strict
#property show_inputs
input string symb="AUDCHF";
#define TOSTRING(A) #A+" = "+(string)(A)
struct TestHistoryHeader
{
intversion; // 405charcopyright[64]; // copyrightchardescription[128]; // server name// 196char symbol[12];
int period;
int model; // for what modeling type was the ticks sequence generatedint bars; // amount of bars in historyint fromdate;
int todate;
int totalTicks;
double modelquality; // modeling quality// 240//---- general parameterschar currency[12]; // currency baseint spread;
int digits;
int unknown1;
double point;
int lot_min; // minimum lot sizeint lot_max; // maximum lot sizeint lot_step;
int stops_level; // stops level valueint gtc_pendings; // instruction to close pending orders at the end of day// 292//---- profit calculation parametersint unknown2;
double contract_size; // contract sizedouble tick_value; // value of one tickdouble tick_size; // size of one tickint profit_mode; // profit calculation mode { PROFIT_CALC_FOREX, PROFIT_CALC_CFD, PROFIT_CALC_FUTURES }// 324 //---- swap calculationint swap_enable; // enable swapint swap_type; // type of swap { SWAP_BY_POINTS, SWAP_BY_DOLLARS, SWAP_BY_INTEREST }int unknown3;
double swap_long;
double swap_short; // swap overnight valueint swap_rollover3days; // three-days swap rollover// 356 //---- margin calculationint leverage; // leverageint free_margin_mode; // free margin calculation mode { MARGIN_DONT_USE, MARGIN_USE_ALL, MARGIN_USE_PROFIT, MARGIN_USE_LOSS }int margin_mode; // margin calculation mode { MARGIN_CALC_FOREX,MARGIN_CALC_CFD,MARGIN_CALC_FUTURES,MARGIN_CALC_CFDINDEX };int margin_stopout; // margin stopout levelint margin_stopout_mode;// stop out check mode { MARGIN_TYPE_PERCENT, MARGIN_TYPE_CURRENCY }double margin_initial; // margin requirementsdouble margin_maintenance; // margin maintenance requirementsdouble margin_hedged; // margin requirements for hedged positionsdouble margin_divider; // margin dividerchar margin_currency[12];// margin currency// 420 //---- commission calculationdouble comm_base; // basic commissionint comm_type; // basic commission type { COMM_TYPE_MONEY, COMM_TYPE_PIPS, COMM_TYPE_PERCENT }int comm_lots; // commission per lot or per deal { COMMISSION_PER_LOT, COMMISSION_PER_DEAL }// 436 //---- for internal useint from_bar; // fromdate bar numberint to_bar; // todate bar numberint start_period[6]; // number of bar at which the smaller period modeling startedint set_from; // begin date from tester settingsint set_to; // end date from tester settings// 476//----int end_of_test;
int freeze_level; // order's freeze level in pointsint generating_errors;
// 488 //----int reserved[60];
};
void OnStart()
{
//---
int dig=(int)MarketInfo(symb,MODE_DIGITS);
TestHistoryHeader header={0};
ResetLastError();
int handle=FileOpen(symb+"1_0.fxt",FILE_READ|FILE_BIN);
if(handle!=INVALID_HANDLE)
{
FileReadStruct(handle,header);
FileClose(handle);
}
else {Print("Ошибка открытия файла ",GetLastError()); return;}
Print(CharArrayToString(header.description));
Print(CharArrayToString(header.margin_currency));
Print(TOSTRING(header.set_from));
Print(TOSTRING((datetime)header.set_to));
Print(TOSTRING((datetime)header.end_of_test));
Print(TOSTRING(header.tick_value)," Должно быть ", TOSTRING(DoubleToStr(NormalizeDouble(SymbolInfoDouble(symb,SYMBOL_TRADE_TICK_VALUE),dig),dig)));
Print(TOSTRING(header.tick_size)," Должно быть ", TOSTRING(DoubleToStr(NormalizeDouble(SymbolInfoDouble(symb,SYMBOL_TRADE_TICK_SIZE),dig),dig)));
Print(TOSTRING(header.comm_base));
Print(TOSTRING(header.comm_type));
Print(TOSTRING(header.comm_lots));
Print(TOSTRING(AccountCurrency()));
}
When creating a history file, MT4 tester puts TickValue=0, TickSize=0 in the header and the parameters related to the commission, I do not understand what and where? The values of margin fields are also filled in, then not - it's different for different brokers.
...
I guess the problem is because of this strange field:
//---- profit calculation parametersint unknown2;
It wasn't there in the original, where did it come from?
There is no AAPL in the screenshot. And you don't check SymbolSelect return code.
strange so Print gives false even though the screenshot shows that AAPL is in the market overview
ps I already wrote above: the point is to run on one instrument and get data from another... if I wanted AAPL data from AAPL I would have written _Symbol directly
strange so Print gives false even though on the screenshot you can see that there is a aapl in the market overview
ps I already wrote above: The idea is to run on one instrument and get the data from another. If I wanted AAPL data from AAPL I would have written _Symbol
Account number and investor password from you. But I give 99.9% that the symbol "AAPL" on the trading server just does not exist :)
so it gives error 4305
This is how error 4305 comes up
There is no "AAPL" symbol on the trade server you are connecting to. Not at all.
Write "Apple" instead of "AAPL" as in your market review
aaaaaaaaaca )))
got caught up(((.
excuse me)
must be because i have more than one terminal open
Thanks a lot everyone who responded
When creating a history file, MT4 tester puts TickValue=0, TickSize=0 in the header and the parameters related to the commission, I do not understand what and where? The values of margin fields are also filled then not - it's different for different brokers.
This is a bug or may be the wrong header structure? The help on the site says so. I've found that it is outdated and therefore I use this one.
I have marked problematic places in yellow.
Here is a printout of MetaQuotes Demo
Use Robo-Forex printout (suffix ".e")
Now we will connect to any broker.
Increase the symbol history.
Run any EA in the tester on M1 (any testing interval and there is no need to wait for its completion).
After the test, copy thesymb+"1_0.fxt " history file created by the testerto the MQL4/Files directory from the tester folder
Run the script on any chart.
We look at the log.
Occasionally there is a playback of the Home button on the chart in MT5, i.e. the chart shifts arbitrarily to the very beginning - what causes this?
The "Home" button on the chart in MT5 occasionally replayed, i.e. the chart shifts arbitrarily to the very beginning - what caused this?
Dig out the "Home" button with a screwdriver :)
When creating a history file, MT4 tester puts TickValue=0, TickSize=0 in the header and the parameters related to the commission, I do not understand what and where? The values of margin fields are also filled in, then not - it's different for different brokers.
...
I guess the problem is because of this strange field:
It wasn't there in the original, where did it come from?