3.7.2Changing the market or timeframe of the current page

Any widget, script, or even UDIX can change the context of the current page in the MyTrader container without being part of the current page, using the functions Framework.SetCurrentPageInstrument() and Framework.SetCurrentPageTimeframe().

For example, the following script sets up a "slideshow", cycling the current page between different markets every 5 seconds until the script is terminated by the user:

var instrumentList = ["EUR/USD", "USD/JPY", "GBP/USD", "USD/CHF"];

var currentIndex = -1;

setInterval(function() {

currentIndex++;

if (currentIndex >= instrumentList.length) currentIndex = 0;

Framework.SetCurrentPageInstrument(instrumentList[currentIndex]);

}, 5000);