Events_OnPositionOpened | Nirvana Systems Inc.

Events_OnPositionOpened

Events_OnPositionOpened

This will insert the correct method signature needed to hook or trap the OnPositionOpened event fired from OmniTrader.  This event fires anytime an newly established position is opened at the currently selected broker.  Double clicking this item will insert the following code.

Sub MyOnPositionOpened(ByVal oSymbol As SymbolObject, ByVal oPosition As PositionObject)
    ‘ statements
End Sub

You can change the method name (MyOnPositionOpened) to anything you like however the signature must remain unchanged in order to establish the hook. To actually establish the hook you need to call OmniPilot.OnPositionOpened(AddressOf )

Example
Sub OnStartup
    StartOT
    OmniPilot.OnPositionOpened(AddressOf MyOnPositionOpened)
End Sub

Sub MyOnPositionOpened(ByVal oSymbol As SymbolObject, ByVal oPosition As PositionObject)
    LogAction(oSymbol.Symbol & ” entered a new trade at ” & oPosition.EntryPrice)
End Sub

Also See
OmniPilot.OnPostionOpened

>