Accessing reconnect button in the Plugin context menu of Amibroker

How to access the reconnect button in the plugin context menu, using any kind of codes, or is it possible to assign a shortcut key for reconnect button. Iam feeding my AmibrokerX64 version 6.20.1 using Excel with DDE universal plugin. My trading terminal which gives data to excel gets logged off automatically at the end of every trading day. iam running the whole setup on a VPS and i have made AutoIt script so as the trading terminal and my excel sheet gets opened automatically every morning. But still i have to connect to my VPS and manually press the reconnect button every day for the Amibroker to get feed. i want to automate the procees. Need your comments on it. Thanks.

@ragTrader,

See,

No, there is no shortcut key for that. Plugin status menu is exposed by plugin and AmiBroker does not control that and can't assign keyboard shortcuts to it.
The only way to automate reconnection is to just start AmiBroker. If you have auto it script that runs Excel, you can run AmiBroker as well. Or call .LoadDatabase from OLE.

Hi, Thanks
Closing and reopening Ami would further makes me to automate the settings of analysis window and running the scan. So i guess i would rather keep it running. I searched the forum and rather ended up in a code as below in my Excel VB editor to call loadDatabase function:

Sub loadDB()
Dim MYDATABASE As String
Dim OAB As Object
MYDATABASE = "C:\Program Files\AmiBroker\Banknifty"
Set OAB = CreateObject("Broker.Application")
OAB.loadDatabase (MYDATABASE)
End Sub

If i run the above code it doesnt returns any error and i could see the amibroker window just gets blinked for a moment but the plugin status remains the same as shutdown. It couldnt invoke a reconnect. I aint any programmer. Any comments would be appreciated. Thanks.

1 Like

LoadDatabase will not load it again if it is currently loaded. You have to call LoadDatabase for OTHER database than currently loaded.

Hi, that worked.
So at the end of the day i change my Ami database to an alternate database which i dont use and next day morning using Windows Task Scheduler i load my default working database on the Ami using a .js script and plugin status gets reconnected.
Thanks.