---
id: "T:cAlgo.API.CustomSymbol"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/"
---

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

# CustomSymbol (interface)

Represents a custom symbol.

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

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public interface CustomSymbol
```

Available since cAlgo.API 5.3.

## Examples

C#:

```csharp
var customSymbol = CustomSymbols.Add("MYEURUSD", Symbols.GetSymbol("EURUSD"));
customSymbol.Description = "EURUSD copy with custom quotes";
customSymbol.TickDigits = 5;
customSymbol.PipDigits = 4;
customSymbol.BarsNeeded = args => args.CustomBars.AppendBars(MarketData.GetBars(args.CustomBars.TimeFrame, "EURUSD")
    .Select(bar => new CustomBar(bar.OpenTime, bar.Open, bar.High, bar.Low, bar.Close, (long)bar.TickVolume)));
customSymbol.UpdateQuote(1.08500, 1.08520);
```

Python:

```python
from System import Action
customSymbol = api.CustomSymbols.Add("MYEURUSD", api.Symbols.GetSymbol("EURUSD"))
customSymbol.Description = "EURUSD copy with custom quotes"
customSymbol.TickDigits = 5
customSymbol.PipDigits = 4
customSymbol.BarsNeeded = Action[CustomSymbolBarsNeededArgs](lambda args: api.Print(f"Bars needed for {args.CustomBars.TimeFrame}"))
customSymbol.UpdateQuote(1.08500, 1.08520)
```

## Methods

- `CustomBars AddBars(TimeFrame timeFrame)` — Adds bars for a time frame that will be used for this custom symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/AddBars/index.md)
- `CustomBars GetBars(TimeFrame timeFrame)` — Returns bars of a time frame if exists otherwise null. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/GetBars/index.md)
- `void RemoveAllUnloadedBars()` — Removes all existing unloaded custom bars that aren't being used. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/RemoveAllUnloadedBars/index.md)
- `bool RemoveBars(TimeFrame timeFrame)` — Removes bars of a time frame which has no user. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/RemoveBars/index.md)
- `void UpdateQuote(double? bid, double? ask)` — Updates current symbol quotes. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/UpdateQuote/index.md)

## Properties

- `double AdministrativeCharge {get; set;}` — Gets symbol administrative charge. Administrative fee will be charged instead of SWAP if account is marked as SWAP free. Only applicable for SWAP free trading accounts. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/AdministrativeCharge/index.md)
- `DayOfWeek? AdministrativeCharge3DaysRollover {get; set;}` — Gets / sets the Day of the week (in UTC) when Administrative Fee charge amount will be tripled. Only applicable for SWAP free trading accounts. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/AdministrativeCharge3DaysRollover/index.md)
- `double Ask {get;}` — Gets the current ask price for this symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Ask/index.md)
- `Action<CustomSymbolBarsNeededArgs> BarsNeeded {get; set;}` — Gets / sets BarsNeeded handler, it's triggered when bars are needed for a time frame of current custom symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/BarsNeeded/index.md)
- `Asset BaseAsset {get; set;}` — Gets / sets the symbol base asset. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/BaseAsset/index.md)
- `double Bid {get;}` — Gets the current bid price for this symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Bid/index.md)
- `double Commission {get; set;}` — Gets / sets the amount of base commission for the symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Commission/index.md)
- `SymbolCommissionType CommissionType {get; set;}` — Gets / sets the symbol base commission calculation type. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/CommissionType/index.md)
- `string Description {get; set;}` — Gets / sets symbol description. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Description/index.md)
- `ICollection<CustomSymbolLeverageTier> DynamicLeverage {get;}` — Gets / sets the symbol dynamic leverage. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/DynamicLeverage/index.md)
- `CustomSymbolFuturesSettings FuturesSettings {get; set;}` — Gets / sets custom future contract settings. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/FuturesSettings/index.md)
- `int GracePeriod {get; set;}` — Gets / sets symbol grace period. This is the number of days free of Administrative fee from the time of opening a position. Only applicable for SWAP free trading accounts. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/GracePeriod/index.md)
- `long Id {get;}` — Gets the custom symbol ID. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Id/index.md)
- `long LotSize {get; set;}` — Gets / sets the lot size. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/LotSize/index.md)
- `CustomSymbolMarketHours MarketHours {get;}` — Gets / sets the symbol market hours. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/MarketHours/index.md)
- `double MinCommission {get; set;}` — Gets / sets the minimum amount of commission for the symbol. This is the amount of commission that will be paid by trader for any trade. Check MinCommissionType for interpretation of MinCommission value. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/MinCommission/index.md)
- `Asset MinCommissionAsset {get; set;}` — Gets / sets the symbol minimum commission asset. If MinCommissionType is set to Asset then you can use this property to get that asset. The MinCommission value will be converted from MinCommissionAsset to account deposit asset at the moment of trade. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/MinCommissionAsset/index.md)
- `SymbolMinCommissionType MinCommissionType {get; set;}` — Gets / sets the symbol minimum commission type. Use this property to interpret MinCommission value. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/MinCommissionType/index.md)
- `SymbolMinDistanceType MinDistanceType {get; set;}` — Gets / sets the symbol minimum distances type. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/MinDistanceType/index.md)
- `double MinStopLossDistance {get; set;}` — Gets / sets symbol minimum stop loss distance. Use MinDistanceType for interpretation. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/MinStopLossDistance/index.md)
- `double MinTakeProfitDistance {get; set;}` — Gets / sets symbol minimum take profit distance. Use MinDistanceType for interpretation. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/MinTakeProfitDistance/index.md)
- `string Name {get;}` — Gets custom symbol unique name. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Name/index.md)
- `int PipDigits {get; set;}` — Gets / sets the symbol pip digits. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/PipDigits/index.md)
- `double PnLConversionFeeRate {get; set;}` — Gets / sets the symbol profit and loss conversion fee rate. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/PnLConversionFeeRate/index.md)
- `Asset QuoteAsset {get; set;}` — Gets / sets the symbol quote asset. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/QuoteAsset/index.md)
- `CustomSymbolSentiment Sentiment {get;}` — Gets custom symbol sentiment. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Sentiment/index.md)
- `DayOfWeek? Swap3DaysRollover {get; set;}` — Gets / sets the Day of the week when Symbol SWAP charge amount will be tripled. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Swap3DaysRollover/index.md)
- `SymbolSwapCalculationType SwapCalculationType {get; set;}` — Gets / sets the symbol SWAP calculation type. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/SwapCalculationType/index.md)
- `double SwapLong {get; set;}` — Gets / sets the SWAP charge for long positions of the symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/SwapLong/index.md)
- `int SwapPeriod {get; set;}` — Gets / sets symbol swap period. This is the number of days free of Administrative fee from the time of opening a position. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/SwapPeriod/index.md)
- `double SwapShort {get; set;}` — Gets / sets the SWAP charge for short positions of the symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/SwapShort/index.md)
- `int SwapTimeInMinutes {get; set;}` — Gets / sets the SWAP time in minutes. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/SwapTimeInMinutes/index.md)
- `Symbol Symbol {get;}` — Gets regular Symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/Symbol/index.md)
- `int TickDigits {get; set;}` — Gets / sets the symbol tick digits. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/TickDigits/index.md)
- `double VolumeInUnitsMax {get; set;}` — Gets / sets the maximum units value. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/VolumeInUnitsMax/index.md)
- `double VolumeInUnitsMin {get; set;}` — Gets / sets the minimum units value. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/VolumeInUnitsMin/index.md)
- `double VolumeInUnitsStep {get; set;}` — Gets / sets the step volume in units. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/VolumeInUnitsStep/index.md)
- `bool WeekendSwaps {get; set;}` — Gets / sets whether swap is charged on weekends or not. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/WeekendSwaps/index.md)

## Events

- `event Action<CustomSymbolBarsUnloadedEventArgs> BarsUnloaded;` — Occurs when a custom bars is unloaded and not being used anymore. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/BarsUnloaded/index.md)
- `event Action<CustomSymbolNewChartEventArgs> NewChart;` — Occurs when user opens a new chart of current custom symbol. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Symbol/Custom/CustomSymbol/NewChart/index.md)

