|
Binary Options Bugs
#462797
10/29/16 12:10
10/29/16 12:10
|
Joined: Aug 2016
Posts: 95 Wien
trenki2
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2016
Posts: 95
Wien
|
I have experimented with the binary options script from the financial hacker blog. Below is the code that I use:
var objective()
{
return ((var)(NumWinLong+NumWinShort))/(NumLossLong+NumLossShort);
}
function run()
{
//assetList("AssetsFix.csv");
//assetList("AssetsBinary.csv");
BarPeriod = 5;
LookBack = 100;
NumWFOCycles = 20;
NumCores = -1;
set(BINARY);
WinPayout = 75;
LossPayout = 0;
set(PARAMETERS);
int TimePeriod = optimize(20,10,100);
var Threshold = 0.01*(HH(TimePeriod)-LL(TimePeriod));
while (asset(loop("EUR/USD")))
{
if(NumOpenLong+NumOpenShort == 0)
{
LifeTime = 1;
if(HH(TimePeriod) - priceClose() < Threshold)
enterShort();
else if(priceClose() - LL(TimePeriod) < Threshold)
enterLong();
}
}
}
When training and running it on EUR/USD with the provided Zorro 1.5 t6 history I get a total loss while the blog reports an AR of about 180%. When training and running it on .bar history with Dukascopy data i got a different result. There I was profitable with a SR of 0.77. But doing multiple training runs did not always produce the same results! Once I only got a SR of 0.20! Since the broker symbol is actually EUR/USD.bo i needed to create a different Assets file by copying the AssetsFix.csv file and changing the symbol names. I did that and noticed totally different results again. Even uncommenting the line assetList("AssetsFix.csv"); after training changes the testing result substantially. And when training with the AssetsFix.csv the results are different once more. I thought the AssetsFix.csv is the default, so adding this line should not change the results. I think also the while(asset(loop())) construct causes some problems. This is the only difference between the original code from the blog and the blog code gives different results when backtested.
|
|
|
Re: Binary Options Bugs
[Re: jcl]
#462845
10/31/16 17:03
10/31/16 17:03
|
Joined: Aug 2016
Posts: 95 Wien
trenki2
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2016
Posts: 95
Wien
|
I uninstalled Zorro S 1.50.6 and reinstalled it and took the history from the download page. When i take the code from the financial hacker blog an train and test it I can confirm, that I get the same result as you posted in your screenshot. But when I modify that script and add the while(asset(loop("EUR/USD"))) construct, train and test I get a different result! This behavior is reproducible: This code
var objective()
{
return ((var)(NumWinLong+NumWinShort))/(NumLossLong+NumLossShort);
}
function run()
{
BarPeriod = 5;
LookBack = 100;
NumWFOCycles = 20;
NumCores = -1;
set(BINARY);
WinPayout = 75;
LossPayout = 0;
set(PARAMETERS);
int TimePeriod = optimize(20,10,100);
var Threshold = 0.01*(HH(TimePeriod)-LL(TimePeriod));
while (asset(loop("EUR/USD")))
{
if(NumOpenLong+NumOpenShort == 0)
{
LifeTime = 1;
if(HH(TimePeriod) - priceClose() < Threshold)
enterShort();
else if(priceClose() - LL(TimePeriod) < Threshold)
enterLong();
}
}
}
gives this result:
Walk-Forward Test: Test8 EUR/USD 2011..2016
[...]
Profit -5$ MI -0$ DD 16$ Capital 23$
Trades 493 Win 56.6% Avg -0.1p Bars 1
AR -5% PF 0.98 SR -0.10 UI 74% R2 0.00
When i now add the line assetList("AssetsFix.csv"); to the script and test again without training i get this code:
var objective()
{
return ((var)(NumWinLong+NumWinShort))/(NumLossLong+NumLossShort);
}
function run()
{
assetList("AssetsFix.csv");
BarPeriod = 5;
LookBack = 100;
NumWFOCycles = 20;
NumCores = -1;
set(BINARY);
WinPayout = 75;
LossPayout = 0;
set(PARAMETERS);
int TimePeriod = optimize(20,10,100);
var Threshold = 0.01*(HH(TimePeriod)-LL(TimePeriod));
while (asset(loop("EUR/USD")))
{
if(NumOpenLong+NumOpenShort == 0)
{
LifeTime = 1;
if(HH(TimePeriod) - priceClose() < Threshold)
enterShort();
else if(priceClose() - LL(TimePeriod) < Threshold)
enterLong();
}
}
}
With the following result:
Walk-Forward Test: Test8 EUR/USD 2011..2016
Account AssetsFix.csv
[...]
Profit -103$ MI -2$ DD 104$ Capital 96$
Trades 493 Win 45.2% Avg -2.4p Bars 1
AR -24% PF 0.62 SR -2.10 UI 100% R2 0.87
I have described the steps to reproduce this behavior in detail. You should be able to copy the exact above code and reproduce it yourself. Zorro is freshly installed and the history comes directly from the Zorro homepage so that can't be the issue here.
Last edited by trenki2; 10/31/16 17:06.
|
|
|
Re: Binary Options Bugs
[Re: trenki2]
#462902
11/03/16 18:37
11/03/16 18:37
|
Joined: May 2016
Posts: 180 Prague
pcz
Member
|
Member
Joined: May 2016
Posts: 180
Prague
|
Can someone test this and report their results? Just tried it very quicky and I get similar results to yours.
|
|
|
Re: Binary Options Bugs
[Re: pcz]
#462908
11/04/16 10:07
11/04/16 10:07
|
Joined: Jul 2000
Posts: 27,986 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,986
Frankfurt
|
Reinstalling Zorro normally won't help when something does not work. When you get different results, compare the logs. Then you'll normally quickly see the reason.
I suspect several reasons. First, you did not train the system. Since a portfolio strategy has different parameter files than a single-asset strategy, you must train it again when you made such a modification. Second, you did not trade with payout. The "AssetsFix" file is set up for normal trading with spread and commmission, so you must alter asset parameters for binary trading when you explicitly load it. And select the asset before modifying them, like this:
while (asset(loop("EUR/USD"))) { ... WinPayout = 75; LossPayout = 0; Spread = Commission = 0; ...
I don't know if this is the whole problem, but anyway if this does not help, please post again and I'll look into it.
|
|
|
Re: Binary Options Bugs
[Re: jcl]
#462910
11/04/16 11:46
11/04/16 11:46
|
Joined: Aug 2016
Posts: 95 Wien
trenki2
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2016
Posts: 95
Wien
|
Hi jcl, I actually did train the system and got the results that i posted. I did exactly as I described above. I now also tried to move the WinPayout and LossPayout variabeles inside the while loop as that makes sense but I still get the same result as in my previous post: This code:
var objective()
{
return ((var)(NumWinLong+NumWinShort))/(NumLossLong+NumLossShort);
}
function run()
{
//assetList("AssetsFix.csv");
BarPeriod = 5;
LookBack = 100;
NumWFOCycles = 20;
NumCores = -1;
set(BINARY);
set(PARAMETERS);
int TimePeriod = optimize(20,10,100);
var Threshold = 0.01*(HH(TimePeriod)-LL(TimePeriod));
while (asset(loop("EUR/USD")))
{
WinPayout = 75;
LossPayout = 0;
if(NumOpenLong+NumOpenShort == 0)
{
LifeTime = 1;
if(HH(TimePeriod) - priceClose() < Threshold)
enterShort();
else if(priceClose() - LL(TimePeriod) < Threshold)
enterLong();
}
}
}
Gives this result:
Walk-Forward Test: Binary EUR/USD 2011..2016
Profit -5$ MI -0$ DD 16$ Capital 23$
Trades 493 Win 56.6% Avg -0.1p Bars 1
AR -5% PF 0.98 SR -0.10 UI 74% R2 0.00
And there is still the weird issue when I uncomment and test with the assetList line, that the results become different again. I then get these results:
Walk-Forward Test: Binary EUR/USD 2011..2016
Account AssetsFix.csv
Profit -103$ MI -2$ DD 104$ Capital 96$
Trades 493 Win 45.2% Avg -2.4p Bars 1
AR -24% PF 0.62 SR -2.10 UI 100% R2 0.87
|
|
|
|