Support Board
Date/Time: Sat, 01 Feb 2025 06:48:48 +0000
Potential Error with Position avg - specific to when you add volume profile to trading dom
View Count: 792
[2019-06-17 02:58:20] |
Sierra Chart Engineering - Posts: 104368 |
Adjust this setting to make sure it is far enough back in time to load all of the order fills which make up the current position: Chart Settings: Order Fills Start Date-Time (Chart >> Chart Settings >> Trading menu) The reason adding a study can affect this is because that will cause chart data to be loaded and this affects the Order Fills Start Date-Time when it is automatically set, which will be the case when the setting is blank. More information: Trading Information Windows: How Average Price for Positions Is Calculated and Used Also side note is there either an acsil function or struct to get the Theoretical Position Average, or does that have to be calculated from my side. I would like to add it to my custom stop loss study. Automated Trading From an Advanced Custom Study: [Type: double] AveragePrice 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-06-17 03:11:27
|
[2019-06-17 06:05:55] |
enemyspy - Posts: 306 |
Thank you, adding the start date time resolved it. With regards to using the s_SCPostionData::AveragePrice member. It does not appear to use the dom calculation setting (theoretical Position avg). It is using the standard FIFO position avg. Attached below is A screenshot of s_SCPositionData struct displayed in the Visual Studio debug watch. Below that is the Dom that the study being debugged is attached to. The dom is using the theoretical avg, and working properly. If you compare the highlighted dom value to the highlighted watch value, they are different. The Avg price in the Position data is not being calculated by the same method as associated chart/dom. Not sure if that is what is supposed to happen or not. |
Risk Management Tools(Release) (Debugging) - Microsoft Visua.png / V - Attached On 2019-06-17 06:00:47 UTC - Size: 160.82 KB - 271 views |
[2019-06-18 04:33:40] |
enemyspy - Posts: 306 |
Alright. I implemented Theoretical Avg into the study myself using s_SCOrderFillData. Please post update this if you ever do decide to make the s_SCPositionData::PositionAveragePrice reflective of the settings you define in the program, so that I can remove the code from my study. |
[2019-06-20 04:24:10] |
Sierra Chart Engineering - Posts: 104368 |
With regards to using the s_SCPostionData::AveragePrice member. It does not appear to use the dom calculation setting (theoretical Position avg). 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-06-22 19:17:14
|
[2019-06-22 05:52:12] |
enemyspy - Posts: 306 |
Ok I did More Testing. I was originally using sc.GetTradePositionForSymbolAndAccount() due to different trade/quote symbol. I tried Testing sc.GetTradePosition() this time. Here Are my observations: The Chart Settings used: Symbol: GC-201908-NYMEX Trade And Quote Symbol : MGC-201908-NYMEX-USD-10 Chart Settings >> Advanced Settings3 >> Open Position Average Price : Use Theoretical Position Average Observations: 1. Filling the s_SCPositionData using sc.GetTradePosition(): -The AveragePrice member does indeed match what is displayed. -However it is using the tick value of GC instead of MGC to caclulate the PL (10x > what it should be) 2. Filling the s_SCPositionData using sc.GetTradePositionForSymbolAndAccount(PositionData, sc.GetTradeSymbol(),sc.SelectedTradeAccount): -The AveragePrice member does not match what is displayed on the Dom unless you are using the default FIFO method. -It is using the tick value of GC instead of MGC to caclulate the PL (10x > what it should be). Unless I have gone completely crazy (which there is a good chance of), There might be some cross references of the symbols when the struct gets filled. Did you try testing it that way? Date Time Of Last Edit: 2019-06-22 05:52:59
|
[2019-06-22 05:59:28] |
enemyspy - Posts: 306 |
-It is using the tick value of GC instead of MGC to caclulate the PL (10x > what it should be).
This also seems to be manifesting in the s_ACSTrade Date Time Of Last Edit: 2019-06-22 06:07:00
|
[2019-06-22 19:18:39] |
Sierra Chart Engineering - Posts: 104368 |
What you describe in post #7 is technically correct.
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 |
[2019-06-23 06:01:02] |
enemyspy - Posts: 306 |
Alright So. So if what is described in post 7 is expected behaviour, is there a way to get the currency value/tick for the trade/quote symbol so I can calculate the correct pl myself? Seems like why bother even supporting the trade and quote symbol in acsil if the position data just uses the the main symbol for half the calculations. Date Time Of Last Edit: 2019-06-23 06:03:45
|
To post a message in this thread, you need to log in with your Sierra Chart account: