# Path: OnePy/constants.py
# class ActionType(Enum):
# 
#     Buy = 'Buy'
#     Sell = 'Sell'
#     Short = 'Short'
#     Cover = 'Cover'
# 
#     Exit_all = 'Exit_all'
#     Cancel = 'Cancel'
# 
# Path: OnePy/sys_module/metabase_env.py
# class OnePyEnvBase:
#     """作为基类，提供env共享单例给各个模块"""
#     env = Environment


import abc
import pandas as pd
from collections import UserDict, UserList, deque
from typing import Deque, Dict, List, Union
from OnePy.constants import ActionType
from OnePy.sys_module.metabase_env import OnePyEnvBase
            df.index = pd.to_datetime(df.index)
            dataframe_list.append(df)
        result = sum(dataframe_list)

        return result

    def plot(self, ticker: str):
        long_df = pd.DataFrame(self.data[f'{ticker}_long'])
        short_df = pd.DataFrame(self.data[f'{ticker}_short'])
        long_df.rename(columns=dict(value=f'{self.name}_long'), inplace=True)
        short_df.rename(columns=dict(value=f'{self.name}_short'), inplace=True)

        total_df = long_df.merge(short_df, how='outer')
        total_df.fillna(method='ffill', inplace=True)
        total_df.set_index('date', inplace=True)
        total_df.plot()

    def get_barly_cur_price(self, ticker: str, order_executed: bool) -> float:
        """若是订单执行，则返回成交价，否则只是更新信息，返回开盘价"""

        if order_executed:
            return self.env.feeds[ticker].execute_price
        else:
            return self.env.feeds[ticker].open

    @abc.abstractmethod
    def update_order(self):
        raise NotImplementedError



# Path: OnePy/constants.py
# class ActionType(Enum):
# 
#     Buy = 'Buy'
#     Sell = 'Sell'
#     Short = 'Short'
#     Cover = 'Cover'
# 
#     Exit_all = 'Exit_all'
#     Cancel = 'Cancel'
# 
# Path: OnePy/sys_module/metabase_env.py
# class OnePyEnvBase:
#     """作为基类，提供env共享单例给各个模块"""
#     env = Environment


# Path: OnePy/sys_module/models/base_series.py
import abc
import pandas as pd
from collections import UserDict, UserList, deque
from typing import Deque, Dict, List, Union
from OnePy.constants import ActionType
from OnePy.sys_module.metabase_env import OnePyEnvBase

            df.index = pd.to_datetime(df.index)
            dataframe_list.append(df)
        result = sum(dataframe_list)

        return result

    def plot(self, ticker: str):
        long_df = pd.DataFrame(self.data[f'{ticker}_long'])
        short_df = pd.DataFrame(self.data[f'{ticker}_short'])
        long_df.rename(columns=dict(value=f'{self.name}_long'), inplace=True)
        short_df.rename(columns=dict(value=f'{self.name}_short'), inplace=True)

        total_df = long_df.merge(short_df, how='outer')
        total_df.fillna(method='ffill', inplace=True)
        total_df.set_index('date', inplace=True)
        total_df.plot()

    def get_barly_cur_price(self, ticker: str, order_executed: bool) -> float:
        """若是订单执行，则返回成交价，否则只是更新信息，返回开盘价"""

        if order_executed:
            return self.env.feeds[ticker].execute_price
        else:
            return self.env.feeds[ticker].open

    @abc.abstractmethod
    def update_order(self):
        raise NotImplementedError



class MoneySeries(OnePyEnvBase, UserList):