OmniPilot.OnPositionOpened(Callback As DelegateOnPosition)
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.
Sub MyOnPositionOpened(ByVal oSymbol As SymbolObject, ByVal oPosition As PositionObject)
LogAction(oSymbol.Symbol & ” entered a new trade at ” & oPosition.EntryPrice)