Support Board
Date/Time: Sun, 22 Dec 2024 09:21:30 +0000
sc.GetSessionPosition(PositionData) not working
View Count: 916
[2015-07-31 17:29:39] |
CustomIndicators - Posts: 126 |
I want to retrieve my current position, how many contracts I have going long, short, or if its flat. To test this out, I'm trying to get that value, and put it into the message log to be sure that the returned values are what I intend. I'm having some trouble with this code, yet I thought I did it correctly. Where did I go wrong? I've uploaded an image to this message to show you whats going on in VS. Thanks |
Errors.png / V - Attached On 2015-07-31 17:28:37 UTC - Size: 79.29 KB - 303 views Attachment Deleted. |
[2015-07-31 18:28:44] |
Sierra Chart Engineering - Posts: 104368 |
That function no longer exists. This is the current one: https://www.sierrachart.com/index.php?page=doc/doc_ACSILTrading.html#scGetPosition Where did you see the older one being used? 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 |
[2015-07-31 18:54:14] |
CustomIndicators - Posts: 126 |
Thanks. So, is this the proper way to do it with the new code?: s_SCPositionData PositionData; int Result = sc.GetTradePosition(PositionData); int PositionStatus = PositionData.PositionQuantity; SCString BufferOne; BufferOne.Format("Current Position is: %i", PositionStatus); sc.AddMessageToLog(BufferOne, 0); And to answer your question, this was the first thing that popped up when I was googling for an answer: https://www.sierrachart.com/supportboard/showthread.php?t=29075 |
[2015-08-01 03:06:28] |
Sierra Chart Engineering - Posts: 104368 |
Yes. This does make sense.
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 |
To post a message in this thread, you need to log in with your Sierra Chart account: