This will insert the correct method signature needed to hook or trap the OnOrderExecuted event fired from OmniTrader. This event fires anytime an order is executed at the currently selected broker. Double clicking this item will insert the following code.
Sub MyOnOrderExecuted(ByVal oSymbol As SymbolObject, ByVal oOrder As OrderObject)
‘ statements
End Sub
You can change the method name (MyOnOrderExecuted) 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.OnOrderExecuted(AddressOf
Example
Sub OnStartup
StartOT
OmniPilot.OnOrderExecuted(AddressOf MyOnOrderExecuted)
End Sub
Sub MyOnOrderExecuted(ByVal oSymbol As SymbolObject, ByVal oOrder As OrderObject)
LogAction(“An order has executed on symbol ” & oSymbol.Symbol & ” – Number of Shares=” & oOrder.Shares)
End Sub
Also See
OmniPilot.OnOrderExecuted