Login Page - Create Account

Support Board


Date/Time: Tue, 11 Mar 2025 17:48:41 +0000



flat to flat open position average price calculation

View Count: 2191

[2019-04-03 19:09:56]
User753428 - Posts: 171
The way that flat to flat open position average price is calculated in SC is that it takes the average of all prices at which a position was entered until the position is completely flattened to zero.

This creates an inaccuracy when you scale out and then scale back in again.

For example,

Let's say I:

1) buy 1 NQ at 7500

2) buy 1 NQ at 7510

3) buy 1 NQ at 7520

at this point, my flat to flat open position average price would be +3 NQ @ 7510.

4) then i sell 2 NQ at 7530; now my flat to flat open position is +1 NQ @ 7510.

5) then i re-enter and buy 1 NQ at 7520.

at this point, my flat to flat open position average price should technically be 7515, since it's (1*7510+1*7520)/2

but the way SC calculates flat to flat open position average price is that it disregards any scaling out that i had done previously and instead, continues to include every single buy fill in the flat to flat open position average price even after having been scaled out.

so in this case, when i re-enter and buy 1 NQ at 7520 in step 5), my new flat to flat open position average price is actually calculated like this:

[(7500*1)+(7510*1)+(7520*1)+(7520*1)]/4 = 7512.5

Perhaps this is as intended by SC's design. However, not only is this incredibly unintuitive, during all my years trading, I have not once used a futures trading platform that computes the flat to flat open position like this; in fact, i have yet to see even a single crypto platform/exchange calculate flat to flat like this.

and it makes sense as to why they do not calculate flat to flat like this.

traders want to know what the average price of their currently OPEN positions are in real-time, accurately and quickly so they can immediately know at which price point the price has to cross before the PnL of their cumulative OPEN positions goes into the red.

at least under SC's current methodology, it should not be called flat to flat "open" position average price calculation in any case.
[2019-04-03 21:55:57]
Sierra Chart Engineering - Posts: 104368
This is a perfectly valid Position Average Price calculation method and it has been relied on by some Sierra Chart users for a long time now. If you do not like it or you do not agree with it, then simply do not use it. Not sure what the purpose of the post is. There are several other calculation methods you can use instead.

There will not be any changes to it because it is done correctly. It was recently reimplemented but the calculation method is the same, but we will double check that. We are not going to change the name either because that is the name that has been used for a long time now. And it does indicate that it is performing a calculation from flat to flat using the fill prices that match with the side of the position.

This is what you are telling all of the users who have relied on this for the last seven years or so and who understand and want that calculation method:
. However, not only is this incredibly unintuitive, during all my years trading, I have not once used a futures trading platform that computes the flat to flat open position like this; in fact, i have yet to see even a single crypto platform/exchange calculate flat to flat like this.

Now if we have made a mistake in the recent reimplementation of it we will correct that but looking at it now, it does not appear so.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2019-04-03 22:01:54
[2019-04-03 23:06:28]
User753428 - Posts: 171
There will not be any changes to it because it is done correctly.

That's why I wrote
Perhaps this is as intended by SC's design.
because I was open to the possibility that this was done intentionally. Like you said, it is a valid position average price calculation method and I am sure there are some SC users who rely on it, knowing exactly how the average is being calculated. I can already think of some uses for this particular calculation method.

But I am saying that it is not an "open" position average price calculation like the name implies and people are and will be confused by it. I can say with 100% certainty that for someone's who's new to SC, their initial layman's understanding of flat-to-flat average price calculation is the method which I mentioned in my 1st post because that is how it is done in almost all other platforms that offer an average price calculation method for open orders.

That is why they will inevitably run into confusion later on when they have a multi-contract order and scale-out partially, and then scale-in again. Then they will try to search why this is occurring by reading your documentation and finally realize, "oh, so technically it is NOT an average of my open positions but an average of every single position i opened since the first opening position, including the ones I already scaled out." This is what I mean by it being "unintuitive."

"If you do not like it or you do not agree with it, then simply do not use it. Not sure what the purpose of the post is. There are several other calculation methods you can use instead."


I would not be writing this post if SC also offered the standard way of calculating the open position average price like other platforms do. But SC does not, so that's why I'm writing to ask if you can. If you don't want to, then that's that. I am content with LIFO but many people who come to SC from other platforms or from crypto can be initially confused by SC's way of calculating the average price since it is not an average of the open orders, which is the way it is everywhere else. In fact, in crypto, it is THE ONLY way of calculating the position price. It can only be helpful to YOU for you to be aware of this. It is your decision whether or not you want to address it so don't take this the wrong way.

This is what you are telling all of the users who have relied on this for the last seven years or so and who understand and want that calculation method:

You're trying to frame that line as if I somehow insulted "all of the users who have relied on this for the last seven years or so and who understand and want that calculation method." You are being needlessly contentious. First, I am sure that there are people who wanted your specific way of calculating the average price; after all, it is why you must have implemented it specifically this way in the first place.

But you have to realize that for most people, this is probably not ever noticed. Some people simply enter at once and exit at once. Many people scale-in or enter a position, and then simply scale-out until completely flattened; these are people to whom your calculation method will make no difference compared to a true average calculation on only the open positions. Many of these people won't ever be aware that the average that's being calculated actually isn't based on the open positions. Heck, I've used SC for a while and only discovered this last month!

Fewer people are scaling-in, scaling-out partially, then scaling-in again, and then scaling out partially again. The reason is b/c trading this way requires much higher capitalization with a high # of lots/contracts, and is also more applicable to those trading daily/weekly timeframes (instead of daytrading 20-point ranges on the ES) which require high exchange margins and SC is primarily a retail platform.
Date Time Of Last Edit: 2019-04-03 23:31:25
[2019-04-04 21:28:44]
Sierra Chart Engineering - Posts: 104368
We are very very puzzled by this. To say that Sierra Chart does not calculate average price of a Position correctly and does not offer what you want makes no sense at all. There are several different calculation methods here:
Trading Information Windows: How Average Price for Positions Is Calculated and Used

To calculate the position average price properly requires that there are no missing order fills and possibly there are in your case. To avoid this issue, use this service:
Sierra Chart / Trading Technologies Futures Order Routing Service

You are also talking about scaling in and out extensively. This is completely irrelevant to a position calculation. A position consists of unmatched fills. How those fills arise is completely irrelevant. There are two standard methods of matching of fills in order to reduce the position quantity and therefore result in what order fills remain and therefore what fills will participate in the current position average price calculation. There is LIFO and FIFO. Both of these are fully supported and can be selected.

The proper terminology here is not open orders but unmatched fills or open trades (Or sub trades).
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2019-04-04 21:40:55
[2019-04-04 23:24:59]
User753428 - Posts: 171
Okay I can see why you are confused and this is not the biggest deal ever so no worries. Even if this is not implemented, SC is still the best retail platform out there, that is a fact.

To say that Sierra Chart does not calculate average price of a Position correctly

No, there are no errors in your calculation implementations, whether it's for FIFO, LIFO, Flat to Flat Open Position Average Price as you have defined them in your documentation. I use them extensively and they are all done correctly afaic.

does not offer what you want makes no sense at all

Okay so I'll try to be more clear here. Your 'Flat to Flat Open Position Average Price' method is quite different from the 'analogous" method offered in other platforms. As mentioned in the documentation for this method,
The Flat to Flat Average Price changes as new entry order fills are made. Exit order fills have no effect until the Trade Position goes to 0. Unlike the other average price calculations, this is not just an average of the remaining open fills which make up the current Trade Position.

The way other platforms usually calculate this sort of open position average price and that many people like me are accustomed to is this (I have simply edited the excerpt from your 'Flat to Flat Open Position Average Price' documentation and made the modifications so as to be extra clear):

The Average Price changes as new entry order fills are made. Exit order fills have no effect on the average price but decrease the weight (position size) at the average price. When exit order fills that do not bring the Trade Position to 0 are executed, and afterwards additional new entry order fills are made, the new average price is the weighted average of the previous average price and the prices of new entry order fills. Like the other average price calculations, this is an average of the remaining open fills which make up the current Trade Position.

I hope that makes sense. If it doesn't, just go back and re-read the trade example I posted in my OP. It should be pretty clear.

There are two standard methods of matching of fills in order to reduce the position quantity and therefore result in what order fills remain and therefore what fills will participate in the current position average price calculation. There is LIFO and FIFO. Both of these are fully supported and can be selected.

Yes, LIFO and FIFO are two of the standards. I am saying that the average price calculation I just described is also another standard that is commonly used, at least from my experience. The advantage that this method has over LIFO or FIFO or SC's 'Flat to Flat Open Position Average Price' is that it displays the exact price at which you will break-even for the cumulative PnL of ONLY the remaining open trades.

That is why I brought up the whole scaling-in and scaling-out thing and why that's relevant; b/c sometimes, traders, after having locked in some profits after partially scaling-out, prefer to know at which price they will break-even for ONLY their remaining open trades so that their total Net PnL will never go below the profits that they locked-in from the previous partial scaling-out.

I know for a fact that this is the only average price calculation method that is used in crypto exchanges/platforms (bitmex, bitfinex, bitstamp, etc.) since I only traded crypto from 2012 till 2018 until I also started trading futures.

I live in S.Korea and I have mostly used only South Korean futures brokers and their platforms. For whatever reason, this is the only average price calculation method that is used in every single trading platform here so naturally, I thought this was the norm. Perhaps that is not actually the case so sorry if there was any confusion.
[2022-04-26 18:01:46]
JBTFD - Posts: 35
That is why I brought up the whole scaling-in and scaling-out thing and why that's relevant; b/c sometimes, traders, after having locked in some profits after partially scaling-out, prefer to know at which price they will break-even for ONLY their remaining open trades so that their total Net PnL will never go below the profits that they locked-in from the previous partial scaling-out.

Just curious, is there a way to determine this in SC?

As the OP mentioned, it would be quite useful for traders who scale in/out to have a function that determines our new average entry cost based on remaining lots left in the trade. This would help in that if I want to hit flat on 4 remaining lots, if price is above this "average of remaining open lots" then I'll be in the money, if I hit flat below then I'll be at a loss.
[2022-04-30 14:02:42]
Rui S - Posts: 198
Just curious, is there a way to determine this in SC?

Yes, select the option "Use Theoretical Position Average Price".

It does not contemplate the commissions costs, though.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account