Table of Contents

Class LimitFillRandom

Namespace
Balsam
Assembly
Balsam.Backtester.dll

Fills are determined by FillProbability when limit price equals extreme of the bar.

public class LimitFillRandom : LimitFillModel, ICloneable
Inheritance
LimitFillRandom
Implements
Inherited Members
Extension Methods

Constructors

LimitFillRandom()

Instantiates a new random limit fill model.

public LimitFillRandom()

LimitFillRandom(double)

Instantiates a new random limit fill model with the specified fill probability.

public LimitFillRandom(double fillProbability)

Parameters

fillProbability double

Properties

FillProbability

Gets/sets the probability a limit order will be filled when the limit price is equal to the low of the bar for buys (high of the bar for sells).

public double FillProbability { get; set; }

Property Value

double

FillProbabilitySeed

Gets/sets the seed for the random number generator used to fill limit orders. Specify a seed value in order to get reproducible results.

public int FillProbabilitySeed { get; set; }

Property Value

int

Methods

GetFillProbability()

Returns a random number from 0 to 1 from a thread-safe random number generator.

protected double GetFillProbability()

Returns

double

OnPriceEqualsLimit(Order, Bar, SimulationTime)

This method is called when price exactly equals limit. Currently returns true if random number between 0 and 1 is less than the fill probability.

protected override bool OnPriceEqualsLimit(Order order, Bar bar, SimulationTime simulationTime)

Parameters

order Order
bar Bar
simulationTime SimulationTime

Returns

bool