This seems like a simple answer, but I can't figure this out:
I want to retrieve the number of Open Shares I currently hold for a given stock in my portfolio.
The issue I'm having is that GetQuantity() is displaying the number of shares even if they are closed. I want to retrieve the Open shares only.
I designate a symbol in my code that I want to find the number of shares. I do this because I want to use multiple symbols at a time.
In this example the symbol is "GLD". I have no open shares but it retrieves (2) since I previously owned 2 shares in the past.
Can anyone help? Attached is my code and screen shot.
Thank you!!
CODE:
declare lower;
input SYMBOL_01 = "GLD";
def S1_quantity = GetQuantity(SYMBOL_01);
AddLabel(yes, SYMBOL_01 + " ( " + S1_quantity + " ) ", Color.GREEN);
I want to retrieve the number of Open Shares I currently hold for a given stock in my portfolio.
The issue I'm having is that GetQuantity() is displaying the number of shares even if they are closed. I want to retrieve the Open shares only.
I designate a symbol in my code that I want to find the number of shares. I do this because I want to use multiple symbols at a time.
In this example the symbol is "GLD". I have no open shares but it retrieves (2) since I previously owned 2 shares in the past.
Can anyone help? Attached is my code and screen shot.
Thank you!!
CODE:
declare lower;
input SYMBOL_01 = "GLD";
def S1_quantity = GetQuantity(SYMBOL_01);
AddLabel(yes, SYMBOL_01 + " ( " + S1_quantity + " ) ", Color.GREEN);
Last edited by a moderator: