Login Page - Create Account

Support Board


Date/Time: Sat, 18 Jan 2025 13:10:32 +0000



List of all open Positions?

View Count: 1538

[2018-02-15 12:48:24]
User99735 - Posts: 234
Hi,
Is there a simple way of getting a list of all open Positions from a ACSIL study? The only option I could conceive was to loop through all trades using functions sc.GetOrderFillArraySize / c.GetOrderFillEntry and get a list of symbols for which trades were filled. Using the list of symbols, use function sc.GetTradePositionForSymbolAndAccount to get the position details if position is still open.

Regards

Vivek
[2018-02-15 19:12:02]
Sierra Chart Engineering - Posts: 104368
You will want to use this particular function:
sc.GetTradePositionForSymbolAndAccount

But you will need to know the symbols and accounts ahead of time.
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: 2018-02-15 19:29:23
[2018-02-15 20:03:51]
User99735 - Posts: 234
Thanks for the response.

My query was to find all open positions, in this scenario, the Symbol will not be known to call the function sc.GetTradePositionForSymbolAndAccount.
[2018-02-19 03:56:48]
Sierra Chart Engineering - Posts: 104368
We are adding a way to do this. Should be ready in a couple of days. Follow-up with us at all of the week about this.
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
[2018-02-20 23:46:18]
User99735 - Posts: 234
Hi,
Any update on this, just following up as requested.

Regards

Vivek
[2018-02-20 23:59:15]
Sierra Chart Engineering - Posts: 104368
This is now available in prerelease 1705. The function is:
int sc.GetTradePositionByIndex(s_SCPositionData& r_PositionData, int Index);

The function returns 1 if the Position at Index was found and the data is put into r_PositionData. Index is zero-based.

Increment Index starting from zero with each call and when the function returns 0, then you have received all of the available Trade Positions. Only non-simulated Trade Positions are supported.

The Trade Positions the sc.GetTradePositionByIndex function accesses are what are listed in Trade >> Trade Orders and Positions >> Positions.
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: 2018-02-21 18:30:02
[2018-02-21 10:45:31]
User99735 - Posts: 234
Thanks for the update.

Will it be possible to also provide a TradeAccount input to the function sc.GetTradePositionByIndex(s_SCPositionData& r_PositionData, int Index)?
[2018-02-21 11:07:13]
Sierra Chart Engineering - Posts: 104368
No. We see no practical reason for this. The trade account is provided in s_SCPositionData so you can ignore whatever accounts you want.
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
[2018-02-21 11:15:42]
User99735 - Posts: 234
Ok, so the function will iterate through all positions in currently logged in 'main' account and associated sub accounts? And vice versa, if logged in to a 'sub account', the positions in 'main' account will be present in the iterator?
[2018-02-21 18:26:35]
Sierra Chart Engineering - Posts: 104368
It is impossible for us to answer your question. You will know the answer to this better than us. We do not know what trading service you are connecting Sierra Chart to or its behavior. You have to run your own testing and make your own determinations.

The Trade Positions this function accesses are what are listed in Trade >> Trade Orders and Positions >> Positions.
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: 2018-02-21 18:27:02

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

Login

Login Page - Create Account