ezyquant_execution.context.ExecuteContextSymbol#

class ezyquant_execution.context.ExecuteContextSymbol(settrade_user: Investor | MarketRep, account_no: str, symbol: str, pin: str | None = None, signal: Any | None = None)#

Execute context.

Parameters:
  • settrade_user (Union[Investor, MarketRep]) – Settrade user

  • account_no (str) – Account number

  • symbol (str) – Selected symbol

  • pin (Optional[str], optional) – PIN. Only for investor.

  • signal (Any, optional) – Signal, by default None

ExecuteContextSymbol.Symbol(symbol)

ExecuteContextSymbol.buy(volume[, price])

Place buy order.

ExecuteContextSymbol.buy_pct_port(pct_port, ...)

Buy from the percentage of the portfolio.

ExecuteContextSymbol.buy_value(value, **kwargs)

Buy from the given value.

ExecuteContextSymbol.cancel_buy_orders()

Cancel all buy orders.

ExecuteContextSymbol.cancel_orders([condition])

Cancel orders.

ExecuteContextSymbol.cancel_price_orders(price)

Cancel all orders with price.

ExecuteContextSymbol.cancel_sell_orders()

Cancel all sell orders.

ExecuteContextSymbol.get_account_info()

Get account info.

ExecuteContextSymbol.get_orders([condition])

Get orders.

ExecuteContextSymbol.get_portfolio()

Get portfolio of the symbol.

ExecuteContextSymbol.get_portfolios()

Get portfolios.

ExecuteContextSymbol.get_quote_symbol()

Get quote symbol.

ExecuteContextSymbol.get_trades([condition])

Get trades.

ExecuteContextSymbol.is_buy_sufficient(volume)

Check if the line available is sufficient for buy order.

ExecuteContextSymbol.is_sell_sufficient(volume)

Check if the volume is sufficient for sell order.

ExecuteContextSymbol.max_buy_volume([price])

Get maximum buy volume.

ExecuteContextSymbol.max_sell_volume()

Get maximum sell volume.

ExecuteContextSymbol.percent_profit()

Unrealized Percent profit.

ExecuteContextSymbol.place_order(side, volume)

Place order.

ExecuteContextSymbol.sell(volume[, price])

Place sell order.

ExecuteContextSymbol.sell_pct_port(pct_port, ...)

Sell from the percentage of the portfolio.

ExecuteContextSymbol.sell_value(value, **kwargs)

Sell from the given value.

ExecuteContextSymbol.target_pct_port(...)

Buy/Sell to make the current position reach the target percentage of the portfolio.

ExecuteContextSymbol.target_value(value, ...)

Buy/Sell to make the current position reach the target value.

ExecuteContextSymbol.actual_volume

Actual volume.

ExecuteContextSymbol.best_ask_price

Best ask price.

ExecuteContextSymbol.best_bid_price

Best bid price.

ExecuteContextSymbol.cash

Line Available.

ExecuteContextSymbol.cash_balance

Cash Balance.

ExecuteContextSymbol.cost_price

Cost price.

ExecuteContextSymbol.cost_value

Cost value.

ExecuteContextSymbol.current_volume

Current volume.

ExecuteContextSymbol.line_available

Line Available.

ExecuteContextSymbol.market_price

Market price.

ExecuteContextSymbol.market_value

Market value of symbol in portfolio.

ExecuteContextSymbol.pending_order_value

Sum of all pending order value.

ExecuteContextSymbol.port_value

Total portfolio value.

ExecuteContextSymbol.profit

Unrealized Profit (THB).

ExecuteContextSymbol.total_cost_value

Sum of all stock cost value in portfolio.

ExecuteContextSymbol.total_market_value

Sum of all stock market value in portfolio.

ExecuteContextSymbol.ts

Current timestamp.

ExecuteContextSymbol.volume

Actual volume.