Hi,
I am testing a new strategy. If i am testing form 2017 - 2018 - i am getting Trades and results form 2017-2018. That is correct. If i am testing only 2018 - i am getting only one trade and no results (0.00).
Does anyone know why? Thanks.
I have check this also with Data Tools.
greetings
Damir
Size:
Color:
Hi Damir,
I think we need more information to help you. Please right click, copy and paste the Performance report and the Trades view. Please click the '#' button and paste the results between the code tags.
Size:
Color:
A side note. Damir, please try to pick more descriptive titles for your forum threads next time. Before renaming, "Backtest Performance Report" wasn't been that descriptive and at best pointed at a tool and not indicated an issue. A wise man's question contains half the answer they say (but avoids some beaten words like "wealth lab, problem, issue, question or Help" (as I say). In the long run this helps you and others find solutions to common issues by simply running a search. Thanks.
Size:
Color:
Hi Cone,
i did not know if you need Trades only for 2018 or the whole DataRange.
2000- 2018
QUOTE:
All Trades Long Trades Short Trades Buy & Hold
Starting Capital 100.000,00 € 100.000,00 € 100.000,00 € 100.000,00 €
Ending Capital 14.124.806,59 € 10.964.964,88 € 3.259.841,71 € 869.019,07 €
Net Profit 14.024.806,59 € 10.864.964,88 € 3.159.841,71 € 769.019,07 €
Net Profit % 14.024,81% 10.864,96% 3.159,84% 769,02%
Annualized Gain % 31,50% 29,67% 21,26% 12,70%
Exposure 71,42% 67,08% 76,49% 96,73%
Total Commission 0,00 € 0,00 € 0,00 € 0,00 €
Return on Cash 0,00 € 0,00 € 0,00 € 0,00 €
Margin Interest Paid 0,00 € 0,00 € 0,00 € 0,00 €
Dividends Received 0,00 € 0,00 € 0,00 € 0,00 €
Number of Trades 9.485 5.060 4.425 99
Average Profit 1.478,63 € 2.147,23 € 714,09 € 7.767,87 €
Average Profit % 0,88% 1,39% 0,30% 743,33%
Average Bars Held 4,47 5,83 2,91 4.133,31
Winning Trades 5.171 2.847 2.324 85
Win Rate 54,52% 56,26% 52,52% 85,86%
Gross Profit 46.543.732,81 € 30.444.829,85 € 16.098.902,96 € 773.731,67 €
Average Profit 9.000,92 € 10.693,65 € 6.927,24 € 9.102,73 €
Average Profit % 3,63% 4,94% 2,03% 871,48%
Average Bars Held 4,44 5,70 2,90 4.066,56
Max Consecutive Winners 21 29 15 23
Losing Trades 4.314 2.213 2.101 14
Loss Rate 45,48% 43,74% 47,48% 14,14%
Gross Loss -32.518.926,21 € -19.579.864,96 € -12.939.061,25 € -4.712,60 €
Average Loss -7.538,00 € -8.847,66 € -6.158,53 € -336,61 €
Average Loss % -2,42% -3,19% -1,62% -34,76%
Average Bars Held 4,49 5,99 2,92 4.538,57
Max Consecutive Losses 19 19 15 2
Maximum Drawdown -1.723.726,34 € -1.265.133,39 € -1.388.847,53 € -117.230,93 €
Maximum Drawdown Date 15.12.2014 28.09.2015 16.04.2015 09.03.2009
Maximum Drawdown % -23,20% -35,08% -42,24% -50,68%
Maximum Drawdown % Date 08.08.2011 20.11.2008 16.04.2015 09.03.2009
Wealth-Lab Score 33,87 28,72 16,05 6,48
Sharpe Ratio 1,74 1,47 0,99 0,87
Profit Factor 1,43 1,55 1,24 164,18
Recovery Factor 8,14 8,59 2,28 6,56
Payoff Ratio 1,50 1,55 1,25 25,07
Profit / Total Bars 3.080,34 € 2.386,33 € 694,01 € 168,90 €
2018
QUOTE:
All Trades Long Trades Short Trades Buy & Hold
Starting Capital 100.000,00 € 100.000,00 € 100.000,00 € 100.000,00 €
Ending Capital 100.000,00 € 100.000,00 € 100.000,00 € 105.037,28 €
Net Profit 0,00 € 0,00 € 0,00 € 5.037,28 €
Net Profit % 0,00% 0,00% 0,00% 5,04%
Annualized Gain % 0,00% 0,00% 0,00% 85,70%
Exposure 0,00% 0,00% 0,00% 94,39%
Total Commission 0,00 € 0,00 € 0,00 € 0,00 €
Return on Cash 0,00 € 0,00 € 0,00 € 0,00 €
Margin Interest Paid 0,00 € 0,00 € 0,00 € 0,00 €
Dividends Received 0,00 € 0,00 € 0,00 € 0,00 €
Number of Trades 0 0 0 97
Average Profit 0,00 € 0,00 € 0,00 € 51,93 €
Average Profit % 0,00% 0,00% 0,00% 5,11%
Average Bars Held 0,00 0,00 0,00 20,00
Winning Trades 0 0 0 80
Win Rate 0,00% 0,00% 0,00% 82,47%
Gross Profit 0,00 € 0,00 € 0,00 € 5.634,91 €
Average Profit 0,00 € 0,00 € 0,00 € 70,44 €
Average Profit % 0,00% 0,00% 0,00% 6,91%
Average Bars Held 0,00 0,00 0,00 20,00
Max Consecutive Winners 0 0 0 15
Losing Trades 0 0 0 17
Loss Rate 0,00% 0,00% 0,00% 17,53%
Gross Loss 0,00 € 0,00 € 0,00 € -597,63 €
Average Loss 0,00 € 0,00 € 0,00 € -35,15 €
Average Loss % 0,00% 0,00% 0,00% -3,37%
Average Bars Held 0,00 0,00 0,00 20,00
Max Consecutive Losses 0 0 0 2
Maximum Drawdown 0,00 € 0,00 € 0,00 € -2.272,14 €
Maximum Drawdown Date 02.01.2018 02.01.2018 02.01.2018 31.01.2018
Maximum Drawdown % 0,00% 0,00% 0,00% -2,12%
Maximum Drawdown % Date 01.02.2018 01.02.2018 01.02.2018 31.01.2018
Wealth-Lab Score 0,00 0,00 0,00 88,88
Sharpe Ratio 0,00 0,00 0,00 0,00
Profit Factor 0,00 0,00 0,00 9,43
Recovery Factor 0,00 0,00 0,00 2,22
Payoff Ratio 0,00 0,00 0,00 2,05
Profit / Total Bars 0,00 € 0,00 € 0,00 € 239,87 €
CODE:
Please log in to see this code.
greetings
Damir
Size:
Color:
Wow, I've edited out your 9400+ lines of trade logs. Massive logs and exports are better attached to reply as TXT file than pasted.
The "problem" was pretty clear to me but I decided to wait. Now having seen your code just confirms my initial guess:
CODE:
Please log in to see this code.
So I'm pasting my readymade reply from hours ago that I postponed:
"As to your question, I don't see an issue here so far given that there's just 20+ daily bars in 2018 yet and your indicators must be initialized before any trade would take place. For example, a 14-period ATR formally requires 14 bars to be loaded (but to be correct even a 3 times larger seed period). I may be jumping the gun before you followed Cone's suggestion but here's a good read anyway:
GetAllDataForSymbol"
In short, there's no issue here. Either employ
GetAllDataForSymbol in your code or simply load more data e.g. start your backtest in Nov/Dec 2017.
P.S. Are you sure you want to take the value on the bar before the current bar? It's uncommon:
CODE:
Please log in to see this code.
And this line badly peeks into the future and must be fixed:
CODE:
Please log in to see this code.
Size:
Color:
Hi Eugene,
QUOTE:
The "problem" was pretty clear to me but I decided to wait. Now having seen your code just confirms my initial guess:
You are right it was on the 3 time ATR. I have check this with 1 time ATR.
QUOTE:
P.S. Are you sure you want to take the value on the bar before the current bar? It's uncommon:
My thoughts are: if my TBX ends AtMarket (next day on open), what use does it have when my atr is designed for the next day? I think it makes more sense if the Atr is calculated until yesterday Close. What do you think about the logic?
QUOTE:
And this line badly peeks into the future and must be fixed:
Here the same if my TBX end AtClose - what use does it have when my atr is designed for the next day?
greetings
Damir
Size:
Color:
QUOTE:
Here the same if my TBX end AtClose - what use does it have when my atr is designed for the next day?
Damir, here your thinking is incorrect. You're taking the "lb" value for today (
Close - ATR_Short * slider14.Value) which is not available until the close of bar but you act on it by issuing an AtLimit order which operates on the
incomplete bar as if it were closed. As this is impossible in real life the "bar" must be changed to "bar+1" in this code line:
CODE:
Please log in to see this code.
QUOTE:
What do you think about the logic?
I don't know what "TBX" stands for but IMHO you're delaying the calculation for no good reason. Looks like you may be confused with the concept so to put it simple I've just pointed out two errors in your code, one of them (the latter) is pretty grave.
QUOTE:
I have check this with 1 time ATR.
Strange move. Didn't we already discuss this in
Why StochRSI is often at 0 or 100?, post #6?
Size:
Color:
Hi Eugene,
QUOTE:
Strange move. Didn't we already discuss this in Why StochRSI is often at 0 or 100?, post #6?
Correct. I did take 1 time ATR in order to see if i am getting Trades for 2018. Just for checking - Post #1.
QUOTE:
Damir, here your thinking is incorrect. Here you're taking the "lb" value for today which is not available until the close of today's bar but you act on it by exiting with a Limit order during today's bar. As this is impossible in real life the "bar" must be changed to "bar+1" in this code line.
Thank you for the logic.
QUOTE:
I don't know what "TBX" stands for but IMHO you're delaying the calculation for no good reason. Looks like you may be confused with the concept so to put it simple I've just pointed out two errors in your code, one of them (the latter) is pretty grave.
TBX = Time Based Exit
Thank you checking the code.
greetings
Damir
Size:
Color: