Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 05:42:49 +0000



[Programming Help] - ASCII code to get a value from the study Trading: Position Quantity

View Count: 594

[2020-04-13 04:56:04]
User807787 - Posts: 41
I am making a custom study and want to pull the value from the study "Trading: Position Quantity"

I am kind of clueless at this point:

SCFloatArray SubgraphArray;
sc.GetStudyArrayUsingID(11, 1, SubgraphArray); //11 is the study ID, 1 is the subgraph index
float StudyValue = SubgraphArray[SubgraphArray.GetArraySize() - 1];

StudyValue should be the current position size? NOT SURE!!! It is returning 1, regardless of my current position size.

THANKS FOR ANY HELP!!!!!
[2020-04-13 22:45:44]
User807787 - Posts: 41
SOLVED:


s_SCPositionData PositionData;
sc.GetTradePosition(PositionData) ;
int CurrentPoistion = PositionData.PositionQuantity;

For anyone interested

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

Login

Login Page - Create Account