This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8; py-indent-offset:4 -*- | |
############################################################################### | |
# Copyright (C) 2019 Daniel Rodriguez - MIT License | |
# - https://opensource.org/licenses/MIT | |
# - https://en.wikipedia.org/wiki/MIT_License | |
############################################################################### | |
import argparse | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A Simple Strategy Trading Two Stocks | |
Original code: https://blog.csdn.net/qq_26948675/article/details/80016633 | |
Modified based on: https://www.backtrader.com/blog/posts/2018-04-22-improving-code/improving-code.html | |
Replaced the local CSV files with online data from IEX. | |
Unfortunately, this strategy is not profitable for the two stocks picked. | |
""" |