Table of Contents

Class PriceCalculator

Namespace
FinanceSharp.Helpers
Assembly
FinanceSharp.dll
public static class PriceCalculator
Inheritance
PriceCalculator
Inherited Members

Methods

CalculateProfit(BuyStyle, TickValue, TickValue, double)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, TickValue from, TickValue to, double budget)

Parameters

style BuyStyle
from TickValue
to TickValue
budget double

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, TickValue, TickValue, int)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, TickValue from, TickValue to, int quantity)

Parameters

style BuyStyle
from TickValue
to TickValue
quantity int

Non absolute quantity of the trade

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, TickValue, double, double)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, TickValue from, double to, double budget)

Parameters

style BuyStyle
from TickValue
to double
budget double

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, TickValue, double, int)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, TickValue from, double to, int quantity)

Parameters

style BuyStyle
from TickValue
to double
quantity int

Non absolute quantity of the trade

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, TickValue, float, int)

public static (float Profit, int Quantity) CalculateProfit(BuyStyle style, TickValue from, float to, int quantity)

Parameters

style BuyStyle
from TickValue
to float
quantity int

Non absolute quantity of the trade

Returns

(float Profit, int Quantity)

CalculateProfit(BuyStyle, TickValue, float, float)

public static (float Profit, int Quantity) CalculateProfit(BuyStyle style, TickValue from, float to, float budget)

Parameters

style BuyStyle
from TickValue
to float
budget float

Returns

(float Profit, int Quantity)

CalculateProfit(BuyStyle, double, TickValue, double)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, double from, TickValue to, double budget)

Parameters

style BuyStyle
from double
to TickValue
budget double

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, double, TickValue, int)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, double from, TickValue to, int quantity)

Parameters

style BuyStyle
from double
to TickValue
quantity int

Non absolute quantity of the trade

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, double, double, double)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, double from, double to, double budget)

Parameters

style BuyStyle
from double
to double
budget double

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, double, double, int)

public static (double Profit, int Quantity) CalculateProfit(BuyStyle style, double from, double to, int quantity)

Parameters

style BuyStyle
from double
to double
quantity int

Non absolute quantity of the trade

Returns

(double Profit, int Quantity)

CalculateProfit(BuyStyle, float, TickValue, float)

public static (float Profit, int Quantity) CalculateProfit(BuyStyle style, float from, TickValue to, float budget)

Parameters

style BuyStyle
from float
to TickValue
budget float

Returns

(float Profit, int Quantity)

CalculateProfit(BuyStyle, float, float, double)

public static (float Profit, int Quantity) CalculateProfit(BuyStyle style, float from, float to, double budget)

Parameters

style BuyStyle
from float
to float
budget double

Returns

(float Profit, int Quantity)

CalculateProfit(BuyStyle, float, float, int)

public static (float Profit, int Quantity) CalculateProfit(BuyStyle style, float from, float to, int quantity)

Parameters

style BuyStyle
from float
to float
quantity int

Returns

(float Profit, int Quantity)

CalculateProfit(BuyStyle, float, float, float)

public static (float Profit, int Quantity) CalculateProfit(BuyStyle style, float from, float to, float budget)

Parameters

style BuyStyle
from float
to float
budget float

Returns

(float Profit, int Quantity)

CalculateQuantity(BuyStyle, TickValue, double)

public static int CalculateQuantity(BuyStyle style, TickValue from, double budget)

Parameters

style BuyStyle
from TickValue
budget double

Returns

int

CalculateQuantity(BuyStyle, double, double)

public static int CalculateQuantity(BuyStyle style, double from, double budget)

Parameters

style BuyStyle
from double
budget double

Returns

int

CalculateQuantity(BuyStyle, float, double)

public static int CalculateQuantity(BuyStyle style, float from, double budget)

Parameters

style BuyStyle
from float
budget double

Returns

int

CalculateQuantity(BuyStyle, float, float)

public static int CalculateQuantity(BuyStyle style, float from, float budget)

Parameters

style BuyStyle
from float
budget float

Returns

int

CalculateTrade(BuyStyle, double, double, long, long, double)

public static Trade CalculateTrade(BuyStyle style, double from, double to, long timefrom, long timeto, double budget)

Parameters

style BuyStyle
from double
to double
timefrom long
timeto long
budget double

Returns

Trade

CalculateTrade(BuyStyle, double, double, long, long, int)

public static Trade CalculateTrade(BuyStyle style, double from, double to, long timefrom, long timeto, int quantity)

Parameters

style BuyStyle
from double
to double
timefrom long
timeto long
quantity int

Non absolute quantity of the trade

Returns

Trade

CalculateTrade(BuyStyle, long, TickValue, long, TickValue, double)

public static Trade CalculateTrade(BuyStyle style, long fromTime, TickValue from, long toTime, TickValue to, double budget)

Parameters

style BuyStyle
fromTime long
from TickValue
toTime long
to TickValue
budget double

Returns

Trade

EntryPrice(BuyStyle, TickValue)

Extracts the right price (bid or ask) for entering the market based on given purchase style.

public static double EntryPrice(BuyStyle style, TickValue tick)

Parameters

style BuyStyle

The style the trade will be done in.

tick TickValue

The tick to extract price from

Returns

double

EntryPrice(TickValue, BuyStyle)

Extracts the right price (bid or ask) for entering the market based on given purchase style.

public static double EntryPrice(this TickValue tick, BuyStyle style)

Parameters

tick TickValue

The tick to extract price from

style BuyStyle

The style the trade will be done in.

Returns

double

ExitPrice(BuyStyle, TickValue)

Extracts the right price (bid or ask) for entering the market based on given purchase style.

public static double ExitPrice(BuyStyle style, TickValue tick)

Parameters

style BuyStyle

The style the trade will be done in.

tick TickValue

The tick to extract price from

Returns

double

ExitPrice(TickValue, BuyStyle)

Extracts the right price (bid or ask) for entering the market based on given purchase style.

public static double ExitPrice(this TickValue tick, BuyStyle style)

Parameters

tick TickValue

The tick to extract price from

style BuyStyle

The style the trade will be done in.

Returns

double

LimitAtProfit(BuyStyle, TickValue, int, double)

public static double LimitAtProfit(BuyStyle style, TickValue tick, int quantity, double profitDollar)

Parameters

style BuyStyle

The trade style

tick TickValue
quantity int

Absolute quantity

profitDollar double

Profit in dollars, can be negative if loss planned

Returns

double

LimitAtProfit(BuyStyle, double, int, double)

public static double LimitAtProfit(BuyStyle style, double price, int quantity, double profitDollar)

Parameters

style BuyStyle

The trade style

price double

Price of the stock

quantity int

Absolute quantity

profitDollar double

Profit in dollars, can be negative if loss planned

Returns

double

LimitAtProfit(BuyStyle, double, int, float)

public static double LimitAtProfit(BuyStyle style, double price, int quantity, float profitPrecentage)

Parameters

style BuyStyle

The trade style

price double

Price of the stock

quantity int

Absolute quantity

profitPrecentage float

Profit in precentages, can be negative if loss planned. examples: 0.05f is 0.05% profit.

Returns

double