MLThon basic package¶
Submodules¶
mlthon.basics.defs module¶
- class CancelCode(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- CanceledByUser = 1¶
- SelfTradePrevention = 2¶
- Unset = 0¶
- class Exchange(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- Bequant = 2¶
- Binance = 5¶
- Binance_fut_coin = 9¶
- Binance_fut_usdt = 8¶
- Blockchain = 0¶
- Bybit = 1¶
- Deribit = 3¶
- Ftx = 6¶
- Huobi = 4¶
- Lmax = 7¶
- property exchange_code¶
Get exchange code for that exchange
- class ExecInstructions(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- PostOnly = 1¶
- Unset = 0¶
- class FeedHandlerStatus(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- Disconnected = 2¶
- SnapshotEnd = 1¶
- SnapshotStart = 0¶
- class GtwRejectCode(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- ExchBadQty = 2009¶
- ExchDupeOrderID = 2007¶
- ExchForbid = 2001¶
- ExchInsufficientBalance = 2003¶
- ExchInvalidRequest = 2014¶
- ExchIsClosed = 2015¶
- ExchOrderBelowMin = 2011¶
- ExchOrderCancelled = 2010¶
- ExchOrderExpired = 2008¶
- ExchOrderFilled = 2005¶
- ExchOrderNotFound = 2006¶
- ExchOverload = 2002¶
- ExchPostOnlyBreach = 2016¶
- ExchQtyCannotBeBelowCumQty = 2012¶
- ExchRateLimitBreach = 2000¶
- ExchReject = 2004¶
- ExchTooLateToCancel = 2013¶
- ExchTookTooLongToProcessRequest = 2017¶
- GtwCannotModify = 1004¶
- GtwCannotStackPendingRequests = 1003¶
- GtwInvalidRequest = 1008¶
- GtwNoRiskForSymbol = 1012¶
- GtwNotReady = 1000¶
- GtwOngoingCancel = 1011¶
- GtwOrderNotFound = 1006¶
- GtwOrderNotOpen = 1016¶
- GtwPendingCancelAll = 1005¶
- GtwQtyCannotBeBelowCumQty = 1009¶
- GtwRateLimitBreach = 1002¶
- GtwReduceMustLowerQty = 1010¶
- GtwRiskLongPosViolation = 1015¶
- GtwRiskMaxOrderSizeViolation = 1013¶
- GtwRiskShortPosViolation = 1014¶
- GtwRiskViolation = 1001¶
- GtwUnsupportedOp = 1007¶
- class GtwStatus(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- Connecting = 0¶
- Disconnected = 4¶
- Maintenance = 3¶
- ReadyToTrade = 1¶
- Synchronizing = 2¶
- class InstrumentType(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- Future = 2¶
- Perpetual = 1¶
- Spot = 0¶
- static try_parse_str(s)[source]¶
Try to parse InstrumentType from a string (type ID)
- Parameters
s (str) – string to parse (type ID)
- Returns
a tuple (bool,enum_val) where bool is true if parsing was a success. If so, enum_val will be the
corresponding parsed value
- property type_id¶
Type ID of this InstrumentType.
- Return type
a string, type ID for that InstrumentType.
- class OrderStatus(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- Cancelled = 4¶
- Expired = 6¶
- Filled = 2¶
- Open = 0¶
- PartiallyFilled = 1¶
- PendingCancel = 3¶
- Rejected = 5¶
- Suspended = 7¶
- Unknown = -1¶
- class OrderType(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- Limit = 0¶
- Unset = -1¶
- class Side(value)[source]¶
Bases:
mlthon.basics.mlt_enum.MltEnum
An enumeration.
- Buy = 0¶
- Sell = 1¶