3.6.3Loading and saving private settings

See the callout above before choosing private settings — in most cases category settings are the correct choice.

Note: SavePrivateSettings() takes a single argument - the settings object. There is no name/key parameter and no LoadPrivateSettings() function. To read back saved settings, access Framework.privateSettings directly. It is populated automatically before OnLoad fires.

As explained above, private settings only apply to widgets, not to a script or UDIX, and they only apply to a widget which has been loaded into the MyTrader page container. Other types of component can attempt to save private settings for themselves, but the data will be quietly discarded by the framework.

A widget can save private settings using Framework.SavePrivateSettings(). For example:

Framework.SavePrivateSettings({

instrumentId: "EUR/USD",

timeframe: 3600,

visualOptions: {

color: "blue"

}

});

When this instance of the widget is next reloaded by the page container, any existing saved settings will be present in Framework.privateSettings. (Unlike category settings, private settings are immediately and automatically available, and do not need a separate asynchronous load.)