Strategy Performance report issues when using "as-traded" prices

We are using daily Norgate data that provides the "as-traded" close price everyday in the OpenInterest field. We use this price to compute the Open, High, and Low for each day too. With this we construct OHLC bars to backtest against. At first we had some issues, but once we set these two options everything started to work right:
SetOption( "DisableRuinStop", True );
SetOption( "PriceBoundChecking", False ) ;

The backtest trade list is correct, and it checks out against trades on the charts too. Some statistics are right on the strategy backtest report, but others are off big. For instance look at exposure (how can this be negative?), Max. trade drawdown, Max. system drawdown, Net risk adjusted return, and Risk Adjusted Return.


Also to note, when we use adjusted (regular) prices these issues go away.

What can cause this? Are there any other settings we should be aware of that could potentially correct this?

1 Like

AmiBroker calculates those metrics using what it considers to be the "real" prices, i.e. the actual OHLC prices in your database. If you're not going to use the adjusted prices anyway, why not just turn off price adjustments in your database so that the OHLC fields contain the "as traded" prices which you can then use without all the extra work?

1 Like

I did not know that was possible. Could you please tell me how?

If you are using Norgate NDU, just go to File / Database Settings / Configure and select the radio button for "No adjustment".

If you are using the old Norgate Premium Data, I would strongly suggest that you subscribe to NDU Platinum instead. You should be able to apply your remaining Premium Data subscription to your new NDU subscription.


If you are using the old Norgate Premium Data you also have the option of adjusting prices at the beginning of your formula. The OpenInt field contains the original closing price for stocks.

splitRatio = OpenInt / Close;
Open *= splitRatio;
High *= splitRatio;
Low *= splitRatio;
Close *= splitRatio;
Volume /= splitRatio;

Then make sure that any prices used during the backtest are taken from the recalculated price arrays. Populate the BuyPrice, SellPrice, ShortPrice and CoverPrice arrays with the appropriate prices.

1 Like

@bigalgator your method is very similar to the one I used, but the issue still remains using that method.

I saw that @mradtke posted the solution after finishing my post. I didn’t realize that the backtester used prices straight from the database. Good to know.

What was the reason for negative exposure %? I didn't see it mentioned.

@Tomasz is there any way we can get the strategy performance report to reflect these "as-traded" prices instead of the database prices?

No what you are doing is fundamentally wrong. Ruin stop should NOT be turned off and price checking should NOT be turned off. Use prices as they are present in the database.