- Writing Indicators and Strategies
- Importing Instruments
- Environment and Error Reporting
- Extending Equilla
-
Meta Properties
- Meta
- AlertEnabled
- Author
- AutoScale
- BackBuffer
- Categories
- DataOptions
- DisplayUnit
- DynamicInlineSymbols
- EnhancedBufferDetection
- WarningForAutoConversionToSeries
- Legend
- Longname
- MoveWithParent
- OutputLotSize
- OutputTickSize
- EvaluateOnHistoricUpdates
- OutputTimeStamps
- ShareValueScale
- ShortCode
- ShowLegend
- SubChart
- Synopsis
- TrigMode
- ValueAxisLabel
- WebLink
- Drawing
- Alerts and Output
-
Color
- All Colors
- Color Functions
- Standard Color Constants
-
Extended Color Constants
- ColorAliceBlue
- ColorAntiqueWhite
- ColorAqua
- ColorAquamarine
- ColorAzure
- ColorBeige
- ColorBisque
- ColorBlack
- ColorBlanchedAlmond
- ColorBlue
- ColorBlueViolet
- ColorBrown
- ColorBurlyWood
- ColorCadetBlue
- ColorChartreuse
- ColorChocolate
- ColorCoral
- ColorCornflowerBlue
- ColorCornsilk
- ColorCrimson
- ColorCyan
- ColorDarkBlue
- ColorDarkCyan
- ColorDarkGoldenRod
- ColorDarkGray
- ColorDarkGreen
- ColorDarkKhaki
- ColorDarkMagenta
- ColorDarkOliveGreen
- ColorDarkOrange
- ColorDarkOrchid
- ColorDarkRed
- ColorDarkSalmon
- ColorDarkSeaGreen
- ColorDarkSlateBlue
- ColorDarkSlateGray
- ColorDarkTurquoise
- ColorDarkViolet
- ColorDeepPink
- ColorDeepSkyBlue
- ColorDimGray
- ColorDodgerBlue
- ColorFeldspar
- ColorFireBrick
- ColorFloralWhite
- ColorForestGreen
- ColorFuchsia
- ColorGainsboro
- ColorGhostWhite
- ColorGold
- ColorGoldenRod
- ColorGray
- ColorGreen
- ColorGreenYellow
- ColorHoneyDew
- ColorHotPink
- ColorIndianRed
- ColorIndigo
- ColorIvory
- ColorKhaki
- ColorLavender
- ColorLavenderBlush
- ColorLawnGreen
- ColorLemonChiffon
- ColorLightBlue
- ColorLightCoral
- ColorLightCyan
- ColorLightGoldenRodYellow
- ColorLightGrey
- ColorLightGreen
- ColorLightPink
- ColorLightSalmon
- ColorLightSeaGreen
- ColorLightSkyBlue
- ColorLightSlateBlue
- ColorLightSlateGray
- ColorLightSteelBlue
- ColorLightYellow
- ColorLime
- ColorLimeGreen
- ColorLinen
- ColorMagenta
- ColorMaroon
- ColorMediumAquaMarine
- ColorMediumBlue
- ColorMediumOrchid
- ColorMediumPurple
- ColorMediumSeaGreen
- ColorMediumSlateBlue
- ColorMediumSpringGreen
- ColorMediumTurquoise
- ColorMediumVioletRed
- ColorMidnightBlue
- ColorMintCream
- ColorMistyRose
- ColorMoccasin
- ColorNavajoWhite
- ColorNavy
- ColorOldLace
- ColorOlive
- ColorOliveDrab
- ColorOrange
- ColorOrangeRed
- ColorOrchid
- ColorPaleGoldenRod
- ColorPaleGreen
- ColorPaleTurquoise
- ColorPaleVioletRed
- ColorPapayaWhip
- ColorPeachPuff
- ColorPeru
- ColorPink
- ColorPlum
- ColorPowderBlue
- ColorPurple
- ColorRed
- ColorRosyBrown
- ColorRoyalBlue
- ColorSaddleBrown
- ColorSalmon
- ColorSandyBrown
- ColorSeaGreen
- ColorSeaShell
- ColorSienna
- ColorSilver
- ColorSkyBlue
- ColorSlateBlue
- ColorSlateGray
- ColorSnow
- ColorSpringGreen
- ColorSteelBlue
- ColorTan
- ColorTeal
- ColorThistle
- ColorTomato
- ColorTurquoise
- ColorViolet
- ColorWheat
- ColorWhite
- ColorWhiteSmoke
- ColorYellow
- ColorYellowGreen
-
Data and Properties
- Instrument Properties
- Series Data Fields
- Script
- Portfolio Support
-
Quote Fields
- Ask
- AskDate
- AskDatetime
- AskDateEx
- AskExchange
- AskSize
- AskTime
- AskTimeEx
- Bid
- BidDate
- BidDatetime
- BidDateEx
- BidExchange
- BidSize
- BidTime
- BidTimeEx
- BidDirectionNNM
- TodaysClose
- TodaysHigh
- TodaysLow
- TodaysOpen
- TodaysTrades
- TodaysTradesDown
- TodaysTradesUnchanged
- TodaysTradesUp
- TodaysVolume
- TodaysVolumeDown
- TodaysVolumeUnchanged
- TodaysVolumeUp
- DividendFreq
- DivYield
- EPS
- EPSEstimate
- PERatio
- ExpDateEx
- ExpStyle
- FND
- FNDEx
- High52Wk
- Low52Wk
- LEAPYear
- TradeDirectionSeries
- VWAP
- Last
- LastTradeDate
- LastTradeDateEx
- LastTradeDateTime
- PreviousClose
- PreviousOpenInt
- PreviousVolume
- Settlement
- SharesOut
- SICCode
- SymbolRoot
- TradeDate
- TradeDateEx
- TradeDateTime
- TradeExchange
- TradeTime
- TradeTimeEx
- TradeVolume
- Underlying
- CallOpenInt
- CallVolume
- q_IVolatility
- PutOpenInt
- PutVolume
- StrikePrice
- Level II
- Sessions and Holidays
- News
- Trader Information
- Date and Time
- Math Functions
- Strings
- Bar Information
-
Trading
- About Trading
- Order Processing
- Order Commands
-
Position Management
- BarsSinceEntry
- BarsSinceExit
- EntryDate
- EntryDateTime
- EntryPrice
- EntryAmount
- EntryCount
- ExitCount
- ExitLabel
- ExitAmount
- FilledOrderAmount
- FilledOrderCount
- FilledOrderDate
- FilledOrderDateTime
- FilledOrderId
- FilledOrderIsEntry
- FilledOrderIsExit
- FilledOrderLabel
- FilledOrderPrice
- FilledOrderTime
- EntryLabel
- EntryTime
- ExitDate
- ExitDateTime
- ExitPrice
- ExitTime
- InitialCapital
- MarketPosition
- MaxContracts
- MaxEntries
- MaxPositionLoss
- MaxPositionProfit
- MaxContractProfit
- PositionProfit
- AvgEntryPrice
- CurrentContracts
- CurrentEntries
- GetDefaultQuantity
- SetDefaultQuantity
- Profit and Loss
- Risk Management
-
Statistics
- GetStrategyName
- TotalTrades
- NumLosTrades
- NumWinTrades
- PercentProfit
- GrossProfit
- GrossLoss
- AvgBarsLosTrade
- AvgBarsWinTrade
- LargestLosTrade
- LargestWinTrade
- MaxConsecLosers
- MaxConsecWinners
- MaxContractsHeld
- TotalBarsLosTrade
- TotalBarsWinTrade
- AvgLosTrade
- AvgWinTrade
- TotalPositions
- TotalClosedPositions
- GlobalStatisticsCurrency
- GlobalStatisticsCurrencyMode
- GlobalStatisticsCurrencyFactor
- Active Order Tracking
- Order Generation
-
Trading Properties
- About TradeProps
- StartDate
- EndDate
- InitialCapital
- TickSimulationPercent
- OrderGenerationMode
- FieldsForRealTimeFillPriceGeneration
- SlippagePerTradeMode
- SlippagePerTradeValue
- SlippagePerUnitMode
- SlippagePerUnitValue
- CommissionPerTradeMode
- CommissionPerTradeValue
- CommissionPerUnitMode
- CommissionPerUnitValue
- CommissionMin
- CommissionMax
- DefaultTradeQuantity
- MaxTotalPositionSize
- PyramidingMode
- MaxOpenEntries
- DefaultStopMode
- DefaultProfitTarget
- DefaultStopLoss
- DefaultBreakEvenStop
- DefaultProfitTrailingStop
- DefaultPercentTrailingFloor
- DefaultPercentTrailingPercentage
- UseCommissionAndSlippageInAutomatedStops
-
Order Routing
- GetFilledAccountOrderCount
- GetFilledAccountOrderCommand
- GetFilledAccountOrderPrice
- GetFilledAccountOrderQuantity
- GetFilledAccountOrderDetails
- GetFilledAccountOrderDateTime
- GetFilledAccountOrderDate
- GetFilledAccountOrderTime
- GetBarFilledAccountOrderCount
- GetBarFilledAccountOrderCommand
- GetBarFilledAccountOrderPrice
- GetBarFilledAccountOrderQuantity
- GetBarFilledAccountOrderDetails
- GetBarFilledAccountOrderDateTime
- GetBarFilledAccountOrderDate
- GetBarFilledAccountOrderTime
- GetPendingAccountOrderCount
- GetPendingAccountOrderCommand
- GetPendingAccountOrderPrice
- GetPendingAccountOrderQuantity
- GetPendingAccountOrderDetails
- GetPendingAccountOrderDateTime
- GetPendingAccountOrderDate
- GetPendingAccountOrderTime
- CreateAccountOrder
- GetAccountPosition
- IsAccountConnected
- BarsSinceAccountUpdate
-
Tools
- Tools
- DrawTrendline
- DrawRectangle
- ToolDelete
- ToolGetType
- ToolGetFlags
- ToolSetFlags
- ToolGetStartDate
- ToolGetStartDateTime
- ToolGetStartTime
- ToolGetStartValue
- ToolGetEndDate
- ToolGetEndDateTime
- ToolGetEndTime
- ToolGetEndValue
- ToolSetStart
- ToolSetEnd
- ToolGetColor
- ToolGetWidth
- ToolGetStyle
- ToolSetColor
- ToolSetWidth
- ToolSetStyle
- ToolGetFirst
- ToolGetNext
- ToolGetExtLeft
- ToolSetExtLeft
- ToolGetExtRight
- ToolSetExtRight
- ToolGetExtTop
- ToolSetExtTop
- ToolGetExtBottom
- ToolSetExtBottom
-
Arrays
- Array Functions
- ArrayLength
- SetArrayLength
- GetArrayDimensions
- SetValRangeArray
- FillArray
- InsertAtArray
- InsertSortedArray
- RemoveAtArray
- ClearArray
- CopyArray
- Array_Copy
- AppendArray
- HighestArray
- LowestArray
- IndexOfHighestArray
- IndexOfLowestArray
- SortArray
- Array_Sort
- SearchArray
- BinarySearchArray
- CompareArray
- Array_GetType
- Sort2DArray
- CreateSortedIndexArray
- CreateSortedIndexArrayLegacy
- Array_Sum
- SummationArray
- SummationRecArray
- SummationSqrArray
- MedianArray
- AverageArray
- AvgDeviationArray
- HarmonicMeanArray
- KurtosisArray
- SkewnessArray
- StdDeviationArray
- StdErrorArray
- VarianceArray
-
Vectors
- Vector
- GlobalVector
- ReadVector
- WriteVector
- ReadVectorIndirect
- WriteVectorIndirect
- CreateSortedIndexVector
- VectorLength
- SortVector
- CopyVector
- CompareVector
- SetValRangeVector
- SetMaxIndexVector
- SummationVector
- SummationSqrVector
- SummationRecVector
- VarianceVector
- StdErrorVector
- StdDeviationVector
- MedianVector
- LowestVector
- IndexOfLowestVector
- HighestVector
- IndexOfHighestVector
- AverageVector
- AvgDeviationVector
- KurtosisVector
- SkewnessVector
- HarmonicMeanVector
- SearchVector
- BinarySearchVector
- FillVector
- AppendVector
- ClearVector
-
Errors and Warnings
- Errors and Warnings
-
Compiler Errors
- C1000
- C1001
- C1002
- C1003
- C1004
- C1005
- C1006
- C1007
- C1008
- C1009
- C1010
- C1011
- C1012
- C1013
- C1014
- C1015
- C1016
- C1017
- C1018
- C1019
- C1020
- C1021
- C1022
- C1023
- C1024
- C1025
- C1026
- C1027
- C1028
- C1029
- C1030
- C1031
- C1032
- C1033
- C1034
- C1035
- C1036
- C1037
- C1039
- C1040
- C1041
- C1042
- C1043
- C1044
- C1045
- C1046
- C1047
- C1048
- C1049
- C1050
- C1051
- C1052
- C1053
- C1054
- C1055
- C1056
- C1057
- C1058
- C1059
- C1060
- C1061
- C1062
- C1063
- C1064
- C1065
- C1066
- C1068
- C1069
- C1070
- C1071
- C1072
- C1073
- Compiler Warnings
-
Runtime Errors
- E3000
- E3001
- E3002
- E3003
- E3004
- E3005
- E3006
- E3007
- E3008
- E3009
- E3010
- E3011
- E3012
- E3013
- E3014
- E3015
- E3016
- E3017
- E3018
- E3019
- E3020
- E3021
- E3022
- E3023
- E3024
- E3025
- E3026
- E3027
- E3028
- E3029
- E3030
- E3031
- E3032
- E3033
- E3034
- E3035
- E3036
- E3037
- E3038
- E3039
- E3040
- E3041
- E3042
- E3043
- E3044
- E3045
- E3046
- E3047
- E3048
- E3049
- E3050
- E3051
- E3052
- E3053
- E3054
- E3055
- E3056
TotalBars
Returns the total number of bars.
Remarks
The total number of bars may be less than the maximum number of bars specified for a chart, however it can not exceed this value. If a new bar is generated and the maximum number of bars is exceeded, the oldest bar is dropped. This means the total number of bars remain constant after the maximum has been reached. You may use the FirstBar function, to determine the number of the first, or the LastBar function to determine the number of the last bar available for calculations.
Examples
Write the number of the first bar, the number of the last bar and the total number of bars to the output window
If IsLastBar Then Print( "The firstbar is " + CStr( FirstBar ) + ", the last bar is " + CStr( LastBar ) + ", the total number of bar is " + CStr( TotalBars ) );