Forum Replies Created
-
AuthorPosts
-
LeeDanelloParticipant
Julian, I thought you mentioned this in the group call. It’s something I will try and test on my own system.
LeeDanelloParticipantIt goes in the AMIBROKER include folder
LeeDanelloParticipantRecord keeping is an issue I have. I always put a date at the end of the code file name and write comments at the top of my code to let me know of the changes I’ve made. I think I will create a superseded folder in the Amibroker folder tree and archive all the old code in there. Like Craig has stressed it’s good practice to annotate each line of code.
LeeDanelloParticipantWhat about having the system on all the time and turning leverage off and reducing position size when the index filter turns down and then cranking it up when the filter turns up.
LeeDanelloParticipantFrom my understanding that option you 2:1 leverage. I’m not sure you can use leverage on the ASX.
LeeDanelloParticipantYeah paper has many uses
LeeDanelloParticipantThe mean reversion trades are going to start to come into play now.
LeeDanelloParticipantTrent Rothall wrote:Was a bit wild today in the markets!Who knows what/who might follow their lead…
Just think, you’ll know what to do!
LeeDanelloParticipantJust go to “~~~equity” symbol in “symbols” and plot it as a line diagram. That would be the equity from your last back test
Just in case others are interested
LeeDanelloParticipantThanks for confirming that. Obviously need to subtract weekends and public holidays. So the real number is 260/365*512 = 365 days
LeeDanelloParticipantYes I followed Nicks procedure.
Here is the Spreadsheet
From your formula max flat bars = 293
The Spreadsheet calculates 512.Obviously something doesn’t add up
LeeDanelloParticipantI’ve done a bit of a test using the equity curve. The code that Said posted gives me quite a bit of variance
Here is my output
LeeDanelloParticipantCraig Fisher wrote:The code returns trading bars so there should be a small variance between it and the spreadsheet method. The variance would be any weekends included in the spreadsheet calculation from date to date of the longest period.It should be more accurate than the spreadsheet but I had quite a bit of variance. Has anyone compared the numbers?
LeeDanelloParticipantSaid Bitar wrote:two optionsthe easy one and the other one
the easy one is :
Code:SetCustomBacktestProc(“”);
if (Status(“action”) == actionPortfolio)
{
bo = GetBacktesterObject();
bo.Backtest();
Eqty = Foreign(“~~~Equity”, “C”);
MaxEq = Highest(Eqty);
FlatEq = BarsSince(MaxEq > Ref(MaxEq,-1));
MaxFlat = LastValue(Highest(FlatEq));
bo.AddCustomMetric(“Max Flat Eq Bars”, MaxFlat);
}it will return the number of bars (calendar days) if the database is EOD.
the other option is the excel option and they will give the same results
I checked this on my weekly system so to get the number of days I multiplied MaxFlat by 5.
Actually I seem to get different answers between Excel and the code by Said,. I tried it on a daily system. I also checked it by plotting the Equity ticker in Amibroker and even though that is based on the closed equity it aligns with the Excel method, By plotting the ~~~Equity ticker gives you a good visual.
LeeDanelloParticipantJulian Cohen wrote:Said Bitar wrote:it will return the number of bars (calendar days) if the database is EOD.the other option is the excel option and they will give the same results
Where do you place this in the code Said? Does it matter where?
Place it at the end of your system code.
It comes up as the last line in your back test report
-
AuthorPosts