Posted 5/1/2007 02:13:48
|
|
|
|
| If you set PositionManager.SetProfitTarget and PositionManager.SetStopLoss at the same time in the Paper Broker and then one of the orders is hit, you get a duplicate notification in the Closed Positions tab. Here is example code. Public Overrides Sub OnPositionTrade(ByVal trade As RightEdge.Common.Trade, ByVal pos As RightEdge.Common.Position, ByVal state As RightEdge.Common.Position.State)MyBase.OnPositionTrade(trade, pos, state)Dim OnePoint As Double = pos.Symbol.SymbolInformation.TickSizeDim LongProfitTarget As Double = trade.Price + (3 * OnePoint)Dim LongStopLevel As Double = trade.Price - (3 * OnePoint)'Set Profit TargetIf pos.PositionType = PositionType.Long And state = Position.State.Open ThenPositionManager.SetProfitTarget(pos.PosID, LongProfitTarget, False)End If'Set Stop LossIf pos.PositionType = PositionType.Long And state = Position.State.Open ThenPositionManager.SetStopLoss(pos.PosID, LongStopLevel, False)End IfEnd Sub
|
|
Posted 5/2/2007 16:30:19
|
|
|
|
|
|
Posted 5/2/2007 17:41:27
|
|
|
|
|
|
Posted 5/24/2007 09:15:43
|
|
|
|
| This bug has been fixed. Thanks, Daniel
|
|
|
|