PRELOAD flag

Posted By: schcsaba

PRELOAD flag - 11/29/18 12:47

It seems to me that the PRELOAD flag is only effective in live trading and not in training. Is this true?
Thank you for your answer.
Posted By: AndrewAMD

Re: PRELOAD flag - 11/29/18 13:45

From the manual:
Quote:
PRELOAD
Use Zorro's historical price data, rather than loading price data from the broker's price server or from external data sources. For filling the LookBack period at [Trade] start, the data span between the end of the history and the current time is loaded from the broker or data source. This flag is useful for reducing the trading start time of a system, for overcoming history limitations of broker servers, or for extremely long lookback periods. Recent price history files from the current and the last year must be available; use the Download script for getting the most recent data. Setting this flag also suppresses the warning message in [Test] mode when the lookback period is too long for a normal trading session.

https://zorro-project.com/manual/en/mode.htm
Posted By: schcsaba

Re: PRELOAD flag - 11/29/18 19:30

Thank you for your answer. Yes, I have read this in the manual but based on it I was not completely sure if the flag works in Train mode or not. It doesn't tell anything about training, so I guess it means that it doesn't work in training. However it would be useful if it worked. Thanks again. Csaba
Posted By: AndrewAMD

Re: PRELOAD flag - 11/29/18 19:34

What exactly are you hoping would happen in [Train] mode?

[Train] and [Test] already use existing historical data in your History folder and don't even touch your broker plugin.
Posted By: schcsaba

Re: PRELOAD flag - 11/29/18 20:23

I have downloaded historical data with the Download script through the Metatrader bridge. In the History folder I have a full M1 .t6 file for 2018, but for 2017 I have data only from 11.28 to 12.31. I have no data from the previous years (2013-2016), but the Download script still created 10KB files for those years. However when I run the script below (modified from https://www.financial-hacker.com/binary-options-scam-or-opportunity/), I get "not enough bars" error. I am very new to Zorro, therefore it is quite possible that there are errors in the code.

Code:
var objective()
{
	return ((var)(NumWinLong+NumWinShort))/(NumLossLong+NumLossShort);
}

function run()
{
	BarPeriod = 5;
	LookBack = 100;
	NumWFOCycles = 20;
	NumCores = -1;
	
	set(BINARY);
	WinPayout = 94.2;
	LossPayout = 0;

	set(PARAMETERS);
	int TimePeriod = optimize(20,10,100);
	var m = optimize(0.01, 0.001, 0.05);
	var Threshold = m*(HH(TimePeriod)-LL(TimePeriod));

	if(NumOpenLong+NumOpenShort == 0) 
	{
		LifeTime = 1;
		if(HH(TimePeriod) - priceClose() < Threshold)
		{
			enterShort();
		}
		else if(priceClose() - LL(TimePeriod) < Threshold)
		{
			enterLong();
		}
	}
}

Posted By: AndrewAMD

Re: PRELOAD flag - 11/30/18 03:39

Two things:

* You have limited historical data, courtesy of MT4/5, so it's probably smart to set StartDate and EndDate.
* Also consider sourcing historical data from other sources if Metatrader's supply is insufficient. For example, FXCM and Oanda give you free data via their demo accounts. Also, check the downloads page to see if it has the data you need.
Posted By: schcsaba

Re: PRELOAD flag - 11/30/18 07:58

I have set StartDate and EndDate and now it works. Thank you very much!
© 2024 lite-C Forums