Buy 100 shares at $10
Buy 100 shares at $11
Sell 100 shares at $10.50 (price here is unimportant).
NinjaTrader (by default I think), does Last In First Out (LIFO) for Average prices shown on the chart. For simplicity assume that everything is done with limit orders and fills at exactly the price the limit order specifies.
LIFO | FIFO | |
Buy 100 shares @ $10 | 10.00 | 10.00 |
Buy 100 shares @ $11 | 10.50 | 10.50 |
Sell 100 shares @ $10.50 | 10 | 11 |
For FIFO, step 3 involves selling off all shares at 10$ leaving an average price now of 11.
When using a simulated account, and checking the box in the options "Use FIFO for position average price calculations" NinjaTrader shows exactly what is shown in FIFO column. With the option unchecked, the once the average price stays at 10.50, regardless of how much is sold.
When in LIFO mode, the simulator only changes the average price when shares are added to the position. The average price never moves when shares are removed. For example consider
- Buy 100 shares @10 - NinjaTrader shows 10
- Buy 100 shares @11 - NinjaTrader shows 10.50
- Sell 50 shares @12 - NinjaTrader still shows 10.50
- Buy 100 shares @13 - NinjaTrader shows 11.33
- Sell 150 shares @14 - NinjaTrader shows 11.33
- 10
- 11.50
- 10.33
- 11.40
- 10
Why does the average price never drop as one exits a position in LIFO mode?
Comment