Below is a list of the functions, their syntax and a brief description about what they exactly do.

Price Volume Data

These are the parameters that you will use the most.

Parameter

Function

Description

Example

open

open

Returns the opening price of 1-minute candle of a stock.

high

high

Returns the High of the latest 1-minute candle of a stock

close

close

Returns the close price of latest 1 minute candle of a stock.

low

low

Returns lowest price in the latest 1 minute candle of a stock

volume

volume

Returns the Volume of shares bought and sold in the latest 1-minute candle of a stock

Additional Price and Costs

These parameters are generally used in setting the target, stoploss and trailing stop loss

Parameter

Function

Description

Example

buy_price

buy_price

Price at which a stock was bought after the long/short conditions were satisfied.

current_price

current_price

Current Price of the stock at the given moment in simulation time

trading_cost

trading_cost

It is sum of all charges including brokerage charges levied by the exchange on each order.

Central Tendencies

Central tendencies are used genrally for mean-reverting strategies.

Parameter

Function

Description

Example

sum

sum(p1,n1)

Returns the sum of "p1" parameter values of last "n1" minutes/days

mean

mean(p1,n1)

Returns the average of "p1" parameter over last "n1" periods. To see an example, Click on Try Now

median

median(p1,n1)

Returns the middle value from last "n1" minutes of parameter "p1". To see can example, click on "Try Now"

mode

mode(p1,n1)

Returns a number most commonly seen in last "n1" minutes/days of parameter "p1". To see an example, click on Try Now.

Range

Can be used to set stop loss and targets. Give a recent movement of the prices/

Parameter

Function

Description

Example

min

min(p1,n1)

Returns the minimum value of parameter "p1" in last "n1" minutes/days. To see an example, click on "Try Now"

max

max(p1, n1)

Returns the highest value of parameter "p1" in last "n1" minutes/days. To see an example, click on Try Now

standard deviation

std(p1,n1)

Gives an estimate of the volatility of parameter "p1" observed over last "n1" periods. Higher the value, more volatile it has been.

skewness

skewness(p1,n1)

Skewness is a parameter used to identify in which range the parameter "p1" values lie. If skewness is > 1, more values are above the average and vice versa. To see an example, click on Try Now.

kurtosis

kurt(p1,n1)

Kurtosis gives an estimate of how many values are near the average from last "n1" minutes/days of parameter "p1". If kurtosis > 1, it means that over 95% of values are near the average. To see an example, click on " Try Now"

rank

rank(p1,n1)

Returns the position of latest value of "p1" if last "n1" were listed in an ascending order. To see an example, click on Try Now

covariance

cov(p1,p2,n1)

Covariance is a statistical parameter that tells how closely volatility of two parameters, "p1" and "p2" had varied over last "n1" minutes/days. Higher the value, more closely the parameter volatility follow each other.

correlation

corr(p1,p2,n1)

Correlation varies between -1 and 1. It tells how closes the values of 2 parameters, "p1" and "p2" follow each other. If 1, "p1" and "p2" values change in exactly same manner over last n1 minute/day

scale

scale(p1,p2)

Normalizes parameter1 to the scale of parameter2

autocorrelation

auto_corr

It is an advanced statistical parameter that tells if movement of parameter "p1" is repeating itself or not.

Time movement

To be used when you want to retrieve older values of a particular parameter

Parameter

Function

Description

Example

difference

diff(p1,n1)

Returns the different between the latest and "n1"th last value of parameter "p1"

delay

delay(p1,n1)

Returns the previous "n1"th value of parameter "p1". To see an example, click on "Try Now"

Technical Indicators

One of the most commonly used operators. Note: Using just a technical indicator might not work most of the times. Combine it with some other parameter.

Parameter

Function

Description

Example

Moving Average Convergence Divergence

macd(n1)

A momentum indicator, that has a positive value when a 26 minute/day Simple Moving Average is below 12 minute/day Simple Moving Average. Higher the value, higher the difference, and a trend can be identified.

Exponential Moving Average

ema(p1,n1)

Returns a weighted-average of "p1" over "n1" minutes/days. It puts more importance to recent values than older values. It moves more closely with the original "p1" as compared to simple moving average

Relative Strength Index

rsi(n1)

Returns a value between 0 and 100 calculated over close price of minute candles of last "n1" minutes. When value is less than 30, it means the stock price might go up, and a value above 70 means the stock price might go down.

Volume Weighted Average Price

vwap(n1)

Returns the average price of a stock over last "n1" time periods. The prices have been adjusted for the volume in their respective candles. A very powerful parameter to capture trend.

True Range

tr()

Returns the maximum values from ( high - low,high - previous close, low - previous close). It is used to gauge the volatility in recent candle pattern. Higher the value, higher the volatility. To see an example, click on Try Now

Average True Range

atr(n1)

Returns a simple moving average of true range over "n1" minutes/days

Average Movement

average_movement(p1,n1 )

It is a custom indicator that returns the absolute value of change in parameter "p1" over last "n1" minutes/days

Ease of Movement

emv(n1)

It is a volume-based oscillator that fluctuates above and below the zero line. It returns a division of high- low and volume observed in the previous minute. Then it averages out for last n1 minutes/days. Acts as a very good validation to a price movement. To see an example, click on Try Now

Money Flow Index

mfi(n1)

It measures the buying pressure using both price and volume data of last n1 minutes/days and returns a numerical value. If that value is > 80, it signals a high buying pressure and a possibility of reversion from the upward trend. If the value is < 20, it signals a high selling pressure and a possibility of reversion from the downtrend.

On Balance Volume

obv(n)

It adds volume on minutes prices go up and subtracts volume on minutes when prices go down. Returns a net volume value than can be used to gauge market sentiment.

Rate of Change

roc(p1,n1)

Returns a % of change of a parameter "p1" observed over last "n1' minutes/days.

Aaron Up

aaron_up( p1,n1)

It tells an estimate of the strength of trend of a stock. It returns a % number that is calculated by (n1- minutes/days since highest parameter "p1" value was observed). Higher the value, stonger the up-trend is.

Aaron Down

aaron_down(p1,n1)

It tells an estimate of the strength of trend of a stock. It returns a % number that is calculated by (n1- minutes/days since lowest parameter "p1" value was observed). Higher the value, stonger the downtrend is.

Historical Profitability

hist_profit(n)

Gives a % of number of profitable candles in last n candle/total candles

Pivot Point

pivot()

Considered to be a very important parameter, it returns the average value of high, low and close price of previous minute/day.

Support Level 1

support_1()

It is the first level where a fall in price can be expected to stop. It is likely to continue falling if price crosses this level. Returns a value calculated by twice of pivot - high of minute/day.

Support Level 2

support_2()

It is the second level where a fall in price can be expected to stop. It is likely to continue falling if price crosses this level. Returns a value calculated by pivot - (high-low) of minute/day.

Support Level 3

support_3()

It is the final level where a fall in price can be expected to stop. A big breakout is expected is this level is crossed. Returns a value calculated by ( low - (high - pivot))

Resistance Level 1

resistance_1()

It is where the price tends to find its first resistance as it rises

Resistance Level 2

resistance_2()

It is where the price tends to find its second resistance as it rises

Resistance Level 3

resistance_3()

It is where the price tends to find its third resistance as it rises

Simple Moving Average

sma(p1,n1)

Evaluates the simple moving average of last n values of parameters

Bollinger Band

bb(p1,n1)

Reversal indicator which creates a 1 standard deviation envelope around moving average