BBSTRADER 2.4.0
Loading...
Searching...
No Matches
objects.hpp File Reference

Declares the public API for the Metatrader5 objects in bbstrader library. This is the primary file that you should #include if you want to use these objects. More...

Include dependency graph for objects.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MT5::TerminalInfo
 Information regarding the terminal and connection status. More...
 
struct  MT5::AccountInfo
 Information about the trading account. More...
 
struct  MT5::SymbolInfo
 Comprehensive information about a specific financial instrument (Symbol). More...
 
struct  MT5::TickInfo
 Represents a single tick (price update). More...
 
struct  MT5::RateInfo
 Represents a bar of historical data (OHLCV). More...
 
struct  MT5::BookInfo
 Represents an entry in the Depth of Market (Order Book). More...
 
struct  MT5::TradeRequest
 Structure to send trade requests to the server. More...
 
struct  MT5::OrderCheckResult
 Results of an order check (validation) operation. More...
 
struct  MT5::OrderSentResult
 Results of a sent order. More...
 
struct  MT5::TradeOrder
 Represents an active or historical order. More...
 
struct  MT5::TradePosition
 Represents an open position. More...
 
struct  MT5::TradeDeal
 Represents a historical deal (execution). More...
 

Namespaces

namespace  MT5
 Namespace containing MetaTrader 5 (MT5) client definitions and wrapper classes.
 

Concepts

concept  MT5::IsScopedEnum
 Concept to check if a type is a scoped enumeration (Legacy fallback).
 

Enumerations

enum class  MT5::Timeframe : int32_t {
  MT5::M1 = 1 , MT5::M2 = 2 , MT5::M3 = 3 , MT5::M4 = 4 ,
  MT5::M5 = 5 , MT5::M6 = 6 , MT5::M10 = 10 , MT5::M12 = 12 ,
  MT5::M15 = 15 , MT5::M20 = 20 , MT5::M30 = 30 , MT5::H1 = 1 | 0x4000 ,
  MT5::H2 = 2 | 0x4000 , MT5::H3 = 3 | 0x4000 , MT5::H4 = 4 | 0x4000 , MT5::H6 = 6 | 0x4000 ,
  MT5::H8 = 8 | 0x4000 , MT5::H12 = 12 | 0x4000 , MT5::D1 = 24 | 0x4000 , MT5::W1 = 1 | 0x8000 ,
  MT5::MN1 = 1 | 0xC000
}
 Standard chart timeframes. More...
 
enum class  MT5::OrderType : int32_t {
  MT5::BUY = 0 , MT5::SELL = 1 , MT5::BUY_LIMIT = 2 , MT5::SELL_LIMIT = 3 ,
  MT5::BUY_STOP = 4 , MT5::SELL_STOP = 5 , MT5::BUY_STOP_LIMIT = 6 , MT5::SELL_STOP_LIMIT = 7 ,
  MT5::CLOSE_BY = 8
}
 Order types for market and pending orders. More...
 
enum class  MT5::OrderState : int32_t {
  MT5::STARTED = 0 , MT5::PLACED = 1 , MT5::CANCELED = 2 , MT5::PARTIAL = 3 ,
  MT5::FILLED = 4 , MT5::REJECTED = 5 , MT5::EXPIRED = 6 , MT5::REQUEST_ADD = 7 ,
  MT5::REQUEST_MODIFY = 8 , MT5::REQUEST_CANCEL = 9
}
 States of an order. More...
 
enum class  MT5::OrderFilling : int32_t { MT5::FOK = 0 , MT5::IOC = 1 , MT5::RETURN = 2 , BOC = 3 }
 Order filling policies. More...
 
enum class  MT5::OrderReason : int32_t {
  MT5::CLIENT = 0 , MT5::MOBILE = 1 , MT5::WEB = 2 , MT5::EXPERT = 3 ,
  MT5::SL = 4 , MT5::TP = 5 , MT5::SO = 6
}
 Reason or source for the order placement. More...
 
enum class  MT5::DealType : int32_t {
  MT5::BUY = 0 , MT5::SELL = 1 , MT5::BALANCE = 2 , MT5::CREDIT = 3 ,
  MT5::CHARGE = 4 , MT5::CORRECTION = 5 , MT5::BONUS = 6 , MT5::COMMISSION = 7 ,
  MT5::COMMISSION_DAILY = 8 , MT5::COMMISSION_MONTHLY = 9 , MT5::COMMISSION_AGENT_DAILY = 10 , MT5::COMMISSION_AGENT_MONTHLY = 11 ,
  MT5::INTEREST = 12 , MT5::BUY_CANCELED = 13 , MT5::SELL_CANCELED = 14 , MT5::DIVIDEND = 15 ,
  MT5::DIVIDEND_FRANKED = 16 , MT5::TAX = 17
}
 Types of deals involved in trading. More...
 
enum class  MT5::DealReason : int32_t {
  MT5::CLIENT = 0 , MT5::MOBILE = 1 , MT5::WEB = 2 , MT5::EXPERT = 3 ,
  MT5::SL = 4 , MT5::TP = 5 , MT5::SO = 6 , MT5::ROLLOVER = 7 ,
  MT5::VMARGIN = 8 , MT5::SPLIT = 9
}
 Reason for the deal execution. More...
 
enum class  MT5::TradeAction : int32_t {
  MT5::DEAL = 1 , MT5::PENDING = 5 , MT5::SLTP = 6 , MT5::MODIFY = 7 ,
  MT5::REMOVE = 8 , MT5::CLOSE_BY = 10
}
 Types of trade actions in a request. More...
 
enum class  MT5::SymbolCalcMode : int32_t {
  MT5::FOREX = 0 , MT5::FUTURES = 1 , MT5::CFD = 2 , MT5::CFDINDEX = 3 ,
  MT5::CFDLEVERAGE = 4 , MT5::FOREX_NO_LEVERAGE = 5 , MT5::EXCH_STOCKS = 32 , MT5::EXCH_FUTURES = 33 ,
  MT5::EXCH_OPTIONS = 34 , MT5::EXCH_OPTIONS_MARGIN = 36 , MT5::EXCH_BONDS = 37 , MT5::EXCH_STOCKS_MOEX = 38 ,
  MT5::EXCH_BONDS_MOEX = 39 , MT5::SERV_COLLATERAL = 64
}
 Mode of symbol margin and profit calculation. More...
 
enum class  MT5::SymbolTradeMode : int32_t {
  MT5::DISABLED = 0 , MT5::LONGONLY = 1 , MT5::SHORTONLY = 2 , MT5::CLOSEONLY = 3 ,
  MT5::FULL = 4
}
 Allowed trade modes for a symbol. More...
 
enum class  MT5::SymbolSwapMode : int32_t {
  MT5::DISABLED = 0 , MT5::POINTS = 1 , MT5::CURRENCY_SYMBOL = 2 , MT5::CURRENCY_MARGIN = 3 ,
  MT5::CURRENCY_DEPOSIT = 4 , MT5::INTEREST_CURRENT = 5 , MT5::INTEREST_OPEN = 6 , MT5::REOPEN_CURRENT = 7 ,
  MT5::REOPEN_BID = 8
}
 Swap calculation modes. More...
 
enum class  MT5::DayOfWeek : int32_t {
  SUNDAY = 0 , MONDAY = 1 , TUESDAY = 2 , WEDNESDAY = 3 ,
  THURSDAY = 4 , FRIDAY = 5 , SATURDAY = 6
}
 Days of the week.
 
enum class  MT5::SymbolGTCMode : int32_t { GTC = 0 , DAILY = 1 , DAILY_NO_STOPS = 2 }
 Expiration modes for Good-Till-Canceled orders.
 
enum class  MT5::OptionRight : int32_t { CALL = 0 , PUT = 1 }
 Option right type.
 
enum class  MT5::OptionMode : int32_t { EUROPEAN = 0 , AMERICAN = 1 }
 Option style.
 
enum class  MT5::AccountTradeMode : int32_t { DEMO = 0 , CONTEST = 1 , REAL = 2 }
 Account trade mode (Demo/Real).
 
enum class  MT5::AccountStopoutMode : int32_t { PERCENT = 0 , MONEY = 1 }
 Stop-out calculation mode.
 
enum class  MT5::AccountMarginMode : int32_t { RETAIL_NETTING = 0 , EXCHANGE = 1 , RETAIL_HEDGING = 2 }
 Account margin calculation mode.
 
enum class  MT5::BookType : int32_t { SELL = 1 , BUY = 2 , SELL_MARKET = 3 , BUY_MARKET = 4 }
 Order book entry type.
 
enum class  MT5::SymbolExecution : int32_t { REQUEST = 0 , INSTANT = 1 , MARKET = 2 , EXCHANGE = 3 }
 Symbol execution mode.
 
enum class  MT5::SymbolChartMode : int32_t { BID = 0 , LAST = 1 }
 Symbol chart price base.
 
enum class  MT5::DealEntry : int32_t { IN = 0 , OUT = 1 , INOUT = 2 , OUT_BY = 3 }
 Deal entry direction.
 
enum class  MT5::OrderTime : int32_t { GTC = 0 , DAY = 1 , SPECIFIED = 2 , SPECIFIED_DAY = 3 }
 Order expiration time flags.
 
enum class  MT5::PositionType : int32_t { BUY = 0 , SELL = 1 }
 Position type.
 
enum class  MT5::PositionReason : int32_t { CLIENT = 0 , MOBILE = 1 , WEB = 2 , EXPERT = 3 }
 Reason for position creation.
 
enum class  MT5::CopyTicks : int32_t { ALL = -1 , INFO = 1 , TRADE = 2 }
 Flags for copying ticks.
 
enum class  MT5::TickFlag : int32_t {
  MT5::BID = 0x02 , MT5::ASK = 0x04 , MT5::LAST = 0x08 , MT5::VOLUME = 0x10 ,
  MT5::BUY = 0x20 , MT5::SELL = 0x40
}
 Flags describing tick content. More...
 
enum class  MT5::TradeRetcode : int32_t {
  MT5::REQUOTE = 10004 , MT5::REJECT = 10006 , MT5::CANCEL = 10007 , MT5::PLACED = 10008 ,
  MT5::DONE = 10009 , MT5::DONE_PARTIAL = 10010 , MT5::ERROR = 10011 , MT5::TIMEOUT = 10012 ,
  MT5::INVALID = 10013 , MT5::INVALID_VOLUME = 10014 , MT5::INVALID_PRICE = 10015 , MT5::INVALID_STOPS = 10016 ,
  MT5::TRADE_DISABLED = 10017 , MT5::MARKET_CLOSED = 10018 , MT5::NO_MONEY = 10019 , MT5::PRICE_CHANGED = 10020 ,
  MT5::PRICE_OFF = 10021 , MT5::INVALID_EXPIRATION = 10022 , MT5::ORDER_CHANGED = 10023 , MT5::TOO_MANY_REQUESTS = 10024 ,
  MT5::NO_CHANGES = 10025 , MT5::SERVER_DISABLES_AT = 10026 , MT5::CLIENT_DISABLES_AT = 10027 , MT5::LOCKED = 10028 ,
  MT5::FROZEN = 10029 , MT5::INVALID_FILL = 10030 , MT5::CONNECTION = 10031 , MT5::ONLY_REAL = 10032 ,
  MT5::LIMIT_ORDERS = 10033 , MT5::LIMIT_VOLUME = 10034 , MT5::INVALID_ORDER = 10035 , MT5::POSITION_CLOSED = 10036 ,
  MT5::INVALID_CLOSE_VOLUME = 10038 , MT5::CLOSE_ORDER_EXIST = 10039 , MT5::LIMIT_POSITIONS = 10040 , MT5::REJECT_CANCEL = 10041 ,
  MT5::LONG_ONLY = 10042 , MT5::SHORT_ONLY = 10043 , MT5::CLOSE_ONLY = 10044 , MT5::FIFO_CLOSE = 10045
}
 Return codes from the trade server. More...
 
enum class  MT5::ReturnCode : int32_t {
  MT5::OK = 1 , MT5::FAIL = -1 , MT5::INVALID_PARAMS = -2 , MT5::NO_MEMORY = -3 ,
  MT5::NOT_FOUND = -4 , MT5::INVALID_VERSION = -5 , MT5::AUTH_FAILED = -6 , MT5::UNSUPPORTED = -7 ,
  MT5::AUTO_TRADING_DISABLED = -8 , MT5::INTERNAL_FAIL = -10000 , MT5::INTERNAL_FAIL_SEND = -10001 , MT5::INTERNAL_FAIL_RECEIVE = -10002 ,
  MT5::INTERNAL_FAIL_INIT = -10003 , MT5::INTERNAL_FAIL_CONNECT = -10004 , MT5::INTERNAL_FAIL_TIMEOUT = -10005
}
 Internal library return codes. More...
 
enum class  MT5::SymbolType : int32_t {
  MT5::FOREX = 0 , MT5::FUTURES = 1 , MT5::STOCKS = 2 , MT5::BONDS = 3 ,
  MT5::CRYPTO = 4 , MT5::ETFS = 5 , MT5::INDICES = 6 , MT5::COMMODITIES = 7 ,
  MT5::OPTIONS = 8 , MT5::UNKNOWN = 9
}
 Asset classes / Symbol types. More...
 

Functions

TickFlag MT5::operator| (TickFlag a, TickFlag b)
 Overload for TickFlag bitwise combination.
 
template<IsScopedEnum EnumClass>
constexpr auto MT5::operator+ (EnumClass a) noexcept
 Unary + operator to extract the underlying integer value of a scoped enum.
 

Detailed Description

Declares the public API for the Metatrader5 objects in bbstrader library. This is the primary file that you should #include if you want to use these objects.