Built in Browser vs External. Custom toolbar buttons/shortcuts. Small icons instead of text buttons in the toolbar

Hi, does anyone use Amibroker's built in browser. A description appears in the User Guide in 'Profile View Pane' but I still have the following questions if anyone can help:

  1. What are the benefits of using the built in browser verses just using a separate browser to go to say http://finance.yahoo.com?
  2. How is it set up and used? Do I just click on it like viewing a chart? Do I need to code up the URL somehow?
  3. What's the Sync button for? Is it used with the template URL? Can I have multiple sites 'linked' to one symbol.

If it is apparent from my questions that I have no idea about it then you are correct; I don't. It would be nice to see a tutorial on YouTube showing it in operation.

Any guidance would be greatly appreciated.

Did you try using Google before asking? You can find answers to most (or all) of your questions following the first displayed link:

ABrowser

https://www.amibroker.com/guide/h_webresearch.html
http://www.amibroker.com/kb/tag/web-research/


If you are not satisfied with the inbuilt browser, you can code your own solution (for example with Gui Buttons) opening different web pages (in sync with the currently selected Symbol in AmiBroker) in external web browsers - Firefox, Chrome etc. using ShellExecute().

1 Like

@anthony2 Regarding your questions: I usually use external browsers, because they give more flexibility - I can block ads, scripts etc. Opening web pages in external browsers in sync with the currently selected in AmiBroker symbol is easy. For example:

_SECTION_BEGIN( "External browser" );

// -------- by Miłosz Mazurkiewicz ---------
/// @link https://forum.amibroker.com/t/built-in-browser-profile-view-pane/6011/3?u=milosz

Version (6.26);
GuiSetFont( "Segoe UI", 8.5 );
Vshift = 20;

GuiButton( "Stooq", 10, 5, 5 + Vshift, 75, 20, 255 );
GuiButton( "Bankier", 11, 5, 27 + Vshift, 75, 20, 1 );
GuiButton( "Infostrefa", 12, 5, 49 + Vshift, 75, 20, 1 );
GuiButton( "StockWatch", 13, 5, 71 + Vshift, 75, 20, 1 );

id = GuiGetEvent( 0, 0 ); event = GuiGetEvent( 0, 1 );

if( id == 10 AND event == 1 ) ShellExecute( "https://stooq.com/q/n/?s=" + Name(), "", "" );
if( id == 11 AND event == 1 ) ShellExecute( "http://www.bankier.pl/inwestowanie/profile/quote.html?symbol=" + FullName(), "", "" );
if( id == 12 AND event == 1 ) ShellExecute( "http://infostrefa.com/infostrefa/pl/wiadomosci/szukaj/1?keyword=" + FullName() + "&category=wszystko", "", "" );
if( id == 13 AND event == 1 ) ShellExecute( "https://www.stockwatch.pl/gpw/" + FullName() + ",wykres-swiece,wskazniki.aspx", "", "" );

_SECTION_END();

Ami%20external%20web%20browser%203

These are Polish web sites. You can modify my example code to work for the web pages that you use.

Regards.

15 Likes

Hi Milosz,

Thanks for your reply. Yes I did try a Google search, specifically:

However I didn't use a separate browser, I remained in this forum site. I found a window labelled 'Google' that came up after I clicked the search icon at the top right and I used the key words "Web Research +site:amibroker.com" in that. I didn't get the results you got and now of course the Google window that I used is nowhere to be seen so I cannot show it to you.

I did try the above key words in Chrome and got the same result you did so that's probably the best way to search for Amibroker topics.

The information that came up in the improved search and your explanation of what you do will help me a lot.

Thanks again.
Anthony

1 Like

GFX Button function is good. But Is there possible put the button on the toolbar.

1

Yes it can be done. You can create your own toolbar button(s) or shortcut(s) to AmiBroker's custom tool item(s) (Main menu ---> Tools). There are many possible applications - a quote from: https://www.amibroker.com/guide/w_customize.html

Custom tool menu items allow launching executable files (.exe), script files (.js, .vbs), web pages (.html) and any other registered file types from the tools menu.

For example:
Toolbar%20Buttons


  1. If you just want to open some predefinied web page in an external web browser (i.e. Firefox) and eventually navigate to some selected web page manually, you just need to add new tool like this:

Stooq%201

After clicking ST1 button, the web page opens in Firefox:

Stooq%201s


  1. In some cases you can also use "semi automatic" mode. This time when you click ST2 button, you will be prompted to enter some additional arguments (for example stock's name - in this case CDR) and thanks to this you can navigate directly to this Issues's web page.

Stooq%202

Stooq%202a

Stooq%202S


  1. Full automatic mode. I don't know if it is possible to pass directly the name of the currently selected Issue to a custom tool - I didn't succeed in doing that (if it is possible I would welcome showing me how :slight_smile: ) but it can be done using jscript (and there are many other applications of external jscripts accessed this easy way). For example this jscript opens webpages in an external web browser in sync with currently selected in AmiBroker Symbol:
// This is jscript code (not AFL)
AB = new ActiveXObject("Broker.Application");
Name = AB.ActiveDocument.Name;

var oShell = new ActiveXObject("Shell.Application");
oShell.ShellExecute("https://stooq.com/q/n/?s=" + Name, "", "");

I named this file: "Stooq Firefox.js" and saved it in AmiBroker's Scripts folder.

STT3

This time after clicking ST3 button, a new web page opens (in my case in Firefox) in sync with currently selected in AmiBroker Symbol.

Stooq%202S


10 Likes

And a small addition to my post above - showing how to create custom toolbar buttons (shortcuts to Tools items) and how those buttons work:

Custom%20Buttons%204

If you want to copy (not move) the items from the menu to the toolbar, press and hold CTRL when dragging the icons.

12 Likes

Although @chunwai doesn't seem to be very interested in my replies to his question, I decided to write about another thing which might be interesting for those users who would like to customize their AmiBroker's interface.

AmiBroker allows creating custom toolbar buttons / shortcuts to many different functions and options (examples and links in my replies above). I bet that not all users know, that those buttons can have three different visual forms: Text only, Image only or Text and image. Below you can see a screenshot showing two ordinary looking custom buttons (Normal | Floating) and 7 shortcuts to custom Tool items (like Stooq 1 - 3 from the example above) but this time looking like small icons:

Custom%20Icons


It was easier for me to show rather than write how it can be done:

Button%20Editor

In the Button Editor there are many options available for those who would like to create button's image manually, but there is also a very useful option allowing to import the image from a file or via copy/paste. So you can resize any image to icon's size - 16 x 16 (BMP format is the best choice) and import it to replace ordinary plain text. I really like those small icons :wink: I usually use this small program for that: PicPick


ps. Another appendix to my post with jscript code opening webpages in an external web browser (in sync with currently selected in AmiBroker Symbol). Some web pages use Names other Full Names (or other variants) of Stocks. If someone needs to retrieve Full Name of a currently selected (in AB) stock via OLE to open some specific web page, he/she can do it for example in this way:

// This is jscript code. Not AFL.
AB = new ActiveXObject("Broker.Application");
Name = AB.ActiveDocument.Name;
Sym = AB.Stocks(Name);
FullName = Sym.FullName;

var oShell = new ActiveXObject("Shell.Application");
oShell.ShellExecute("http://www.bankier.pl/inwestowanie/profile/quote.html?symbol=" + FullName, "", "" );

Summing up custom toolbar buttons are very handy. They are not bound to any specific chart and for this reason complement nicely recently introduced (and really useful) GuiButtons.

18 Likes

Hello Milosz,

STT3

When I click the button on the toolbar, it is open on the dreamweaver in my case.
I also try using Browser e.g. chrome open the js file, but it only print out the file content.

1 Like

My jscript opens web pages in a default web browser - in my case it is Firefox. So you can replace this line:

oShell.ShellExecute("https://stooq.com/q/n/?s=" + Name, "", "");

with this one, if you want to open a web page in Firefox:

oShell.ShellExecute("firefox.exe", "https://stooq.com/q/n/?s=" + Name, "");

or this one, if you want to use Chrome:

oShell.ShellExecute("chrome.exe", "https://stooq.com/q/n/?s=" + Name, "");

And remember, that these are only a few examples working for me ( Statica plugin + Polish web pages) showing how it can be done. You need to modify and customize them to be able to open specific web pages in your configuration. You use a different AB data base and probably would like to open other web pages...

4 Likes

Hello @Tomasz

Recently I've rediscovered custom Tools again (thanks to @chunwai whom I was trying to help a few days ago :wink: ) and I find using them (especially in form of small icons in the main toolbar) very, very handy - they complement nicely GuiButtons (which are bound to specific charts). If I may, I would like to ask you about a few things regarding this topic:

  1. Is it possible (for instance via editing the Registry) to have more than 10 custom Tool items available at the same time? I suppose currently there is a limit to 10. In the Customize/Tools window, I have created more than 10 items, but in my case, at the same time, I can use only 7-8 of them):

Tools%20M%203

  1. If the above is not possible, would you consider removing this limit (in the next releases) and allowing users to have more shortcuts/icons to custom tools present in the toolbar?

  2. Is it possible to pass the Name and FullName of the currently selected/active in AmiBroker Issue to a custom tool (for example to open a specific for this issue web page) without using OLE and jscript - as I do in some of my examples above?

Thank you in advance for the reply!

Regards.

2 Likes

Currently only 10 are allowed. The thing is that these appear in the Tools menu and menu that is too long is problematic for the display that is not able to fit them all. And to find out about current symbol from external program currently the only way is OLE interface.

2 Likes

Tomasz, thank you for the reply.

It is a pity, because shortcuts/icons to custom Tools in the toolbar are really convenient. Sometimes there is a lot of unused and available space in the toolbars (expecially when using high resolution displays). In AmiBroker Tools menu isn't that long. I think there should be enough space to accomodate at least 20 tools even on low-res displays. Besides in some programs long menus can be scrolled. If it's not feasible, there is probably another way. I will report it to the Feedback centre as a suggestion anyway ...

Regards.

1 Like

Scrolling menus is one of worst UI designs ever (nightmare to use) and they won't appear in AB.

Hello,

I've just seen this post today, I have a question if I may, you seem able to place toolbars next to windows toolbar in Amibroker -the one with File Edit View...etc, what version do you use? It does not work in my version, I`m using 6.25

Thanks

What I mean is this1

@Paul, go to Tools-Customize-Toolbars

If "Order" toolbar is checked then drag&drop "Buy" and "Sell" buttons from Order toolbar onto "Menu bar".
Then uncheck "Order" toolbar and close "Customize" window.
test

Alternatively if you want to keep "Order" toolbar the way it is (with buttons on there by default) then uncheck it first in "Tools-Customize-Toolbars" then go to Tools-Customize-Tools-Insert. Scroll to to bottom there at "Insert" menu and drag&drop "Buy" and "Sell" buttons from there onto Menu bar.
test2

4 Likes

Yep, I only try with the entire toolbar not with the items on it, items work indeed, thanks

In version 6.29 the number of user-definable tool menu items will be increased to 20.

4 Likes

Tomasz, thank you for that! :slight_smile:


And just a small appendix showing how to easily (and intuitively) separate different items / icons in the Toolbar, using a vertical divider. For example:

T1

versus:

T2

After adding a new item/icon, click it again and keeping the mouse button pressed, move/drag it slightly to the right. That's it:

Toolbar

7 Likes