I need from my script (indicator or a strategy), to keep track of the open position of my manual orders or via ATM, such as knowing the average price all the time.
I understand the "Position" object of my script is not able to know from the entries that I make manually or ATM, so what I am doing is evaluating all the filled orders and doing my own calculations.
My current problem is that I have orders with the value of quantity/filled/remaining at zero, being orders that were executed and filled, which makes it difficult for me to calculate, for example, the average price...
First question, why is this happening? Second question, is there another simpler alternative to track my position other than evaluating all the orders in the account?
thanks in advance!
Comment