# Path: fooltrader/api/technical.py
# def convert_to_list_if_need(input):
# def get_security_list(security_type='stock', exchanges=None, start_code=None, end_code=None,
#                       mode='simple', start_list_date=None, codes=None):
# def _get_security_item(security_type, exchanges, code=None):
# def to_security_item(security_item, exchange=None):
# def get_ticks(security_item, the_date=None, start_date=None, end_date=None):
# def _parse_tick(tick_path, security_item):
# def get_available_tick_dates(security_item):
# def get_kdata(security_item, exchange=None, the_date=None, start_date=None, end_date=None, fuquan='bfq', source=None,
#               level='day', generate_id=False):
# def get_latest_download_trading_date(security_item, return_next=True, source=None):
# def get_trading_calendar(security_type='future', exchange='shfe'):
# def get_trading_dates(security_item, dtype='list', ignore_today=False, source='163', fuquan='bfq'):
# def kdata_exist(security_item, year, quarter, fuquan=None, source='163'):
# def parse_shfe_day_data(force_parse=False):
# def parse_shfe_data(force_parse=False):
#             KDATA_COLUMN_FUTURE = ['timestamp', 'code', 'name', 'low', 'open', 'close', 'high', 'volume', 'turnover',
#                                    'securityId',
#                                    'preClose', 'change', 'changePct', 'openInterest', 'settlement', 'preSettlement',
#                                    'change1',
#                                    'changePct1']


import pandas as pd
from fooltrader.api import technical
    Parameters
    ----------
    security_item : SecurityItem or str
        the security item,id or code
    start_date : TimeStamp str or TimeStamp
        start date
    end_date : TimeStamp str or TimeStamp
        end date
    fuquan : str
        {"qfq","hfq","bfq"},default:"qfq"
    source : str
        the data source,{'163','sina'},default: '163'
    level : str or int
        the kdata level,{1,5,15,30,60,'day','week','month'},default : 'day'
    window : int
        the ma window,default : 12
    col : list
        the column for calculating,['close', 'volume', 'turnover'],default:['close']

    return_all : bool
        whether return all the kdata values,default:False

    return_col : bool
        whether return the calculating col too,default:True

    Returns
    -------
    DataFrame

    """

# Path: fooltrader/api/technical.py
# def convert_to_list_if_need(input):
# def get_security_list(security_type='stock', exchanges=None, start_code=None, end_code=None,
#                       mode='simple', start_list_date=None, codes=None):
# def _get_security_item(security_type, exchanges, code=None):
# def to_security_item(security_item, exchange=None):
# def get_ticks(security_item, the_date=None, start_date=None, end_date=None):
# def _parse_tick(tick_path, security_item):
# def get_available_tick_dates(security_item):
# def get_kdata(security_item, exchange=None, the_date=None, start_date=None, end_date=None, fuquan='bfq', source=None,
#               level='day', generate_id=False):
# def get_latest_download_trading_date(security_item, return_next=True, source=None):
# def get_trading_calendar(security_type='future', exchange='shfe'):
# def get_trading_dates(security_item, dtype='list', ignore_today=False, source='163', fuquan='bfq'):
# def kdata_exist(security_item, year, quarter, fuquan=None, source='163'):
# def parse_shfe_day_data(force_parse=False):
# def parse_shfe_data(force_parse=False):
#             KDATA_COLUMN_FUTURE = ['timestamp', 'code', 'name', 'low', 'open', 'close', 'high', 'volume', 'turnover',
#                                    'securityId',
#                                    'preClose', 'change', 'changePct', 'openInterest', 'settlement', 'preSettlement',
#                                    'change1',
#                                    'changePct1']


# Path: fooltrader/api/computing.py
import pandas as pd
from fooltrader.api import technical

    Parameters
    ----------
    security_item : SecurityItem or str
        the security item,id or code
    start_date : TimeStamp str or TimeStamp
        start date
    end_date : TimeStamp str or TimeStamp
        end date
    fuquan : str
        {"qfq","hfq","bfq"},default:"qfq"
    source : str
        the data source,{'163','sina'},default: '163'
    level : str or int
        the kdata level,{1,5,15,30,60,'day','week','month'},default : 'day'
    window : int
        the ma window,default : 12
    col : list
        the column for calculating,['close', 'volume', 'turnover'],default:['close']

    return_all : bool
        whether return all the kdata values,default:False

    return_col : bool
        whether return the calculating col too,default:True

    Returns
    -------
    DataFrame

    """

    df = technical.get_kdata(security_item, fuquan=fuquan, start_date=start_date, end_date=end_date, source=source,