OK, this one is largely from my own imagination. However it was triggered by a real-life situation when I was programming against a broker's API, I was given program samples where the trading strategy works on a *very* fast timeframe (hell lots of commissions for them), a few seconds bars! Enjoy!
Link: Python Code Style (PEP 8)
If you want to try the algo at home:
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
class BrokerHFTAlgo: | |
def on_tick(self, tick): | |
try: | |
order = buy(100000) | |
order.wait_until_filled() | |
order.close() | |
except MarginCall: | |
send_mail("insert coin.") |
Forex Trading
Value Investing