ShellExecute () - Opens webpage thrice

  1. When i use below code in my AFL, the URL opens thrice. Also whenever I do anything in chart even scrolling, the URL again opens thrice. Am i using this function incorrectly?
bi = barindex();

ShellExecute("" + bi, "", "" );

  1. Using ShellExecute() can i control to open the webpage in a new browser Tab, new browser window or refreshing the existing broweser tab ?
  1. It opens once per run, but you run your formula three times.

Hint: code check counts for execution too. Calling ShellExecute() unconditionally is a BadIdea

You should call it conditionally say from ParamTrigger

if( ParamTrigger("open page", "openpage") )
    ShellExecute("", "", "" );

or use static variables.

  1. Google is your friend: - read first link in search results

I want to open the URL using Javascript, because I want to control when to open URL in new tab and when in same tab.

Just testing, but below code is not working.



You’ve read wrong docs.

window is NOT JScript object. It does NOT exist in JScript.

It is BOM object. Browser Object Model It is exposed by browsers, not by JScript itself.

There is no browser here and no BOM.

Proper way to open URL in AmiBroker is using ShellExcute()