I have a list of symbol in excel, is it possible to hyperlink a symbol to open the chart in AB?
you can create a hyperlink in excel to open amibroker, open specific chart formats, an amiquote list but not a specific chart. I have tried this but haven't found a way to link up to specific symbol chart. If anyone else has a solution, i would like to know too.
(put this sample code in the VBA "Sheet" section):
Sub AB_UpdateTicker(ticker) Dim oAB, oAW, oAD ' create AmiBroker object to update the ticker of the active document Set oAB = CreateObject("Broker.Application") oAB.Visible = True Set oAD = oAB.ActiveDocument Set oAW = oAB.ActiveWindow oAD.Name = ticker End Sub Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True AB_UpdateTicker (Target) End Sub
This quick example will invoke the macro with a double-click on a cell where you will have tickers in Excel (modifiy it as needed).
You can load chart template, you can select different chart tab, you can change AB chart sheet, you can set different symbol, you can insert current chart of AB as picture into Excel, .... etc. All in realtime.
Watch video proof and get enlightened: http://www.fastswf.com/89SCcbg
then go to church and make atonement for not believing in God "AmiBroker".
(The chart template's names you see in cell D6 of upper video refers to existing AB chart templates on hard drive e.g. test.ALY, test2.ALY etc.)
Did not doubt the capabilities of Amibroker here at all. I am just very new to programming and i could not find a way myself hence the request for some other intelligent soul like you to help. Thanks for pointing us in the right direction.
Once again thank you for your help. Really interesting VBA script. Will give it a try tonight.
@beppe I couldn't achieve what I wanted with the code.. I inserted the code in a new module and in sheet 1 from A1:A10 I have the list of symbols. what am I missing??
@twin, in my example, you need to "double click" on one of the tickers cells to trigger the macro (it is not an hyperlink).
If you do not like to double-click or want to use the double click for other purposes you should change the code/event to invoke the AB_UpdateTicker() macro; and obviously, you should have macro execution enabled in Excel.
Finally, as said above, you should have already opened an instance of AmiBroker.
is it possible to share an excel file?
Without too much knowledge of VBA, I succeeded in getting the code working thanks to your script.
I would like to thank you to make the code available.
This was something i was keenly looking at. I pasted your code into Excel VBA under Sheet1. But while executing, there is no macro to be chosen. When I changed the Sub AB_UpdateTicker(ticker) to only Sub AB_UpdateTicker, the macro shows up but not able to get the double-click in Excel cells and not able to get the chart changed in AB. Would love to get it working....
PS: I am quite new to VB.
Me too not able to get it to work. Were you able to do it finally?
Finally, i could get it after disabling the 'enable editing directly in cells'.