Tax functions are used exclusively from the Tax System script in order to calculate and reduce capital gain taxes from the strategies.


Read more: Tax System Scripts


Sections


Functions

Function Details


Functions


Name

Description

double TaxAmount(int, int)

Gets the amount paid by a specified tax transaction denominated in the strategy currency.

string TaxComment(int, int)

Gets the comment set for a specified tax transaction.

int TaxCount(int)

Gets the number of tax transactions assigned to a specified strategy.

long TaxDateTime(int, int)

Gets the date/time of the last status update (Pending, Executed or Cancelled) of a specified tax transaction.

int TaxPay(int, double, string)

Creates a new tax transaction to pay taxes from a specified strategy. The tax will be deducted at the Desktop EOD time (23:59:59 UTC).


Function Details


double TaxAmount(int strategyNumber, int taxIndex)

Gets the amount paid by a specified tax transaction denominated in the strategy currency.


Returns


The amount paid by the specified tax transaction denominated in the strategy currency.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number of the tax transaction

int

taxIndex

The tax transaction index in the taxes table


Scripts


TaxSystem


string TaxComment(int strategyNumber, int taxIndex)

Gets the comment set for a specified tax transaction.


Returns


The comment set for the specified tax transaction.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number of the tax transaction

int

taxIndex

The tax transaction index in the taxes table


Scripts


TaxSystem


int TaxCount(int strategyNumber)

Gets the number of tax transactions assigned to a specified strategy.


Returns


The number of tax transactions assigned to the specified strategy.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number for which to count


Scripts


TaxSystem


long TaxDateTime(int strategyNumber, int taxIndex)

Gets the date/time of the last status update (Pending, Executed or Cancelled) of a specified tax transaction.


Returns


The date/time of the last status update (Pending, Executed or Cancelled) of the specified tax transaction.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number of the tax transaction

int

taxIndex

The tax transaction index


Scripts


TaxSystem


int TaxPay(int strategyNumber, double amount, string comment)

Creates a new tax transaction to pay taxes from a specified strategy. The tax will be deducted at the Desktop EOD time (23:59:59 UTC).


Returns


The tax transaction index of the new transaction in the taxes table.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number for which to create the tax transaction

double

amount

The tax transaction amount

string

comment

The tax transaction comment


Scripts


TaxSystem