Profile Picture

CloseAtMarket no action

Posted By phg 3 Years Ago
Message
phg
Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)Supreme Being (44,733 reputation)
Posted Monday February 24 2014
IList openPos = PositionManager.GetOpenPositions();
   if(openPos.Count > 0)   {   openPos[0].CloseAtMarket(); // Sell one position.   <<< Does NOT happen sometimes (rarely)
OutputWarning(string.Format("Close position. Bars held: {0}, Error: {1}", openPos[0].BarsHeld,openPos[0].Error)); <<< Always correct. Error field is always blank.
   
The messages are always correct and usually match the simulator's trade list. Except rarely when there is no corresponding entry in the trade list. It happens silently: no error message and no exception. The unclosed position appears in the position list as still open.
What would cause a CloseAtMarket to silently do nothing with an apparently valid position? Is there some way I can check on the status of the order?

-Pete

See also Yahoo group about applying RE.



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems