So this is that I wrote. Does it make sense? Am I using the right parameters in SubmitOrder to create a stop order (_stp is my stop price)?
protected override void OnPositionUpdate(IPosition position){ if (position.MarketPosition == MarketPosition.Long) { int qnt = position.Quantity; if(_o_stp!=null){ ChangeOrder(_o_stp, qnt, 0, _stp); }else{ _o_stp = SubmitOrder(0, OrderAction.Sell, OrderType.Stop, qnt, 0, _stp, "", "Stop"); } } }
Comment