So one day I may enter Long the EURAUD with 95,000 units and the next day I may be going short with 75,000 units leaving me net long with 20,000 units. Then, the next day I may go long another 85,000 units giving me a net long position of 105,000 units. Which is the way that IB handles these types of orders. But, from a strategy point of view, I am long 95,000 EURAUD; Short 75,000 EURAUD, & Long 85,000 EURAUD.
This poses a few questions as I am working on coding this strategy into NinjaScript.
if, in the OnBarUpdate(), I have
if (XYZ)
EnterLongStop(PositionSize, EntryPrice, "breakoutEntryLong");
if(XYZ123)
EntryShortStop(PositionSize, EntryPrice, "breakoutEntryShort");
How will this effect order management for my two long positions?
For example, I would want a sell stop price and a sell limit price to get out with a loss or profit. But, if both orders are titled "LongBreakout", will this not cause both of them to exit at the same price when, normally, they would be exiting at different prices?
The answer to this will effect the direction to my other questions so I will wait until this is answered before I start posing the next ones.
Thank you for your help
Edited - Additional Question
There is no need for me to adjust the orders when the trade is active (such as moving the stop price or limit price). Is it better for me to use an IOrder in this situation or just something like above using the EnterLongStop, etc?
Comment