fbpx

Events_OnBrokerDisconnected

Events_OnBrokerDisconnected

This will insert the correct method signature needed to hook or trap the OnBrokerDisconnected event from OmniTrader.  This event is triggered when a brokerage connection is terminated.  This can result from actually loosing connection to the broker or from changing the broker from the tool bar within OT.  Double clicking this item will insert the following code.

Sub MyOnBrokerDisconnected(ByVal sBroker As String)
    ‘ statements
End Sub

You can change the method name (MyOnBrokerDisconnected) 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 BrokerDisConnected event fires you need to call OmniPilot.OnBrokerDisConnected(AddressOf ).

Example
Sub OnStartUp
     StartOT
     OmniPilot.OnBrokerDisconnected(AddressOf MyOnBrokerDisconnected)
End Sub

Sub MyOnBrokerDisconnected(ByVal sBroker As String)
    LogAction(“Connection to ” & sBroker & ” has been lost!”)
End Sub

Also See
OmniPilot.OnBrokerDisconnected
Broker

>