Something Wrong!

Posted By: MatPed

Something Wrong! - 02/13/16 11:19

Hi,The same strategy tested with the following Assets:
#define ASSETLOOP "AUD/USD", "USD/CHF", "EUR/USD", "GBP/USD", "USD/CAD", "USD/JPY", "GER30", "NAS100", "SPX500", "UK100", "US30", "XAG/USD", "XAU/USD"

And

//#define ASSETLOOP "GER30", "NAS100", "SPX500", "UK100", "US30", "XAG/USD", "XAU/USD", "AUD/USD", "USD/CHF", "EUR/USD", "GBP/USD", "USD/CAD", "USD/JPY"

i.e same assets just different order, produces totally different values.
What is strange is that the number of WFO are different. I guess this should not be the case. Hope this helps

Thank You
Posted By: Veratyr

Re: Something Wrong! - 02/13/16 19:33

This doesn't really help at all without seeing the strategy. It's a loop so it seems likely you've done something in your strategy such that a loop iteration affects subsequent iterations.

For example if your loop spends all your money on the iteration, you're going to end up with a 100% AUDUSD portfolio on the first asset list and 100% GER30 on the second.
Posted By: boatman

Re: Something Wrong! - 02/13/16 23:18

The order of the assets affects the set up of the price history bars. The first asset in the loop is used to create an array for the bars, therefore any gaps in the price history of the first asset are reflected in the price data for subsequent assets. This will affect WFO cycles and backtest results more generally.

This is documented in the manual (somewhere!) although it is not easy to find.

I always start my asset loops with EUR/USD as this is the most complete price history I have on file. This is enough to ensure consistent results between runs.

Another useful tool: set the GapDays parameter to 2 in the initial run of the script. This will then print a warning message if any data gaps are found in any of the assets' price histories. Although it doesn't fix the gaps, at least it makes you aware that they exist and you can account for them accordingly.

Hope that helps.
Posted By: MatPed

Re: Something Wrong! - 02/15/16 08:44

No problem in posting the strategy but the issue is not related the profitability but the number of the wfo.
this is the main file. The only difference is the definition of ASSETLOOP:
#include <default.c>
#include <profile.c>
#include "Strategy\FatStrategy\definitions.c"
#include "Strategy\FatStrategy\miscFunc.c"
#include "Strategy\FatStrategy\myTmf.c"
#include "Strategy\FatStrategy\myAlgo.c"

function tradeFunc(); // empty function pointer

function run()
{
setFlag();

BarPeriod = 240;
LookBack = 600;

StartDate = 2010;
DataSplit = 90;
WFOPeriod = (6*5*19)*DataSplit/(100-DataSplit); // (numBarPerDay*numTradingDayPerAWeek*numWeek)

theSlider();

// portfolio loop
while(loop(ASSETLOOP))
while(tradeFunc = loop(ALGOLOOP))
{
asset(Loop1); // select asset
checkEquity();
tradeFunc(); // call the trade function
}

if (!Train) {
PlotWidth = 600;
PlotHeight1 = 300;
ColorUp = ColorDn = ColorWin = ColorLoss = 0; // don't plot candles and trades
set(TESTNOW+PLOTNOW);
}
// plot for test
if(Test) {
// plotMAEGraph (-15);
// plotTradeProfile (100);
}
}

If you need the other file. I will attache it later
Ciao
Posted By: boatman

Re: Something Wrong! - 02/16/16 01:27

I stand by my response: if you look at the first asset in the loop, you will find that its length and gaps are reflected in all the subsequent assets in the loop. Use the asset with the most complete history as the first in the loop.
© 2024 lite-C Forums