jaqs.data.basic package

Submodules

jaqs.data.basic.instrument module

jaqs.data.basic.marketdata module

class Bar

Bases: object

classmethod create_from_df(df)

jaqs.data.basic.order module

jaqs.data.basic.position module

class GoalPosition

Bases: object

Used in goal_portfolio function to generate orders.

变量:
  • symbol (str) –
  • ref_price (float) – Reference price, used by risk management, not by order.
  • size (int) – Target position size.
  • urgency (int) – The urgency to adjust position, used to determine trading algorithm.
class Position

Bases: object

Basic position class.

变量:
  • symbol (str) – List of securities.
  • side (str) – (“Long”, “Short”). Positions of different sides will not be merged.
  • cost_price (float) – Average cost price of current net position.
  • close_pnl (float) –
  • float_pnl (float) –
  • trading_pnl (float) –
  • holding_pnl (float) –
  • init_size (int) – Position at the start of the day.
  • enable_size (int) – Position that can be closed.
  • frozen_size (int) – Positions to be closed.
  • want_size (int) – Positions to be opened.
  • pre_size (int) – Last day’s position.
  • today_size (int) – Today’s position.
  • curr_size (int) – Current position.

jaqs.data.basic.trade module

class Trade

Bases: object

Basic order class.

变量:
  • task_id (str) – id of the task.
  • entrust_no (str) – ID of the order.
  • entrust_action (str) –
  • symbol (str) –
  • fill_price (float) –
  • fill_size (int) –
  • fill_date (int) –
  • fill_time (int) –
  • fill_no (str) – ID of this trade.
init_from_order(order)
send_fill_info(price, size, date, time, no)

Module contents

Basic data types: - Order - Trade - Position - Bar - Tick