I am currently having some issue with formating some output in the backtest report. In particular, here are some of the things I want to change:
The Date column: I only want the enter and exit date without the time. In other word, I would like to get rid of the 00:00:00 behind the Month/Day/Year
The Entry/Exit price: Some of the entry/exit price appear to have many decimal degits. How do I get rid of the extra digits and keep it nicely in 2 digit decimal place only?
The reason I need the 2 digits format is for me to export it to csv automatically using batch function and then upload to my website.
I am supposed that I could add Custom metric, but I am just wondering if there might be any useful code I could put in my formular or any parameter/setting I could change anywhere?
I'm not sure what code you're using to format the output of your backtest, but you can specify exact number of decimal digits with AddColumn(). For example, AddColumn( Close, "Close", 1.2 ); will format the close price to two decimal places.
Assuming system formatting isn't the issue, I believe - based on the documentation - you should be able to get the date/time, and format it any way you would like for your needs using DateTimeToStr() and/or DateTimeFormat() - though you might have to use AddTextColumn() in your output.
Thank you very much @tallship
I looked into the links you share and many other solutions online.
Eventually, I found an alternative solution: get rid of the whole column with date/time all together and add another column with the right format.
Here is my solution:
Basically the process is to delete the default columns and add my custom columns.