OmniPilot_OnPositionOpened | Nirvana Systems Inc.

OmniPilot_OnPositionOpened

OmniPilot_OnPositionOpened

Signatures
OmniPilot.OnPositionOpened(Callback As DelegateOnPosition)

Purpose
This will establish the delegate call back for the OnPositionOpened event.  This event will fire when a new position is opened within the currently connected broker.  The delegate will contain the SymbolObject and the PositionObject that fired the event.  Properties which rely on a closed position which include ExitDate, ExitPrice, and RealizedProfit will not be set until after the position is closed.  When the position closes a reference to the same position object with initialized exit values will returned in the OnPositionClosed delegate.

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
OnPositionOpened Event

>