Login Page - Create Account

Support Board


Date/Time: Thu, 13 Dec 2018 07:31:45 +0000



[Locked] [Sticky] - Reimplementation of Trades and Trade Statistics and Period Trade Stats Tabs/Calculations

Support Request:
[2018-09-23 23:50:00]
Sierra Chart Engineering - Posts: 66930
In an upcoming release which will be out we expect this week, there has been a significant reimplementation/reworking of the Trades List and Trade Statistics calculation component which is used by the Trade Activity Log and also used by Charts/Trading DOMs that are in chart trading mode.

We will be documenting the changes here.

The concept of the "Unmatched Fill" is being removed. Overall, based upon the confusion which arises with these Trades and the related support request, and the fact that this can be the result of invalid Position Quantity data from an external service, makes supporting this not really sensible. Removal of this does not mean that the resulting order fill matches are going to now be correct. Not necessarily. There is no right or wrong with us removing this. We just know that overall it is cleaner for us to remove it and going to be less questions.

And we can more easily shift the responsibility to users explaining through the documentation how the orders are matched, and if there is an issue that it is the result of missing order fills or an incorrect starting date-time for matching order fills. And also explain that external trading services have often limited order fill history.

If there is missing order fills which is commonly the case and not controllable from our side unless you are using the CTS low cost connection model, LMAX or BitMex, order fill matches will still not be correct. We are also working on a new solution involving TT which will maintain long-term order fill history.

The Open/Close field is no longer used when matching order fills. Order fills are just naturally matched according to Date-Time using a first in first out logic. This results in complete and consistent fill matching to create Trades.

Last in first out order fill matching is being removed. In order for the code to be easy to understand and maintainable, and for support to be easier, we need to remove this. Under no conditions is this going to come back. First of all various incremental and running calculations which are performed at the core level of the Trades list now rather than add draw time have no straightforward implementation when using LIFO. We need to keep the design straightforward and simple.

We will certainly support that mode, when it comes to Position Average Price calculations for the current open position. This will be done at some near-term point in time. Update: This has now been added in version 1824 through this new setting: Chart >> Chart Settings >> Advanced Settings 3 >> Open Position Average Price. There are several choices.

Flat to Flat order fill grouping has been removed and instead there are new fields added to the Trades tab of the Trade Activity Log which provide the same information and you can now incrementally see how the flat to flat values are arrived at because you can see the individual order fill matches. The Flat to Flat mode will never be added back and the implementation of it was terribly confusing and had problems and there is no doubt, there were some inaccuracies with it. For example, the Maximum Open Position Profit and Loss and Runup and Drawdown fields were not accurate with that mode previously.

Complete reimplementation of how highest high and lowest low during position are being set within the Trades list to minimize any issues or inaccuracies with those. This does not mean that those values are necessarily going to be correct always because there can be still external causes for inaccurate values.

Update 2018-11-12: Part of this redevelopment is that Sierra Chart now uses a very reliable method to calculate the Open Position Average Price using several different calculation methods. For further information:
http://www.sierrachart.com/index.php?page=doc/TradeStatusWindows.html#HowAveragePriceForPositionsIsCalculatedAndUsed

A reverse iteration of the order fills is used.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-11-12 20:14:08
[2018-09-24 19:34:06]
Sierra Chart Engineering - Posts: 66930
Some of this development has already been released in version 1811 but it is incomplete. Avoid asking us any questions about the Trade Statistics, Trades, Period Trade Stats tabs and the Daily Profit/Loss and anything related to Trades or Trade Statistics in charts, until this development is complete. This functionality is not fully functional in the latest prerelease.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
[2018-09-25 04:49:23]
Sierra Chart Engineering - Posts: 66930
This is actually a quite an involved task and we do not expected to be fully completed until the end of this week.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-09-25 04:49:34
[2018-09-30 20:45:02]
Sierra Chart Engineering - Posts: 66930
In the latest revision of version 1814, the reimplementation of the Trade Activity Log Trades list and Trade Statistics is complete. To be sure you have the latest revision, update again to 1814 even if you are running 1814.

In versions prior to this, the development is incomplete and the functionality is not going to work properly.

However, we still have to go through and verify the values but we have no reason at this point to believe there is a problem.


The High and Low values during position, for each trade are now properly implemented and all of the calculations based on those values will be accurate. We question how that was implemented previously for the flat to flat order fill grouping method, which has now been removed.

As has been said, flat two flat has been removed. Instead you now see the individual trades and there are new fields which represent the overall flat to flat values during a position on the Trades tab.

You will also see fields indicating what the position quantity is at the open of a trade and also at the close of a trade.

When a trade establishes a position you will see BP at the date time which opens the trade and EP at the date time which closes the trade when the Position Quantity goes to 0. This way you can easily identify those fills which are part of a flat to flat overall trade. And you have the running PL within each flat to flat series of trades which resets itself when the Position Quantity goes to 0. So you can track the Profit/Loss within an overall flat to flat trade quite clearly and incrementally.

The only outstanding item that needs to be done is Last In First Out order fill matching for the current position average price, as an option.

Also the Long and Short, Long Only and Short Only options in the listbox of the Trade Activity Log for the Trades list, is not supported anymore. Due to the efficiency improvements and the code reimplementation, it was not easy to implement.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-01 17:08:39
[2018-10-01 18:21:42]
Sierra Chart Engineering - Posts: 66930
How to Ensure Accurate Daily Profit/Loss Value Calculations

The information below applies to version 1814 and higher.

With the reimplementation of the Trades list and Trade Statistics, we need to explain how to ensure an accurate Daily Profit/Loss Calculation which you will see on the Trade Window and other areas within the chart that show this value.

There is not a whole lot new here but it needs to be restated and you need to be aware of some changes in case there are problems with the Daily Profit/Loss calculation which is not unusual being this is client-side calculated from order fills. There are many things that can and do go wrong that we do not have control over. So as a matter of policy if there is a problem, other than providing a detailed explanation and background details that you need to understand how the calculation is done, we will not provide further help.

The documentation on this page is somewhat out of date with the changes:
https://www.sierrachart.com/index.php?page=doc/DailyProfitLossValue.html

We will be making some updates to it this week.

The most important thing is there cannot be any missing order fills during the trading day that you want the Daily Profit/loss for. To see that you have the order fills look for them in the Trade Activity Log:

https://www.sierrachart.com/index.php?page=doc/TradeActivityLog.php#ViewingHistoricalTradeActivity


And the start of the day for the Daily Profit/loss is now according to the Session Times in the chart. Refer to:
https://www.sierrachart.com/index.php?page=doc/SessionTimes.php

So this will be the Session Times >> Start Time or the Evening Start Time if using the evening session.

It is no longer according to the Daily Stats Reset Time in Global Settings >> General Trade Settings.

To control what order fills are used in the Daily Profit/Loss calculation it is important to accurately control what is the first fill loaded into the chart. By default the first fill in newer versions is going to be the fills at or after the Date-Time of the first bar in the chart.

You can limit this further by enabling Chart >> Chart Settings >> Advanced Settings >> Load Order Fills for Current Day Only. But you need to be conscientious of what is considered the start of the day and that is according to the Session Times for the chart.

Or you can use this particular setting which is probably better:

https://www.sierrachart.com/index.php?page=doc/ChartSettings.html#OrderFillsStartDateTime

Set this to the starting Date-Time when your position was flat for the symbol and Trade Account, just before you began trading for the current day. It may be better to use this particular setting and periodically update it. It does not need to be updated every day. If it goes back several days that is fine. But it just needs to be set to a point in time where your position was flat and there must not be any missing order fills since that time. If there is even a single missing fill this will very likely lead to a problem with the Daily Profit/Loss calculation.

The starting Date-Time for loading of the order fills is essential to understand and adjust as needed. And in version 1815 and higher you can see this date-time for a particular chart in the Trade >> Trade Activity Log >> Trade Stats for Charts tab. Look at the Order Fills Start Date-Time field.

If these instructions are not followed, then the Daily Profit/Loss can be inaccurate.

How do you know there are no missing order fills for the current trading day and the starting Date-Time for loading the order fills into the chart is correct? What you need to do is go to Trade >> Trade Activity Log >> Chart Trade Stats tab. Locate the chart in the list of charts. Not every chart will be listed but if it is not listed, an equivalent chart will be listed.

You need to then look at the Order Fills Start Date-Time column. If that is the correct date-time of an order fill which is at the start of a new Position starting from a zero Position quantity, then good. Next look at the Open Quantity field. If that is indeed your current Position Quantity for the Symbol and Trade Account of the chart, then you are good.

For an explanation of how the Open Quantity field is calculated, refer to:
https://www.sierrachart.com/index.php?page=doc/TradeActivityLog.php#TradeStatsOpenQuantityFieldCalculation

If the Open Quantity field is not correct you need to make sure there are no missing order fills for the symbol and Trade account of the chart and adjust the starting Date-Time for loading order fills:

https://www.sierrachart.com/index.php?page=doc/ChartSettings.html#OrderFillsStartDateTime
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-04 19:57:39
[2018-10-06 22:37:17]
Sierra Chart Engineering - Posts: 66930
The documentation for all of the current Trades tab fields has been updated and is here:
https://www.sierrachart.com/index.php?page=doc/TradeActivityLog.php#TradesTabFieldsDescriptions

Finally the flat to flat calculations are now done properly and consistently accurate. Previously, there were issues with these. And this was one of the reasons for the reimplementation because we would periodically get reports of inaccuracies and get questions surrounding flat to flat calculations.

This is why we are very adamant about removing that operating mode because it was not accurately implemented. Instead we have created new fields providing the equivalent information incrementally across a flat to flat trade.


If there is still data that you need that you cannot see that you previously did with Flat to Flat, then let us know.

Give a chance to what we have done. The internal implementation is now done properly and you can incrementally see how the flat to flat calculations are arrived at.

Potentially at some future point we could provide some kind of averaging of all of the individual sub trades but the internal maintenance of the sub trades must be done as you currently see.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-10 04:47:21
[2018-10-10 04:51:09]
Sierra Chart Engineering - Posts: 66930
Now that we are going through the documentation and making various updates due to the changes, we realize that the documentation is more simplified now and there is a straightforward understandable way to arrive at creating Trades, Trade Statistics, and doing Profit/Loss calculations.

We are also going to be creating a new connection model to TT(Trading Technologies) which will use the Sierra Chart Exchange Data Feed and which will maintain long-term order fill history which will be an alternative to CQG, CTS and Rithmic.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-10 04:51:58
[2018-10-11 03:30:38]
Sierra Chart Engineering - Posts: 66930
There is another important item we need to mention, the Trade Statistics tab of the Trade Activity Log has not underwent a review of accuracy. And it has also been our intent to add additional fields that represent the Flat to Flat calculations for fields which would be most relevant to have this data. This will be done.

Currently we do see some issues with the Trades Statistics values due to the changes. Basic calculations like profit/loss are fine. It is some of the run up and draw down calculations which may be not accurate in the case of when displaying formats which ignore quantity. We will have this all corrected no later than the middle of next week.

And also have the new flat to flat fields out by then as well. It was never our intent to remove the desired final result data from flat to flat, just to unify this information into a single operating mode.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-11 23:41:05
[2018-10-11 23:40:02]
Sierra Chart Engineering - Posts: 66930
One long-term concern we have always had is that charts by default would load all of the available order fills that are in the Trade Activity Log for the Symbol and Trade Account and also based upon whether trade simulation mode is enabled or not. This only happens though if the Chart or Trading DOM is being used for trading in some way.

With the recent work we felt it is important to limit the order fills in the chart. In the case of trade simulation mode, this will impact the displayed Position Quantity. For more information about this, refer to:
https://www.sierrachart.com/index.php?page=doc/TradeSimulation.php#TradeSimulationPositionQuantityCalculation

The current operating mode for trade simulation mode may not really make sense because it does require adjusting the order fill start Date-Time in the chart but until we come up with something better, this is how we want to do it in order to avoid any performance related issues from loading too many fills.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
[2018-10-19 16:54:42]
Sierra Chart Engineering - Posts: 66930
One problem that has been corrected arising from this development, is that the filled orders displayed on the chart, would show the profit/loss for entry fills but not exit fills. This has been corrected in prerelease 1824.

Version 1824 has a stability bug related to the Trades list in a chart. This has been fixed with a new revision and we are also releasing 1825 now. If you are using 1824 it is critical you update again to the latest revision or to 1825.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-19 20:22:48
[2018-10-19 20:58:50]
Sierra Chart Engineering - Posts: 66930
See the attached screenshot to easily identify the final profit/loss of a Flat to Flat trade.

There is also a command on the Edit menu of the Trade Activity Log to remove those text indicators at the end of the field.

For the latest development use version 1825.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-19 21:38:12
imageTradesList_FlatToFlatIdentifcation.png / V - Attached On 2018-10-19 20:57:37 UTC - Size: 27.48 KB - 113 views
[2018-10-20 04:43:30]
Sierra Chart Engineering - Posts: 66930
Some users have asked, why the Flat to Flat display view cannot be brought back. Well certainly if we have made changes, we are not going to put back the way it was. There is reason why what we have done and that is described in the first post.

Some of the fields previously used for Flat to Flat were simply not correct and could not be correct unless the individual sub trades are tracked and maintained individually (Maximum Open Position Profit/Loss and RunUp and Drawdown (These names were also not properly descriptive either)). And due to the overall design, it is not a simple task to maintain that level of detail and just to display a single flat to flat line.

And yes we are well aware there are more lines especially if there are a lot of fills from a flat to flat trade. And we knew this may not be acceptable for some users who have a lot of fills but this is all we can do right now. We have a responsibility to provide reliable and accurate software. And this is what we are doing.


This has been a long going concern to get the underlying problems with the Trades list and Trades Statistics corrected and to reorganize the code in the most efficient way. And we are happy that it is done.

Give what we have a chance and we can always make some small incremental improvements.

And there still is more work we need to do adding new flat to flat trade statistics fields and get the naming corrected and logical and consistent. We are doing that this weekend.

Although our position when we have responded to support requests is that these changes are final and flat to flat mode is not coming back because there really is no reason for it because the data that you need is still available and will be fully available with what we described above. We do recognize the fact that there are a lot of lines, individual trades, for an overall flat to flat trade that can be a problem for some users.

And we do know that this is solvable by consolidating that data and displaying it as a single line. But we did not know when we would get to this, and the exact implementation method was never determined. So we did not give any hint about this potential solution if we could not deliver on it anytime soon.

But we have thought about this and we think we can display a consolidated flat to flat line for the individual sub trades. So we will try to get to that in the next couple of weeks. Perhaps even today.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-21 16:52:54
[2018-10-29 03:18:02]
Sierra Chart Engineering - Posts: 66930
We have implemented a flat to flat/summary display view for the Trades tab of the Trade Activity Log. We expect that should be out by the end of the day Monday or Tuesday. The command for this is Edit >> Summary Trades Only for Trades List.

Update: This is now available in prerelease 1832.


And another thing about this implementation is that when you enable and disable this command, it does not involve any type of re-parsing of the order fills. This is simply is a very fast combining of the displayed flat to flat trades only.

Overall all of the reimplementation of the Trades list and Trade Statistics does have significant performance improvements and much better organization of the code and correcting issues reported by users.

So as you can see in the end, as we always knew, we will not let our users down. Have a look at what we did in 1832 and you will be pleased with that and you will also be pleased by the fact that these are reliable accurate and stable calculations and in particular with the maximum open profit and loss. That is rather challenging to get right. And we have delivered.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-10-30 06:40:54
[2018-11-04 09:18:54]
Sierra Chart Engineering - Posts: 66930
One change that has been made in 1834 in regards to the Flat to Flat Maximum Open Profit and Loss is that when a new Sub trade is opened up during a flat to flat trade, any existing closed profit/loss for those already closed sub trades within the overall flat the flat trade, initializes the corresponding Flat to Flat Maximum Open Profit and Loss variables.

This is so that they accurately reflect the true maximum open position profit and loss for the flat to flat trade. At least this makes sense to us after further consideration.

In 1835 the Trades tab has additional improvements. It separates different symbols into their own group. And you can now have a Flat to Flat display when there are multiple symbols listed.

----
Now we also want to provide an explanation why it is that it was never possible to track the Maximum Open Position Profit and Loss during a flat to flat trade accurately without maintaining the full detail on the individual trades. There are many examples but we could just explain one of them which makes it quite clear.

Let's say you are scaling in and out 100 times taking the position quantity from 1 to 2, 2 to 1, 1 to 2 and so on. During those times the price range is from 10 to 20. One point about this is that during any one of those sub trades, the maximum profit reached aside from the closed profit/loss, is simply going to be based upon the quantity of 2 and the high price of 20.

However, now on the very final trade, the high price goes all the way up to 100. That value of 100 cannot be applied across all of the trades. So the high to low price range for each individual sub trade must be maintained, and there must be incremental maintaining of the flat to flat maximum open position profit and loss for all of the open trades, applied to each sub trade.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-11-04 09:19:24
[2018-11-05 08:45:57]
Sierra Chart Engineering - Posts: 66930
At this point in the latest revision of 1836 the Trades list is finalized and we think this meets everyone's requirement. There is now a separation between different symbols with a final total at the very end.

And the internal implementation is much improved and very efficient.

Potentially there will be more work done on the Trade Statistics but that will be looked at later.
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-11-05 08:47:08
[2018-11-12 20:41:10]
Sierra Chart Engineering - Posts: 66930
Update 2018-11-12: Part of this redevelopment is that Sierra Chart now uses a very reliable method to calculate the Open Position Average Price using several different calculation methods. For further information:
http://www.sierrachart.com/index.php?page=doc/TradeStatusWindows.html#HowAveragePriceForPositionsIsCalculatedAndUsed
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
[2018-11-17 02:27:43]
Sierra Chart Engineering - Posts: 66930
It is important to understand that charts do not any longer load all of the order fills into their own Trades list when not using Trade Simulation Mode, and in any case it is important to understand how the order fill matching works and how it is important to control the first fill loaded into the chart.

For complete details, refer to:
https://www.sierrachart.com/index.php?page=doc/TradeActivityLog.php#UnderstandingAndSettingTheStartDateTimeForATradesList
Sierra Chart Support - Engineering Level

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

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.

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

Login


Login Page - Create Account