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