Ok thank you very much. TBH i am not using market orders. My strategy is usually market making strategy to protect myself against the slippage. Averaging down is included my strategy. I "usually" don't lose any *positions* but of course i have some losing contracts. I have tried to explain this. Market does same thing over and over again and if you know how to see those so called hidden patterns then you are good to go.
First of all, what you are describing is just different accounting. Fifo does not produce different final pnl than Lifo. Secondly, IB among many others update the cost basis if you add to positions (long or short) and do not adjust cost basis when you reduce positions. Just as it should be done. Any platform that does not do such does it the non conventional way. But no matter what, it does not make a difference to your actual pnl.
I think I understood you perfectly and I described how it should be done. If you buy 1 your cost basis (=avg px) will be updated, with 1 lot just the actual execution price. Buy another lot and your cost basis gets updated again. Sell one lot and it does not get updated. Buy 5 lots and it gets updated. Sell another 3 lots and it does not get updated. Do you get my drift? Whenever you move away from the zero position line your avg px needs to get updated. When you move closer to the zero position line it does not get updated. If you hold net 5 long and sell 10 then for 5 lots your avg px does not get updated but the remaining 5 that you are now short update the avg px to the avg fill of those 5 last lots. That's how it must be done and is done by any professional trading software application or middle office. If your app or broker does not do that then you have 2 choices 1 leave the broker or app and choose one that suits your needs 2 or access their api and write or let someone write an app that updates your true avg cost basis in real time upon each fill. I can't describe it any better.
I understand, this is not the best "visually" for a scalper who uses charts with multiple entries. Since the FIFO rule is used in the US, I doubt that you will find a platform that would show an entry price average. A solution could be to see all trades really independent to each other, with different logics, entry and exit prices. That would require you to consider that your first trades could be wrong (early entries). Another solution could be to use an API + your program skills.. I don't scalp that way, but I definitely use more than one entry to build a position (see the Tradestation attached picture). I always (forced myself to) see different trades with different results when that happens. Best!
I also recommend SierraCharts. You can set it up as you wish. If it is not implemented, you can implement it as a custom indicator. But I quickly checked and you can adjust it to Last In First Out fill matching for open position average price. Also, I use SierraCharts in Linux, so Mac should not be a big problem to set it up.
If I'm getting what you're saying, I agree. I realized that recently because I trade the same way. So what I do now is I make sure I don't sell any of the contracts until I'm at least into the green of where I bought the first contract, at the highest price. So I don't lose any money when I sell.