LocalStorage.Flush
method · LocalStorage · cAlgo.API
DesktopCLICloud
Saves all data to the disk. When using local storage, data is automatically saved every minute. Use this method if you want to save data without delays.
Environment behaviour
Cloud — not supported. Does nothing and reports no error; data is not persisted.
Definition
void Flush(LocalStorageScope localStorageScope)
api.LocalStorage.Flush(localStorageScope: LocalStorageScope) -> None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
localStorageScope | LocalStorageScope | LocalStorageScope | The storage scope to save to disk |
Examples
LocalStorage.SetString("Last Signal", "Buy EURUSD");
LocalStorage.Flush(LocalStorageScope.Instance);
Print("Local storage saved to disk");
api.LocalStorage.SetString("Last Signal", "Buy EURUSD")
api.LocalStorage.Flush(LocalStorageScope.Instance)
api.Print("Local storage saved to disk")