My code was working fine in the earlier version of amibroker. Just upgraded to latest amibroker and for the openlongpositions it shows “invaliddatetime”

backtest works fine otherwise, the only thing it messes is CAR (compounded annual return). When i change the timeframe to ‘daily’ the error goes away. but as soon as i put weekly, invaliddatetime shows up against openlongpositions.

What DATA SOURCE you are using?
Most likely you are using 3rd party unsupported data source that feeds you with invalid datetime stamps.