Predefined variables and constants

Prices

Open, High, Low, Close, Volume, Avg

Read-only variables - trading prices and volumes.

Avg = (High+Low+Close)/3

Trading signals variables and constants

Buy, Sell, Short, Cover

Logical variables initially filled by FALSE values. Fill these variables by your trading stategy logic.

The Scan operation is based on these variables too. Scan includes all date-time bars where any of these variables has a TRUE value.

BuyPrice, SellPrice, ShortPrice, CoverPrice

Prices for your trading signals. Fill them by your trading prices.

Signal types

sigBTO - buy to open

sigSTC - sell to close

sigSTO - sell to open (Short)

sigBTC - buy to close (cover)

Price types

priceMarket, priceLimit, priceStop

Instruments types

instrmntStock, instrmntForex, instrmntFuture, instrmntOption

Duration

tifDay, tifGTC

Exploration variable

Filter

Fill the Filter variable by TRUE in those bars which you want to be included in Exploration.

Colors

Colors constants:

colorDefault
colorCustom1
colorCustom2
colorCustom3
colorCustom4
colorCustom5
colorCustom6
colorCustom7
colorCustom8
colorCustom9
colorCustom10
colorCustom11
colorCustom12
colorCustom13
colorCustom14
colorCustom15
colorCustom16
colorBlack
colorBrown
colorDarkOliveGreen
colorDarkGreen
colorDarkTeal
colorDarkBlue
colorIndigo
colorDarkGrey
colorDarkRed
colorOrange
colorDarkYellow
colorGreen
colorTeal
colorBlue
colorBlueGrey
colorGrey40
colorRed
colorLightOrange
colorLime
colorSeaGreen
colorAqua
colorLightBlue
colorViolet
colorGrey50
colorPink
colorGold
colorYellow
colorBrightGreen
colorTurquoise
colorSkyblue
colorPlum
colorLightGrey
colorRose
colorTan
colorLightYellow
colorPaleGreen
colorPaleTurquoise
colorPaleBlue
colorLavender
colorWhite

Styles

Styles constants:

styleLine
styleHistogram
styleThick
styleDots
styleNoLine
styleDashed
styleCandle
styleBar
styleNoDraw
styleStaircase
styleSwingDots
styleNoRescale
styleNoLabel
stylePointAndFigure
styleArea
styleOwnScale
styleLeftAxisScale
styleNoTitle
styleCloud
styleClipMinMax
styleGradient

Time intervals

Time intervals constants:

in1Second
in15Minute
in1Minute
in5Minute
inDaily
inHourly
inMonthly
inWeekly
inQuarterly
inYearly

Position sizes

Position sizes constants:

spsValue - position size in dollars. For example:

SetPositionSize(1000, spsValue);

spsPercentOfEquity - position size defined as a percent of equity (1 - 100):

SetPositionSize(25, spsPercentOfEquity);

spsShares - position size in shares/contracts:

SetPositionSize(100, spsShares);

spsPercentOfPosition - position size as a percent of the currently open position (for SCALING IN and SCALING OUT ONLY)

spsNoChange - don't change previously set size for the given bar