Note how to use the platform called Smart Trade to invest in stocks in Python.
Smart Trade provides engineers with a state-of-the-art stock investment system trading environment, basically free of charge. The algorithms you develop will be available for sale in your own trades or on the Smart Trade marketplace.
https://beta.smarttrade.co.jp/
The functions that can be used in the beta version are still limited, but now they are all released for free. Will it be like the App Store in the future?
2018/1/11 postscript: Official URL for developers https://quantx.io/developer
You can analyze past stock price data of Japan and China with Python. If there is a timing when it seems okay to buy or sell, you can simulate how much profit you made by ordering using the Smart Trade API (this is called "backtesting"). Masu).
In addition, since it has a simple BI tool-like function, you can simply display the stock price on a chart, check the values of various technical indicators calculated, and visually check what the actual trading timing was. You can check.
The analysis is written in Python. Since WebIDE is prepared, you can check the result as it is by writing and executing the program on the browser.
Various data are prepared on the Smart Trade platform, so you can easily use it just by declaring the data you want to use. Since pandas is used for the actual data manipulation, I think that anyone who can use pandas can try it relatively easily.
Hello System Trade!
First, let's display the stock price of 9984 (Softbank) on the chart like Hello World. On the Python Coding screen, write the following code and execute it.
def initialize(ctx):
#Algorithm settings
ctx.configure(
target="jp.stock.daily", #Algorithm for daily stocks of Japanese stocks
channels={
"jp.stock": {
"symbols": [
"jp.stock.9984", #Use SoftBank data
],
"columns": [
"close_price", #closing price
"close_price_adj", #closing price(After stock split adjustment)
]
}
}
)
def handle_signals(ctx, date, current):
'''
current: pd.DataFrame
'''
pass
When you run
The chart came out. There is no unevenness, but this means that the assets have not changed at all because we are not buying or selling. Looking at the details of the brand,
It's coming out properly!
Next time, I will display the moving average.
2018/1/11 postscript Official version URL:
Recommended Posts