# -*- coding: utf-8 -*-
# @Time    : 2019/7/2 9:22
# @Author  : Tony
"""Description"""

from datetime import datetime

from vnpy.app.cta_strategy.backtesting import BacktestingEngine
from vnpy.app.cta_strategy.strategies.atr_rsi_strategy import (
    AtrRsiStrategy,
)

engine = BacktestingEngine()
engine.set_parameters(
    vt_symbol="rb1910.SHFE",
    interval="1m",
    start=datetime(2010, 1, 1),
    end=datetime(2019, 7, 17),
    rate=0.3 / 10000,
    slippage=0.2,
    size=300,
    pricetick=0.2,
    capital=1_000_000,
)
engine.add_strategy(AtrRsiStrategy, {})

engine.load_data()
engine.run_backtesting()
df = engine.calculate_result()
engine.calculate_statistics()
engine.show_chart()
# -*- coding: utf-8 -*-
# @Time    : 2019/7/2 9:22
# @Author  : Tony
"""Description"""

from datetime import datetime

from vnpy.app.cta_strategy.backtesting import BacktestingEngine
from vnpy.app.cta_strategy.strategies.atr_rsi_strategy import (
    AtrRsiStrategy,
)

engine = BacktestingEngine()
engine.set_parameters(
    vt_symbol="rb1910.SHFE",
    interval="1m",
    start=datetime(2010, 1, 1),
    end=datetime(2019, 7, 17),
    rate=0.3 / 10000,
    slippage=0.2,
    size=300,
    pricetick=0.2,
    capital=1_000_000,
)
engine.add_strategy(AtrRsiStrategy, {})

engine.load_data()
engine.run_backtesting()
df = engine.calculate_result()
engine.calculate_statistics()
engine.show_chart()
# -*- coding: utf-8 -*- # @Time    : 2019/7/2 9:22 # @Author  : Tony Description