Support

Equilla Formula Language

About Trading

Equilla is providing a number of functions and statistic variables to help you to define your trading strategies.

Order Commands

Buy Enters a new long position.
Short Enters a new short position.
Cover Decreases or closes a short position.
Sell Decreases or closes a long position.
ExitPosition Decreases or closes a long or short position.

Profit and Loss

ClosedEquity Returns the closed equity for a specific instrument.
Commission Calculates commissions.
GlobalClosedEquity Returns the closed equity for all instruments.
GlobalOpenEquity Returns the open equity for all instruments.
OpenEquity Returns the open equity for a specific instrument.
OpenPosition Returns the open position for a specific instrument.
Slippage Calculates a slippage value.

Position Management

AvgEntryPrice Returns the average entry price of all entries in the current position.
BarsSinceEntry Returns the number of bars elapsed since a position has been entered.
BarsSinceExit Returns the number of bars elapsed since a position has been closed.
CurrentContracts Returns the number of contracts in the current position.
CurrentEntries Returns the number of open entries in the current position.
EntryAmount Returns the quantity of an entry order in a position.
EntryCount Returns the total number of entries order in a given position.
EntryDate Returns the Date of an entry order in a position.
EntryDateTime Returns the DateTime of an entry order in a position.
EntryLabel Returns the label of an entry order in a position.
EntryPrice Returns the price of an entry order in a position.
EntryTime Returns the Time of an entry order in a position.
ExitAmount Returns the quantity of an exit order in a position.
ExitCount Returns the total number of exit orders in a given position.
ExitDate Returns the Date of an exit order in a position.
ExitDateTime Returns the DateTime of an exit order in a position.
ExitLabel Returns the label of an exit order in a position.
ExitPrice Returns the price of an exit order in a position.
ExitTime Returns the Time of an exit order in a position.
FilledOrderAmount Returns the quantity of a filled order in a position.
FilledOrderCount Returns the total number of filled orders in a given position.
FilledOrderDate Returns the Date of a filled order in a position.
FilledOrderDateTime Returns the DateTime of a filled order in a position.
FilledOrderId Returns the unique identifier of a filled order in a position.
FilledOrderIsEntry Returns true if a given filled order in a position is an entry order.
FilledOrderIsExit Returns true if a given filled order in a position is an exit order.
FilledOrderLabel Returns the label of a filled order in a position.
FilledOrderPrice Returns the price of a filled order in a position.
FilledOrderTime Returns the Time of a filled order in a position.
GetDefaultQuantity Returns the currently active default quantity.
InitialCapital Returns the value of the Initial Capital property.
MarketPosition Returns the current market position.
MaxContractProfit Returns the maximum profit per contract of a position.
MaxContracts Returns the maximum number of shares/contracts held in a position.
MaxEntries Returns the maximum number of entries in a position.
MaxPositionLoss Returns the maximum loss of a position.
MaxPositionProfit Returns the maximum profit of a position.
PositionProfit Returns the latest profit of a position.
SetDefaultQuantity Sets the default trading quantity for an instrument.

Statistics

Statistic Function Statistic Variable Description
AvgBarsLosTrade AllTrades::AvgBarsLoser Returns the average number of bars that elapsed during losing trades.
AvgBarsWinTrade AllTrades::AvgBarsWinner Returns the average number of bars that elapsed during winning trades.
AvgLosTrade AllTrades::AvgLosTrade Returns the average losing trade.
AvgWinTrade AllTrades::AvgWinTrade Returns the average winning trade.
GetStrategyName Returns the name of the current strategy. See also GetScriptName.
GrossLoss AllTrades::GrossLoss Returns the total amount of all closed losing trades.
GrossProfit AllTrades::GrossProfit
LargestLosTrade AllTrades::LargestLosTrade Returns the total amount of all closed winning trades.
LargestWinTrade AllTrades::LargestWinTrade Returns the amount of the largest closed winning trade.
MaxConsecLosers AllTrades::MaxConsecLoser Returns the largest number of consecutive losing closed trades.
MaxConsecWinners AllTrades::MaxConsecWinner Returns the largest number of consecutive winning closed trades.
MaxContractsHeld AllTrades::MaxContractsHeld The maximum number of shares/contracts held at any one time.
NumLosTrades AllTrades::NumberLoseTrades Returns the number of losing trades.
NumWinTrades AllTrades::NumberWinTrades Returns the number of winning trades.
PercentProfit AllTrades::PercentProfitable Returns the precentage of closed-out trades that were profitable.
TotalBarsLosTrade AllTrades::LosingBars Returns the total bars that elapsed during losing trades for all closed trades.
TotalBarsWinTrade AllTrades::WinningBars Returns the total bars that elapsed during winning trades for all closed trades.
TotalClosedPositions AllTrades::TotalClosedPositions Returns the total number of position changes to date, counting up the most recent flat position.
TotalPositions AllTrades::TotalPositions Returns the total number of position changes to date.
TotalTrades AllTrades::TotalTrades Returns the total number of trades made to date.

Risk Management

SetStopContract Sets the evaluation mode for build in stops to contract mode.
SetStopMode Sets the evaluation mode for build in stops.
SetStopPosition Sets the evaluation mode for build in stops to position mode.
SetStopBreakEven Activates the build in break even stop.
SetStopLoss Activates the build in stop loss.
SetStopPercentTrailing Activates the build in percent trailing stop.
SetStopProfitTarget Activates the build in profit target stop.
SetStopProfitTrailing Activates the build in profit trailing stop.
SetTradingStatus Controls how the trading engine is handling orders.
GetTradingStatus Returns the current state of the trading engine.

Active Order Tracking

GetActiveOrderCommand Returns the order command of an active order.
GetActiveOrderCount Returns the number of active orders.
GetActiveOrderDate Returns the Date value of an active order.
GetActiveOrderDateTime Returns the DateTime value of an active order.
GetActiveOrderDetails Returns the name of an active order.
GetActiveOrderId Returns the identifier of an active order.
GetActiveOrderPrice Returns the price attached to an active order.
GetActiveOrderQuantity Returns the quantity specified for an active order.
GetActiveOrderTime Returns the Time value of an active order.
GetActiveOrderType Returns the type of an active order.
IsActiveImplicitExitOrder Checks if an active order is an implicit exit order.

Order Generation

IsStrategyOrdersActive Returns true if orders can be generated on the current bar.
TradingStartDate Returns the date at which the trading engine starts trading.
TradingEndDate Returns the date at which the trading engine stops trading.

Trading Properties

TradeProps::StartDate Returns the date from which the trading engine started trading.
TradeProps::EndDate Returns the date at which the trading engine should stop trading.
TradeProps::InitialCapital Returns the specific percentage of the bar range used to create an artificial tick when a stop or limit order has been filled.
TradeProps::TickSimulationPercent Returns the specific percentage of the bar range used to create an artificial tick when a stop or limit order has been filled.
TradeProps::OrderGenerationMode Returns the mode which specifies when the strategies should generate new orders.
TradeProps::FieldsForRealTimeFillPriceGeneration Returns the fields from which prices are used to fill orders in realtime mode.
TradeProps::SlippagePerTradeMode Returns whether the specified slippage per trade is in percentage value or in absolute value.
TradeProps::SlippagePerTradeValue Returns What per trade slippage is be applied to each order when calculating profit.
TradeProps::SlippagePerUnitMode Returns whether the specified slippage per traded unit is in percentage value or in absolute value.
TradeProps::SlippagePerUnitValue Returns What per trade slippage is be applied to each traded unit when calculating profit.
TradeProps::CommissionPerTradeMode Returns whether the specified Commission per trade is in percentage value or in absolute value.
TradeProps::CommissionPerTradeValue Returns What per trade Commission is be applied to each order when calculating profit.
TradeProps::CommissionPerUnitMode Returns whether the specified Commission per traded unit is in percentage value or in absolute value.
TradeProps::CommissionPerUnitValue Returns What per trade Commission is be applied to each traded unit when calculating profit.]
TradeProps::CommissionMin Returns the minimum commission that can be applied to a single order.
TradeProps::CommissionMax Returns the Maximum commission that can be applied to a single order.
TradeProps::DefaultTradeQuantity Returns the default number of shares/contracts that will be traded with each order.
TradeProps::MaxTotalPositionSize Returns What the maximum position size should be. Orders that take the position beyond the specified size will not get placed.
TradeProps::PyramidingMode Returns whether orders are allowed to increase the current position without closing or reversing it.
TradeProps::MaxOpenEntries Returns maximum number of trades per order that can be opened at the same time.
TradeProps::DefaultStopMode Returns whether profit calculations for automatic exits should be based on the position profit or the per contract/share profit.
TradeProps::DefaultProfitTarget Returns the open profit that needs to be reached before the current position is exited.
TradeProps::DefaultStopLoss Returns what loss (calculated with the current open profit and the entry price) must be reached to automatically exit the position.
TradeProps::DefaultBreakEvenStop Returns value for open profit, which a stoploss is set to ensure that the trade breaks even.
TradeProps::DefaultProfitTrailingStop Returns what loss should occur from the current open profit before the position is exited.
TradeProps::DefaultPercentTrailingFloor Returns What open profit target needs to be reached before the percent trailiing stop is activated.
TradeProps::DefaultPercentTrailingPercentage Returns what percentage of the current open profit needs to be lost before the current position is exited.
TradeProps::UseCommissionAndSlippageInAutomatedStops Returns whether the commission and slippage values are to be taken into account when setting the prices and activation of stops and profit targets.