Skip to content

Symbol

interface cAlgo.API.Internals

DesktopCLICloud

Represents a currency pair.

Definition

public interface Symbol

Namespace: cAlgo.API.Internals · Group: Symbols

Examples

Example 1

double bid = Symbol.Bid;
double ask = Symbol.Ask;
string name = Symbol.Name;
int digits = Symbol.Digits;
double pipSize = Symbol.PipSize;
double pointSize = Symbol.TickSize;
double spread = Symbol.Spread;
Print("{0} bid: {1}, ask: {2}, spread: {3} pips", name, bid, ask, spread / pipSize);
bid = api.Symbol.Bid
ask = api.Symbol.Ask
name = api.Symbol.Name
digits = api.Symbol.Digits
pipSize = api.Symbol.PipSize
pointSize = api.Symbol.TickSize
spread = api.Symbol.Spread
api.Print(f"{name} bid: {bid}, ask: {ask}, spread: {spread / pipSize} pips")

Example 2

using cAlgo.API;
using cAlgo.API.Internals;
using System;

namespace cAlgo
{
    // This sample indicator shows how to get a symbol data
    public partial class SymbolSample : Indicator
    {
        private TextBlock _spreadTextBlock;
        private TextBlock _bidTextBlock;
        private TextBlock _askTextBlock;
        private TextBlock _unrealizedGrossProfitTextBlock;
        private TextBlock _unrealizedNetProfitTextBlock;
        private TextBlock _timeTillOpenTextBlock;
        private TextBlock _timeTillCloseTextBlock;
        private TextBlock _isOpenedTextBlock;
        private Symbol _symbol;

        protected override void Initialize()
        {
            var grid = new Grid(44, 2)
            {
                BackgroundColor = Color.Gold,
                Opacity = 0.6,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center
            };

            var style = new Style();

            style.Set(ControlProperty.Padding, 1);
            style.Set(ControlProperty.Margin, 2);
            style.Set(ControlProperty.BackgroundColor, Color.Black);
            style.Set(ControlProperty.FontSize, 8);

            _symbol = UseCurrentSymbol ? Symbol : Symbols.GetSymbol(OtherSymbolName);

            grid.AddChild(new TextBlock
            {
                Text = "Symbol Info",
                Style = style,
                HorizontalAlignment = HorizontalAlignment.Center
            }, 0, 0, 1, 2);

            grid.AddChild(new TextBlock
            {
                Text = "Name",
                Style = style
            }, 1, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.Name,
                Style = style
            }, 1, 1);

            grid.AddChild(new TextBlock
            {
                Text = "ID",
                Style = style
            }, 2, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.Id.ToString(),
                Style = style
            }, 2, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Digits",
                Style = style
            }, 3, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.Digits.ToString(),
                Style = style
            }, 3, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Description",
                Style = style
            }, 4, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.Description,
                Style = style
            }, 4, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Lot Size",
                Style = style
            }, 5, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.LotSize.ToString(),
                Style = style
            }, 5, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Pip Size",
                Style = style
            }, 6, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.PipSize.ToString(),
                Style = style
            }, 6, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Pip Value",
                Style = style
            }, 7, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.PipValue.ToString(),
                Style = style
            }, 7, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Tick Size",
                Style = style
            }, 8, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.TickSize.ToString(),
                Style = style
            }, 8, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Tick Value",
                Style = style
            }, 9, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.TickValue.ToString(),
                Style = style
            }, 9, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Volume In Units Max",
                Style = style
            }, 10, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.VolumeInUnitsMax.ToString(),
                Style = style
            }, 10, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Volume In Units Min",
                Style = style
            }, 11, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.VolumeInUnitsMin.ToString(),
                Style = style
            }, 11, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Volume In Units Step",
                Style = style
            }, 12, 0);
            grid.AddChild(new TextBlock
            {
                Text = _symbol.VolumeInUnitsStep.ToString(),
                Style = style
            }, 12, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Ask",
                Style = style
            }, 13, 0);

            _askTextBlock = new TextBlock
            {
                Text = _symbol.Ask.ToString(),
                Style = style
            };

            grid.AddChild(_askTextBlock, 13, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Bid",
                Style = style
            }, 14, 0);

            _bidTextBlock = new TextBlock
            {
                Text = _symbol.Bid.ToString(),
                Style = style
            };

            grid.AddChild(_bidTextBlock, 14, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Spread",
                Style = style
            }, 15, 0);

            _spreadTextBlock = new TextBlock
            {
                Text = _symbol.Spread.ToString(),
                Style = style
            };

            grid.AddChild(_spreadTextBlock, 15, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Unrealized Gross Profit",
                Style = style
            }, 16, 0);

            _unrealizedGrossProfitTextBlock = new TextBlock
            {
                Text = _symbol.UnrealizedGrossProfit.ToString(),
                Style = style
            };

            grid.AddChild(_unrealizedGrossProfitTextBlock, 16, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Unrealized Net Profit",
                Style = style
            }, 17, 0);

            _unrealizedNetProfitTextBlock = new TextBlock
            {
                Text = _symbol.UnrealizedNetProfit.ToString(),
                Style = style
            };

            grid.AddChild(_unrealizedNetProfitTextBlock, 17, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Time Till Open",
                Style = style
            }, 18, 0);

            _timeTillOpenTextBlock = new TextBlock
            {
                Text = _symbol.MarketHours.TimeTillOpen().ToString(),
                Style = style
            };

            grid.AddChild(_timeTillOpenTextBlock, 18, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Time Till Close",
                Style = style
            }, 19, 0);

            _timeTillCloseTextBlock = new TextBlock
            {
                Text = _symbol.MarketHours.TimeTillClose().ToString(),
                Style = style
            };

            grid.AddChild(_timeTillCloseTextBlock, 19, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Is Opened",
                Style = style
            }, 20, 0);

            _isOpenedTextBlock = new TextBlock
            {
                Text = _symbol.MarketHours.IsOpened().ToString(),
                Style = style
            };

            grid.AddChild(_isOpenedTextBlock, 20, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Trading Sessions #",
                Style = style
            }, 21, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.MarketHours.Sessions.Count.ToString(),
                Style = style
            }, 21, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Trading Session Week Days",
                Style = style
            }, 22, 0);

            var weekDays = string.Empty;

            for (var iSession = 0; iSession < _symbol.MarketHours.Sessions.Count; iSession++)
            {
                var currentSessionWeekDays = string.Format("{0}({1})-{2}({3})", _symbol.MarketHours.Sessions[iSession].StartDay, _symbol.MarketHours.Sessions[iSession].StartTime, _symbol.MarketHours.Sessions[iSession].EndDay, _symbol.MarketHours.Sessions[iSession].EndTime);

                weekDays = iSession == 0 ? currentSessionWeekDays : string.Format("{0}, {1}", weekDays, currentSessionWeekDays);
            }

            grid.AddChild(new TextBlock
            {
                Text = weekDays,
                Style = style
            }, 22, 1);

            grid.AddChild(new TextBlock
            {
                Text = "Leverage Tier",
                Style = style
            }, 23, 0);

            var leverageTiers = string.Empty;

            for (var iLeverageTier = 0; iLeverageTier < _symbol.DynamicLeverage.Count; iLeverageTier++)
            {
                var currentLeverageTiers = string.Format("Volume up to {0} is {1}", _symbol.DynamicLeverage[iLeverageTier].Volume, _symbol.DynamicLeverage[iLeverageTier].Leverage);

                leverageTiers = iLeverageTier == 0 ? currentLeverageTiers : string.Format("{0}, {1}", leverageTiers, currentLeverageTiers);
            }

            grid.AddChild(new TextBlock
            {
                Text = leverageTiers,
                Style = style
            }, 23, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.BaseAsset),
                Style = style
            }, 24, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.BaseAsset.Name,
                Style = style
            }, 24, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.QuoteAsset),
                Style = style
            }, 25, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.QuoteAsset.Name,
                Style = style
            }, 25, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.PnLConversionFeeRate),
                Style = style
            }, 26, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.PnLConversionFeeRate.ToString(),
                Style = style
            }, 26, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.Commission),
                Style = style
            }, 27, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.Commission.ToString(),
                Style = style
            }, 27, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.CommissionType),
                Style = style
            }, 28, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.CommissionType.ToString(),
                Style = style
            }, 28, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.MinCommission),
                Style = style
            }, 29, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.MinCommission.ToString(),
                Style = style
            }, 29, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.MinCommissionAsset),
                Style = style
            }, 30, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.MinCommissionAsset.Name,
                Style = style
            }, 30, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.MinCommissionType),
                Style = style
            }, 31, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.MinCommissionType.ToString(),
                Style = style
            }, 31, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.AdministrativeCharge3DaysRollover),
                Style = style
            }, 32, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.AdministrativeCharge3DaysRollover.ToString(),
                Style = style
            }, 32, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.AdministrativeCharge),
                Style = style
            }, 33, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.AdministrativeCharge.ToString(),
                Style = style
            }, 33, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.GracePeriod),
                Style = style
            }, 34, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.GracePeriod.ToString(),
                Style = style
            }, 34, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.SwapLong),
                Style = style
            }, 35, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.SwapLong.ToString(),
                Style = style
            }, 35, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.SwapShort),
                Style = style
            }, 36, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.SwapShort.ToString(),
                Style = style
            }, 36, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.Swap3DaysRollover),
                Style = style
            }, 37, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.Swap3DaysRollover.ToString(),
                Style = style
            }, 37, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.SwapCalculationType),
                Style = style
            }, 38, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.SwapCalculationType.ToString(),
                Style = style
            }, 38, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.IsTradingEnabled),
                Style = style
            }, 39, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.IsTradingEnabled.ToString(),
                Style = style
            }, 39, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.TradingMode),
                Style = style
            }, 40, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.TradingMode.ToString(),
                Style = style
            }, 40, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.MinDistanceType),
                Style = style
            }, 41, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.MinDistanceType.ToString(),
                Style = style
            }, 41, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.MinTakeProfitDistance),
                Style = style
            }, 42, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.MinTakeProfitDistance.ToString(),
                Style = style
            }, 42, 1);

            grid.AddChild(new TextBlock
            {
                Text = nameof(_symbol.MinStopLossDistance),
                Style = style
            }, 43, 0);

            grid.AddChild(new TextBlock
            {
                Text = _symbol.MinStopLossDistance.ToString(),
                Style = style
            }, 43, 1);

            Chart.AddControl(grid);

            _symbol.Tick += Symbol_Tick;

            Timer.Start(TimeSpan.FromSeconds(1));
        }

        private void Symbol_Tick(SymbolTickEventArgs obj)
        {
            _askTextBlock.Text = obj.Symbol.Ask.ToString();
            _bidTextBlock.Text = obj.Symbol.Bid.ToString();
            _spreadTextBlock.Text = obj.Symbol.Spread.ToString();
            _unrealizedGrossProfitTextBlock.Text = obj.Symbol.UnrealizedGrossProfit.ToString();
            _unrealizedNetProfitTextBlock.Text = obj.Symbol.UnrealizedNetProfit.ToString();
        }

        protected override void OnTimer()
        {
            _timeTillOpenTextBlock.Text = _symbol.MarketHours.TimeTillOpen().ToString();
            _timeTillCloseTextBlock.Text = _symbol.MarketHours.TimeTillClose().ToString();
            _isOpenedTextBlock.Text = _symbol.MarketHours.IsOpened().ToString();
        }

        public override void Calculate(int index)
        {
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class SymbolSample():
    def initialize(self):
        grid = Grid(24, 2)
        grid.BackgroundColor = Color.Gold
        grid.Opacity = 0.6
        grid.HorizontalAlignment = HorizontalAlignment.Center
        grid.VerticalAlignment = VerticalAlignment.Center

        self.style = Style()

        self.style.Set(ControlProperty.Padding, 1)
        self.style.Set(ControlProperty.Margin, Thickness(2))
        self.style.Set(ControlProperty.BackgroundColor, Color.Black)
        self.style.Set(ControlProperty.FontSize, 8)

        self.symbol = api.Symbol if api.UseCurrentSymbol else api.Symbols.GetSymbol(api.OtherSymbolName)

        grid.AddChild(self.get_text_block("Symbol Info", HorizontalAlignment.Center), 0, 0, 1, 2)
        grid.AddChild(self.get_text_block("Name"), 1, 0)
        grid.AddChild(self.get_text_block(self.symbol.Name), 1, 1)
        grid.AddChild(self.get_text_block("ID"), 2, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.Id)), 2, 1)
        grid.AddChild(self.get_text_block("Digits"), 3, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.Digits)), 3, 1)
        grid.AddChild(self.get_text_block("Description"), 4, 0)
        grid.AddChild(self.get_text_block(self.symbol.Description), 4, 1)
        grid.AddChild(self.get_text_block("Lot Size"), 5, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.LotSize)), 5, 1)
        grid.AddChild(self.get_text_block("Pip Size"), 6, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.PipSize)), 6, 1)
        grid.AddChild(self.get_text_block("Pip Value"), 7, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.PipValue)), 7, 1)
        grid.AddChild(self.get_text_block("Tick Size"), 8, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.TickSize)), 8, 1)
        grid.AddChild(self.get_text_block("Tick Value"), 9, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.TickValue)), 9, 1)
        grid.AddChild(self.get_text_block("Volume In Units Max"), 10, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.VolumeInUnitsMax)), 10, 1)
        grid.AddChild(self.get_text_block("Volume In Units Min"), 11, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.VolumeInUnitsMin)), 11, 1)
        grid.AddChild(self.get_text_block("Volume In Units Step"), 12, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.VolumeInUnitsStep)), 12, 1)
        grid.AddChild(self.get_text_block("Ask"), 13, 0)

        self.askTextBlock = self.get_text_block(str(self.symbol.Ask))

        grid.AddChild(self.askTextBlock, 13, 1)

        grid.AddChild(self.get_text_block("Bid"), 14, 0)

        self.bidTextBlock = self.get_text_block(str(self.symbol.Bid))

        grid.AddChild(self.bidTextBlock, 14, 1)

        grid.AddChild(self.get_text_block("Spread"), 15, 0)

        self.spreadTextBlock = self.get_text_block(str(self.symbol.Spread))

        grid.AddChild(self.spreadTextBlock, 15, 1)

        grid.AddChild(self.get_text_block("Unrealized Gross Profit"), 16, 0)

        self.unrealizedGrossProfitTextBlock = self.get_text_block(str(self.symbol.UnrealizedGrossProfit))

        grid.AddChild(self.unrealizedGrossProfitTextBlock, 16, 1)

        grid.AddChild(self.get_text_block("Unrealized Net Profit"), 17, 0)

        self.unrealizedNetProfitTextBlock = self.get_text_block(str(self.symbol.UnrealizedNetProfit))

        grid.AddChild(self.unrealizedNetProfitTextBlock, 17, 1)

        grid.AddChild(self.get_text_block("Time Till Open"), 18, 0)

        self.timeTillOpenTextBlock = self.get_text_block(str(self.symbol.MarketHours.TimeTillOpen()))

        grid.AddChild(self.timeTillOpenTextBlock, 18, 1)

        grid.AddChild(self.get_text_block("Time Till Close"), 19, 0)

        self.timeTillCloseTextBlock = self.get_text_block(str(self.symbol.MarketHours.TimeTillClose()))

        grid.AddChild(self.timeTillCloseTextBlock, 19, 1)

        grid.AddChild(self.get_text_block("Is Opened"), 20, 0)

        self.isOpenedTextBlock = self.get_text_block(str(self.symbol.MarketHours.IsOpened()))

        grid.AddChild(self.isOpenedTextBlock, 20, 1)

        grid.AddChild(self.get_text_block("Trading Sessions #"), 21, 0)
        grid.AddChild(self.get_text_block(str(self.symbol.MarketHours.Sessions.Count)), 21, 1)

        grid.AddChild(self.get_text_block("Trading Session Week Days"), 22, 0)

        weekDays = ""

        for iSession in range(self.symbol.MarketHours.Sessions.Count):
            currentSessionWeekDays = f"{self.symbol.MarketHours.Sessions[iSession].StartDay}({self.symbol.MarketHours.Sessions[iSession].StartTime})-{self.symbol.MarketHours.Sessions[iSession].EndDay}({self.symbol.MarketHours.Sessions[iSession].EndTime})"
            weekDays = currentSessionWeekDays if iSession == 0 else f"{weekDays}, {currentSessionWeekDays}"

        grid.AddChild(self.get_text_block(weekDays), 22, 1)

        grid.AddChild(self.get_text_block("Leverage Tier"), 23, 0)

        leverageTiers = ""

        for iLeveragTier in range(self.symbol.DynamicLeverage.Count):
            currentLeverageTiers = f"Volume up to {self.symbol.DynamicLeverage[iLeveragTier].Volume} is {self.symbol.DynamicLeverage[iLeveragTier].Leverage}"
            leverageTiers = currentLeverageTiers if iLeveragTier == 0 else f"{leverageTiers}, {currentLeverageTiers}"

        grid.AddChild(self.get_text_block(leverageTiers), 23, 1)

        api.Chart.AddControl(grid)

        self.symbol.Tick += self.on_symbol_tick

        api.Timer.Start(1)

    def on_symbol_tick(self, args):
        self.askTextBlock.Text = str(args.Symbol.Ask)
        self.bidTextBlock.Text = str(args.Symbol.Bid)
        self.spreadTextBlock.Text = str(args.Symbol.Spread)
        self.unrealizedGrossProfitTextBlock.Text = str(args.Symbol.UnrealizedGrossProfit)
        self.unrealizedNetProfitTextBlock.Text = str(args.Symbol.UnrealizedNetProfit)

    def on_timer(self):
        self.timeTillOpenTextBlock.Text = str(self.symbol.MarketHours.TimeTillOpen())
        self.timeTillCloseTextBlock.Text = str(self.symbol.MarketHours.TimeTillClose())
        self.isOpenedTextBlock.Text = str(self.symbol.MarketHours.IsOpened())

    def get_text_block(self, text, horizontalAlignment = None):
        textBlock = TextBlock()
        textBlock.Text = text
        textBlock.Style = self.style
        if horizontalAlignment is not None:
            textBlock.HorizontalAlignment = horizontalAlignment
        return textBlock
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true,
  "Parameters": [
    {
      "Name": "UseCurrentSymbol",
      "DisplayName": "Use Current Symbol",
      "Type": "Boolean",
      "DefaultValue": true
    },
    {
      "Name": "OtherSymbolName",
      "DisplayName": "Other Symbol Name",
      "Type": "String",
      "DefaultValue": "GBPUSD"
    }
  ]
}

Methods

Name Description
AmountRiskedDesktopCLIClouddouble Calculates the amount to be risked based on the specified stop loss and trading volume. Note that the result of this calculation may be imprecise as the exact degree of risk always depends on market movement and is impossible to predict.
GetEstimatedMarginDesktopCLIClouddouble Returns the amount of margin you need for x amount of volume.
NormalizeVolumeInUnitsDesktopCLIClouddouble Round the volume to the amount suitable for a trade.
PipsForFixedRiskDesktopCLIClouddouble Calculates the number of pips to be risked based on the specified stop loss and trading volume. Note that the result of this calculation may be imprecise as the exact degree of risk always depends on market movement and is impossible to predict.
PipsForProportionalRiskDesktopCLIClouddouble Calculates the stop loss (in pips) for the proportional amount to be risked based on the specified volume. Note that the result of this calculation may be imprecise as the exact degree of risk always depends on market movement and is impossible to predict.
QuantityToVolumeInUnitsDesktopCLIClouddouble Convert Quantity (in lots) to Volume in units of base currency.
VolumeForFixedRisk 2 overloadsDesktopCLIClouddouble Calculates the volume to be risked (in X units of the account deposit currency) based on the specified stop loss. Note that the result of this calculation may be imprecise as the exact degree of risk always depends on market movement and is impossible to predict.
VolumeForProportionalRisk 2 overloadsDesktopCLIClouddouble Calculates the volume to be risked (in X% of either the account equity or balance) based on the specified stop loss. Note that the result of this calculation may be imprecise as the exact degree of risk always depends on market movement and is impossible to predict.
VolumeInUnitsToQuantityDesktopCLIClouddouble Convert Volume in units of base currency to Quantity (in lots).

Properties

Name Description
AdministrativeChargeDesktopCLIClouddouble 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.
AdministrativeCharge3DaysRolloverDesktopCLICloudDayOfWeek? Gets the Day of the week (in UTC) when Administrative Fee charge amount will be tripled. Only applicable for SWAP free trading accounts.
AskDesktopCLIClouddouble Gets the current ask price for this symbol.
BaseAssetDesktopCLICloudAsset Gets the symbol base asset.
BidDesktopCLIClouddouble Gets the current bid price for this symbol.
CommissionDesktopCLIClouddouble Gets the amount of base commission for the symbol.
CommissionTypeDesktopCLICloudSymbolCommissionType Gets the symbol base commission calculation type.
DigitsDesktopCLICloudint Gets the number of digits for the symbol.
DynamicLeverageDesktopCLICloudIReadonlyList<LeverageTier> Gets the dynamic leverage tiers for the symbol.
FuturesSettingsDesktopCLICloudFuturesSettings Gets the future contract settings if symbol represents a future contract otherwise null.
GracePeriodDesktopCLICloudint Gets 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.
IsCustomDesktopCLICloudbool Gets whether current symbol is a custom symbol or not.
IsTradingEnabledDesktopCLICloudbool Gets If trading is enabled or not for the symbol.
LotSizeDesktopCLICloudlong Gets the size of 1 lot in units of the base currency.
MarketHoursDesktopCLICloudMarketHours Gets access to the symbol's trading sessions schedule.
MinCommissionDesktopCLIClouddouble Gets 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.
MinCommissionAssetDesktopCLICloudAsset Gets 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.
MinCommissionTypeDesktopCLICloudSymbolMinCommissionType Gets the symbol minimum commission type. Use this property to interpret MinCommission value.
MinDistanceTypeDesktopCLICloudSymbolMinDistanceType Gets the symbol minimum distances type.
MinStopLossDistanceDesktopCLIClouddouble Gets symbol minimum stop loss distance. Use MinDistanceType for interpretation.
MinTakeProfitDistanceDesktopCLIClouddouble Gets symbol minimum take profit distance. Use MinDistanceType for interpretation.
PipSizeDesktopCLIClouddouble Gets the pip size for current symbol.
PipValueDesktopCLIClouddouble Gets the monetary value of one pip. This is the monetary value of one pip of the symbol when you started your cBot or initialized your indicator. Its not updated in real time and it remains constant.
PnLConversionFeeRateDesktopCLIClouddouble Gets the symbol profit and loss conversion fee rate.
QuoteAssetDesktopCLICloudAsset Gets the symbol quote asset.
SentimentDesktopCLICloudSymbolSentiment Gets symbol sentiment.
SpreadDesktopCLIClouddouble Gets the current spread of this symbol.
Swap3DaysRolloverDesktopCLICloudDayOfWeek? Gets the Day of the week when Symbol SWAP charge amount will be tripled.
SwapCalculationTypeDesktopCLICloudSymbolSwapCalculationType Gets the symbol SWAP calculation type.
SwapLongDesktopCLIClouddouble Gets the SWAP charge for long positions of the symbol.
SwapShortDesktopCLIClouddouble Gets the SWAP charge for short positions of the symbol.
TickSizeDesktopCLIClouddouble Gets the tick size for the current symbol.
TickValueDesktopCLIClouddouble Gets the monetary value of one tick. This is the monetary value of one tick of the symbol when you started your cBot or initialized your indicator. Its not updated in real time and it remains constant.
TradingModeDesktopCLICloudSymbolTradingMode Gets symbol trading mode.
UnrealizedGrossProfitDesktopCLIClouddouble Gets the sum of the unrealized Gross profits of the positions of this Symbol
UnrealizedNetProfitDesktopCLIClouddouble Gets the sum of the unrealized Net profits of the positions of this Symbol.
VolumeInUnitsMaxDesktopCLIClouddouble Gets the maximum tradable amount.
VolumeInUnitsMinDesktopCLIClouddouble Gets the minimum tradable amount.
VolumeInUnitsStepDesktopCLIClouddouble Gets the minimum trade amount increment.

Events

Name Description
TickDesktopCLICloudAction<SymbolTickEventArgs> Occurs on each incoming symbol ticks
Deprecated members (10)
  • long NormalizeVolume(double volume, RoundingMode roundingMode) — Use NormalizeVolumeInUnits instead
  • long QuantityToVolume(double quantity) — Use QuantityToVolumeInUnits instead
  • double VolumeToQuantity(long volume) — Use VolumeInUnitsToQuantity instead
  • string Code {get;} — Use Symbol.Name instead
  • double PointSize {get;} — Use TickSize instead
  • long VolumeMin {get;} — Use VolumeInUnitsMin instead
  • long VolumeMax {get;} — Use VolumeInUnitsMax instead
  • long VolumeStep {get;} — Use VolumeInUnitsStep instead
  • int Leverage {get;} — Use DynamicLeverage instead
  • double PreciseLeverage {get;} — Use DynamicLeverage instead