I am currently working on Backtest Portfolio with Amibroker 6.30.5 64bit.
I run Backtest with Daily Periodicity on 5m base interval data.
However, the result list show unexpected information. Since I run it with Daily Periodicity, I was expecting that the signal evaluation will be done daily. But the result list show signal evaluation per 5m, as can be seen in the picture below. Am I expecting the wrong behavior, or I miss something here?
Does any one have any clue about this issue? Or If there are anyone can pointing me to the right direction on knowledge base or else, I will appreciate that.
You did not say what I asked for: what is the DATA SOURCE?
From WHERE did you get data from. This obviously is data error and knowing data source is crucial.
Guessing from names of the path, you might have imported Metastock data from unknown source (again you did not say).
Looks like the data were imported incorrectly. Instead of importing Metastock data use the MS plugin as instructed here http://www.amibroker.com/guide/h_extsources.html
How can I know if my data is error or not? based on the chart visual above, what do you think?
Regarding metastock, I am not using that data. I've got the data from local provider here, and imported using above format. Do you think the format that I used incorrect?
What other information do you think you will need to be able to help me on this issue?
I can't reproduce any problem on my end using the data that you supplied - I am getting one bar per day all the time when Periodicity is set to daily.
What you can do however is to run Exploration using this simple code:
Filter = 1;
AddColumn( Close, "Close" );
You should see one bar per day if Periodicity is set to "Daily". If you don't, you can try the following:
In File->Database Settings change "Base time interval" to 1-minute, then press OK, re-run Exploration
Once you got to the point that Exploration gives you one bar per day, Backtest would do the same.
I run the exploration with your code, Daily periodicity and 1 recent days of Range: it worked, only show 1 bar per quote. ( I did not change the base time interval to 1m, since the previous step works)
I run individual backtest, it showed 1-2 evaluation per day
However if I do portofolio backtest, it showed multiple evaluation per day
This means that the OTHER symbol (included in portfolio backtest), NOT BMRI, but DIFFERENT one, has BAD data. This is so because portfolio backtest creates bars for EVERY bar present in ANY security under portfolio test. If one symbol included has bad data it will affect entire portfolio backtest.
One thing to watch for:
Your data file is using Date AND Time in ONE field
Such field can NOT be imported as date only field (MDY).
// NO comma between date and time part !
BMRI,1/2/2019 9:05:00 AM,7400.00,7400.00,7350.00,7350.00,456200,-149992496
To import intraday data YOU MUST HAVE separator (comma) between DATE and TIME part. You should insert COMMA between date and time part of your data file or use 24 hour format without AM/PM and "Comma or space" as separator
Alternatively you can try to use (Comma or space) as separator in Import Wizard, but this may be problematic because you are using time format that has AM/PM so there is ANOTHER space between TIME part and AM/PM string.
So it is recommended to use proper INPUT format, i.e with COMMA between date and time part.
I am sorry, it seems like the data I sent to you different with the original data on the datetime part. the original data already use 24 hours format (https://file.io/msBt18z4dqTQ) (todays data), and the way I import the data exactly the same as what you suggested, using comma or space.
The one I sent to you is from the database I exported to get 2 years of data. the original data is chucking daily, so for easier sharing, I exported from the database.
I run backtest to single quote BMRI, it worked
In this case, it seems like the other quotes in the portofolio may have bad data.
let me check. By the way, thank you for your prompt response
Hi @Tomasz would you help pointing me to the user manual about the Database Purify. I went through this AmiBroker 6.20 User's Guide and cannot find the detail for this feature. I want to understand more about each of the setup for purification process.
I followed some information from other threads I found. I used index ( in this case COMPOSITE) and checked all the checkbox for all symbols, since I am not sure BMRI is "align". it's half the way (50%) for about an hour. quite long time to process. while the app analyze the quote, I was planning to understand more about each of the option such as:
invalid OHLC relationship. (what it is and how to resolve it if it happen?)
missing quote (is this about missing row data for particular bar in referred symbol)
Composite is bad choice because it is likely to have those invalid accumulated invalid bars if you created it from same set of symbols that you run portfolio backtest on.
Use BMRI as I wrote you before.
Also process should be quick - it is generally as long as it takes to read those data files (depends on disk speed). Definitely not hours. Either you have very slow disk or the size of data is gigantic.
Composite is bad choice because it is likely to have those invalid accumulated invalid bars if you created it from same set of symbols that you run portfolio backtest on.
Use BMRI as I wrote you before.
Understood, will do this.
Also process should be quick - it is generally as long as it takes to read those data files (depends on disk speed). Definitely not hours. Either you have very slow disk or the size of data is gigantic.
the data is 5 minutes TF for 2 years, yes I dont think it is gigantic in size. The whole process take almost 2 hours for ~900 symbols (total folder size ~450MB). My computer use SSD, and it should be fast enough.
The thing is, after it's done, I export the result into watchlist. The symbols that has issue reported have the same number with the symbol in the database... it seems like every symbol does not aligned well with the reference. since the number is alot, I dont know how to fix it.
Are there any way to export the result into csv, instead of watchlist. exporting to watch list remove the issue detail.