You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from auto_trading.broker.backtest import Backtest
|
|
|
|
from auto_trading.strat.hold import Hold
|
|
|
|
from auto_trading.ptf.in_memory import InMemoryPortfolio
|
|
|
|
from auto_trading.bot import Bot
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
bt = Backtest("./data/NYSE_smallest.csv")
|
|
|
|
ptf = InMemoryPortfolio(
|
|
|
|
base_balance=100, change_rate_getter=lambda: bt.current_change
|
|
|
|
)
|
|
|
|
strategy = Hold("GOOGL")
|
|
|
|
|
|
|
|
bot = Bot(ptf, strategy, bt)
|
|
|
|
|
|
|
|
bot.run()
|
|
|
|
|
|
|
|
for order in ptf.history:
|
|
|
|
print(order)
|