fbpx

Events_OnAlert

Events_OnAlert

This will insert the correct method signature needed to hook or trap the OnAlert event from OmniTrader.  This event is triggered when an alert is triggered within OT.  Double clicking this item will insert the following code.

Sub MyOnAlert(ByVal oSymbol As SymbolObject, ByVal oAlert As AlertObject)
    ‘ statements
End Sub

You can change the method name (MyOnAlert) to anything you like however the signature must remain unchanged in order to establish the hook.. To actually establish the hook so that this method is executed when the Alert Event fires you need to call OmniPilot.OnAlert(AddressOf ).

Example
Sub OnStartUp
     StartOT
     OmniPilot.OnAlert(AddressOf AlertFired)
End Sub

Sub AlertFired(ByVal oSymbol As SymbolObject, ByVal oAlert As AlertObject)
   LogAction(“An alert has been fired.”)
End Sub

Also See
Alert Object
OmniPilot.OnAlert

>