I have a very simple question regarding showing a stock description in the backtest report; however, there is something very serious here as well, because it can crash the system, not crash, but Amibroker just completely exit out of Windows without giving an error message.
The variable StockID was defined earlier as: StockID = trade.symbol();
Now when I use the line: bo.AddCustomMetric( "Stock Description :", StrFormat(StockID)); to display the stock description, this failed to left justify. I wish I can make it left justify, but can live with the way it is. (see diagram).
Here is a very interesting line that will crash Amibroker without an error message: adding +10 after strlen(StockID)
bo.AddCustomMetric( "Stock ID :", StrFormat("%-" + strlen(StockID) + 10 + "s", StockID));
The line above will crash Amibroker every time I run the code. Now if I don't add the 10 and just do this:
bo.AddCustomMetric( "Stock ID :", StrFormat("%-" + strlen(StockID) + "s", StockID));
This won't crash Amibroker but it won't left justified. I can add 1, or 2 ... up to 9, still won't left justified properly, but when I add +10, it crash the system.
Please help.