Skip to content

Plugin.LocalStorage

property · Plugin · cAlgo.API

DesktopCLICloud

Access the local storage API.

Environment behaviour

CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.

Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.

Definition

public LocalStorage LocalStorage {get;}
api.LocalStorage: LocalStorage

Returns LocalStorage

Examples

LocalStorage.SetString("LastStart", Server.Time.ToString("O"), LocalStorageScope.Device);
LocalStorage.Flush(LocalStorageScope.Device);
Print("Last start: {0}", LocalStorage.GetString("LastStart", LocalStorageScope.Device));
api.LocalStorage.SetString("LastStart", api.Server.Time.ToString("O"), LocalStorageScope.Device)
api.LocalStorage.Flush(LocalStorageScope.Device)
api.Print(f"Last start: {api.LocalStorage.GetString('LastStart', LocalStorageScope.Device)}")