Profile Picture

Sell Part - How to Reference Remaining Position?

Posted By ywlee 3 Years Ago
Posted Friday October 02 2015

I used OrderSettings to sell 1/2 the position at a certain level.

1/ How do I reference the remaining unsold position?
2/ If the exit rules for the unsold position is different from that of the 1/2 that was sold, do I still put the code under OrderSettings? Problem is if I do then the code may execute the 2nd 1/2 first if the conditions are met.

Posted Monday October 05 2015
If you have a different exit condition for the second half of the position that you only want active after the first half is sold, then I would wait until the order to sell the first half is filled before submitting the order to sell the second half.  You could do this in the OrderFilled method by checking that the filled order was a sell, was completely filled, and the position size was still greater than zero.


Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems