Alain Verleyen:
Thanks Alain.
cstangor: I only get 6 out of the 101 daily bars in the strategy test:
| Download more history (D1 and lower.) Quickly DL all available history from your broker: Problem loading historical data - MQL4 forum |
cstangor:
OK, well that seems like a good idea, but I cannot seem to make it happen in MT5 from my live AMP CQG account. My data sync keeps timing out. I don't need ticks. Can I request only minutes not ticks?
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
Sorry, newbie here:
I have the NQ futures contract back to August in a daily chart.
I'm trying to program an EA.
I only get 6 out of the 101 daily bars in the strategy test:
2016.12.06 08:22:47.037 Core 1 connecting to 127.0.0.1:3000
2016.12.06 08:22:47.039 Core 1 connected
2016.12.06 08:22:47.040 Core 1 authorized (agent build 1491)
2016.12.06 08:22:47.044 Tester ENQZ6,Daily (AMPGlobalClearing-Demo-CQG): testing of Experts\test_2.ex5 from 2016.08.01 00:00 to 2016.12.05 00:00
2016.12.06 08:22:47.072 Core 1 common synchronization completed
2016.12.06 08:22:47.111 Tester quality of analyzed history is 22% (86396 minute bars, tick volume errors 0, spread errors 65474)
2016.12.06 08:22:47.152 Core 1 login (build 1491)
2016.12.06 08:22:47.152 Core 1 account info found
2016.12.06 08:22:47.152 Core 1 1482 bytes of tester parameters loaded
2016.12.06 08:22:47.152 Core 1 expert file added: Experts\test_2.ex5. 7924 bytes loaded
2016.12.06 08:22:47.152 Core 1 initial deposit 10000.00 USD, leverage 1:200
2016.12.06 08:22:47.152 Core 1 successfully initialized
2016.12.06 08:22:47.152 Core 1 9559 bytes of total initialization data received
2016.12.06 08:22:47.152 Core 1 Intel Core i5-6200U @ 2.30GHz, 8043 MB
2016.12.06 08:22:47.152 Core 1 ENQZ6: load 25 bytes of history data to synchronize in 0:00:00.016
2016.12.06 08:22:47.152 Core 1 ENQZ6: history synchronized from 2016.08.01 to 2016.12.05
2016.12.06 08:22:47.152 Core 1 ENQZ6,Daily: history cache allocated for 502 bars and contains 101 bars from 2016.08.01 00:00 to 2016.11.27 00:00
2016.12.06 08:22:47.152 Core 1 ENQZ6,Daily: history begins from 2016.08.01 00:00
2016.12.06 08:22:47.152 Core 1 ENQZ6,Daily (AMPGlobalClearing-Demo-CQG): 1 minutes OHLC ticks generating
2016.12.06 08:22:47.152 Core 1 ENQZ6,Daily: testing of Experts\test_2.ex5 from 2016.11.28 00:00 to 2016.12.05 00:00 started
2016.12.06 08:22:47.152 Core 1 2016.11.28 00:00:00 Checking @ 2016.11.28 00:00:00
2016.12.06 08:22:47.152 Core 1 2016.11.29 00:00:00 Checking @ 2016.11.29 00:00:00
2016.12.06 08:22:47.152 Core 1 2016.11.30 00:00:00 Checking @ 2016.11.30 00:00:00
2016.12.06 08:22:47.152 Core 1 2016.12.01 00:00:00 Checking @ 2016.12.01 00:00:00
2016.12.06 08:22:47.152 Core 1 2016.12.02 00:00:00 Checking @ 2016.12.02 00:00:00
2016.12.06 08:22:47.152 Core 1 2016.12.04 23:00:00 Checking @ 2016.12.04 00:00:00
2016.12.06 08:22:47.152 Core 1 final balance 10000.00 USD
2016.12.06 08:22:47.152 Core 1 ENQZ6,Daily: 24189 ticks, 6 bars generated. Environment synchronized in 0:00:00.031. Test passed in 0:00:00.062.
2016.12.06 08:22:47.152 Core 1 ENQZ6,Daily: total time from login to stop testing 0:00:00.093 (including 0:00:00.031 for history data synchronization)
2016.12.06 08:22:47.152 Core 1 1 Mb memory used including 0.47 Mb of history data, 64 Mb of tick data
2016.12.06 08:22:47.152 Core 1 log file "C:\Users\charles\AppData\Roaming\MetaQuotes\Tester\65D1CFCD3F6A1A06FDD09AF8B01AA7EF\Agent-127.0.0.1-3000\logs\20161206.log" written
2016.12.06 08:22:47.165 Core 1 connection closed
Here's my code... Thanks in advance.
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
MqlRates rt[];
//Why does BarCount have to be == 1?
int BarCount = 1;
if(CopyRates(_Symbol,_Period,0,BarCount,rt)!=BarCount)
{
Print("CopyRates of ",_Symbol," failed");
Print(_LastError);
return;
}
//Exit unless it's a new bar (with 0 volume)
if(rt[0].tick_volume>1) return;
//Get the times...
datetime times[];
int time_ = CopyTime(NULL, 0, 0, 1,times);
Print("Checking @ " + string(times[0]) + " " + string(rt[0].open));