Constants

This page provides documentation for various constants used throughout the API.

Overview

Constants are predefined values that can be used in different API operations. They help make your code more readable and maintainable by providing meaningful names for specific values.

Available Constants

Array Constants

  • Array Constants: Constants used in array operations

    • ARRAY_ENTIRE: Used to specify that an operation should be performed on the entire array

    • SORT_ASCENDING: Used to specify ascending sort order

    • SORT_DESCENDING: Used to specify descending sort order

Price Type Constants

  • TValueType: Constants used for specifying price types

    • OPEN: Opening price of a bar/candle

    • HIGH: Highest price of a bar/candle

    • LOW: Lowest price of a bar/candle

    • CLOSE: Closing price of a bar/candle

    • VOLUME: Trading volume of a bar/candle

  • TPriceType: Constants used for price calculations

    • Basic Prices (e.g., OPEN, HIGH, LOW, CLOSE)

    • Derived Prices (e.g., HL2, HLC3, HLCC4, OHLC4)

    • Used in indicators and analysis methods

Chart Objects

  • TObjectType: Constants used for specifying chart object types

    • Drawing Tools (e.g., TREND_LINE, RECTANGLE, ELLIPSE)

    • Fibonacci Tools (e.g., FIBO_RETRACEMENT, FIBO_FAN, FIBO_ARC)

    • Text Objects (e.g., TEXT, TEXT_LABEL)

    • Lines and Rays (e.g., V_LINE, H_LINE, RAY)

  • ObjProp: Constants used for object properties

    • Coordinates (e.g., OBJPROP_TIME1, OBJPROP_PRICE1)

    • Visual Properties (e.g., OBJPROP_COLOR, OBJPROP_STYLE, OBJPROP_WIDTH)

    • Text Properties (e.g., OBJPROP_FONTNAME, OBJPROP_FONTSIZE, OBJPROP_TEXT)

    • Fibonacci Properties (e.g., OBJPROP_FIBOLEVELS, OBJPROP_FIBOSHOWPRICE)

Statistics Constants

  • Statistics Constants: Constants used in TesterStatistics method

    • Trading Performance (e.g., STAT_NET_PROFIT, STAT_TOTAL_TRADES)

    • Risk Metrics (e.g., STAT_BALANCE_DRAWDOWN, STAT_EQUITY_DRAWDOWN)

    • Trade Analysis (e.g., STAT_CONSECUTIVE_PROFITS_MAX, STAT_LARGEST_PROFIT)

Symbol Information Constants

  • Symbol Info Number: Numeric symbol properties

    • Price Information (e.g., SYMBOL_PRICE_BID, SYMBOL_PRICE_ASK)

    • Volume Settings (e.g., SYMBOL_VOLUME_MIN, SYMBOL_VOLUME_MAX)

    • Margin Requirements (e.g., SYMBOL_MARGIN_INITIAL, SYMBOL_MARGIN_MAINTENANCE)

    • Trading Conditions (e.g., SYMBOL_TRADE_STOPS_LEVEL, SYMBOL_SPREAD)

  • Symbol Info String: String symbol properties

    • Currency Information (e.g., SYMBOL_CURRENCY_BASE, SYMBOL_CURRENCY_PROFIT)

    • Symbol Details (e.g., SYMBOL_DESCRIPTION, SYMBOL_PATH)

    • Trading Information (e.g., SYMBOL_EXCHANGE, SYMBOL_ISIN)

Time Value Constant

  • TimeValue: -An enumeration that defines predefined time values in 15-minute intervals throughout a 24-hour day. -This enum is useful for setting specific times of day in indicators and strategies.

Last updated