RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



Duplicate fills reported in Paper Broker Expand / Collapse
Message
Posted 5/1/2007 02:13:48 Post #2371
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
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.TickSize

Dim LongProfitTarget As Double = trade.Price + (3 * OnePoint)

Dim LongStopLevel As Double = trade.Price - (3 * OnePoint)

'Set Profit Target

If pos.PositionType = PositionType.Long And state = Position.State.Open Then

PositionManager.SetProfitTarget(pos.PosID, LongProfitTarget, False)

End If

'Set Stop Loss

If pos.PositionType = PositionType.Long And state = Position.State.Open Then

PositionManager.SetStopLoss(pos.PosID, LongStopLevel, False)

End If

End Sub

Posted 5/2/2007 16:30:19 Post #2379
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Posted 5/2/2007 17:41:27 Post #2382
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
Added as bug 974.
Posted 5/24/2007 09:15:43 Post #2557
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
This bug has been fixed.

Thanks,
Daniel

« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 2:35pm

2005-2007 © RightEdge Systems