---
id: "M:cAlgo.API.LocalStorage.Flush(cAlgo.API.LocalStorageScope)"
kind: "method"
type: "T:cAlgo.API.LocalStorage"
url: "https://help.ctrader.com/ctrader-algo/references/Localstorage/LocalStorage/Flush/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# LocalStorage.Flush

Member of [LocalStorage](https://help.ctrader.com/ctrader-algo/references/Localstorage/LocalStorage/index.md).

## Flush(LocalStorageScope localStorageScope)

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.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Does nothing and reports no error; data is not persisted.

C#:

```csharp
void Flush(LocalStorageScope localStorageScope)
```

Python:

```python
api.LocalStorage.Flush(localStorageScope: LocalStorageScope) -> None
```

### Parameters

- `localStorageScope` (`LocalStorageScope`, Python `LocalStorageScope`): The storage scope to save to disk

### Examples

C#:

```csharp
LocalStorage.SetString("Last Signal", "Buy EURUSD");
LocalStorage.Flush(LocalStorageScope.Instance);
Print("Local storage saved to disk");
```

Python:

```python
api.LocalStorage.SetString("Last Signal", "Buy EURUSD")
api.LocalStorage.Flush(LocalStorageScope.Instance)
api.Print("Local storage saved to disk")
```

