Profile Picture

1/ Stop Orders 2/ Pending Orders

Posted By ywlee Last Year
Message
Posted Thursday March 03 2016
Hi 

1/ Stop Order

I have submitted a stop order (see below). It appears in the live trading window panel but is not received at IB.   I checked the IB API window and there is no record of the stop order.  Any ideas why this is not going through?  Have used the live trading system successfully before with IB but not on Stop Entry Orders.
if (Bars.Count > 1 && openpositions.Count == 0)         
          {
           PositionSettings ps = new PositionSettings();
           ps.Size = positionsize;
           ps.OrderType = OrderType.Stop;
           ps.StopPrice = Bid.Current - 0.005;          
           ps.PositionType = PositionType.Short;
           //ps.BarsValid = 5;
           //ps.BarCountExit = 4;
           OpenPosition(ps);    


2/ Pending Orders

Can I amend the above pending Stop Order as follows?  

foreach (Position p in OpenPositions) //Change price of position if bid price has moved away
           {
            foreach (Order order in p.Orders)
            {
              if ((order.OrderType == OrderType.Stop) && (order.StopPrice - Bid.Current) > 0.0010)
              {              
               order.StopPrice.Equals(Bid.Current - 0.005);
              }
            }
           }




Posted Sunday March 13 2016
The TWS Plugin will by default save logs in the TWSLogs folder in your RightEdge application data folder.  Those logs will probably be helpful to figure out what happened with the order.  You can also send them to us if you don't figure it out yourself.

Right now there's not a way to modify an existing order.  You have to cancel it and resubmit.  RightEdge will do this for you if you call the SetStopLoss() method on the Position.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems