bo.Equity gives equity at the end of last bar

I wanted to know bo.Equity gives equity at end of current bar or last bar..? Printing it in debug view i see it giving me equity of last bar. Is it correct or i am seeing something wrong ?

As described in the documenation, bo.Equity will give you the current equity. Are you using a mid or low level CBT? It would be a lot easier to answer your question if you would post your code to give us some context.

How is current equity being calculated? What price (O,H,L,C) from the current bar being used to calculate equity value? In low level CBT, can one get equity value at the end of last bar?

You need to verify your license. See this post: License Verified badge

If you're using bo.Equity to get the current equity, then the prices that are used will depend on what values you've used to call bo.UpdateStats(). I suggest you add some _TRACE statements to your code and run a very simple backtest with only one symbol so that you can easily see what's going on.

  1. Generally speaking Equity is calculated using close price.
  2. You should not be using low level backtester if you ask such questions (as it shows you are beginner).
1 Like