trade_api
Classes
Module Contents
- class trade_api.Trade(config, market_data_client, alpaca_account_client, live, predict_time, end_predict_time, fetch_data=True)
- Parameters:
market_data_client (Any)
alpaca_account_client (Any)
live (bool)
predict_time (datetime.datetime)
end_predict_time (datetime.datetime)
fetch_data (bool)
- exception LiveTradeError(error_type, message)
Bases:
ExceptionCustom exception for live trading errors.
- Parameters:
error_type (str)
message (str)
- OUT_OF_RANGE = 'OUT_OF_RANGE'
- error_type
- message
- config
- active_symbols
- env_config
- data_config
- agent_config
- portfolio_config
- market_data_client
- alpaca_account_client
- feature_cfg
- active_features
- live
- trading_client
- env
- __del__()
- _load_data(predict_time, end_predict_time, fetch_data=True)
- Parameters:
predict_time (datetime.datetime)
end_predict_time (datetime.datetime)
fetch_data (bool)
- Return type:
trading.src.alg.data_process.data_loader.DataLoader
- get_prices()
- Return type:
numpy.ndarray
- range_includes_open_markets(start, end)
- Parameters:
start (datetime.datetime)
end (datetime.datetime)
- Return type:
bool
- run_model(predict_time, end_predict_time)
- Parameters:
predict_time (datetime.datetime)
end_predict_time (datetime.datetime)
- Return type:
list[dict[str, Any]]