Getting Started¶
The below instructions use the traderion-1.0 trading bot version as an example. The same instructions apply to newer trading bot versions.
This guide assumes you have done the following:
- You have created a new folder, "Trading_bots", which will contain the package source zip-file downloaded: traderion-1.0
- You have downloaded traderion-1.0.zip found at the bottom of the Welcome page (Traderion package) in the previously created "Trading_bots" folder.
- You have unzipped the package source zip file into your "Trading_bots" folder
- You have installed Python 3.7 or higher installed (alternatively, you can use Anaconda)
- You were assigned a Traderion user account (username and password)
Project Setup¶
On Linux and macOS:¶
Open a Terminal window and run the commands bellow.
Change directory to the trading-bot directory:
cd path-to-trading-bot-directory
If the trading-bot package files are in
/Users/john/Desktop/Trading_bots/traderion-1.0
, the command becomes: Replace "john" with your machine user
cd /Users/john/Desktop/Trading_bots/traderion-1.0
Create a virtual environment:
python -m venv traderion
or if you are using Anaconda
conda create --name traderion python=3.7
Activate the environment:
source traderion/bin/activate
or if you are using Anaconda
conda activate traderion
Install the package:
cd traderion-1.0 && pip install . && cd ..
Install pandas
pip install pandas
Place the example Python files at the root of your traderion-1.0 directory:
Download the example bots from the Starting Kits section and extract the .py files (e.g.,
clients_bot.py
,ema_bot.py
,composite_bot.py
) directly into your unzipped traderion-1.0 folder.
On Windows (only with Anaconda)¶
Open an Anaconda Prompt from the Start menu.
Create a new environment:
conda create --name traderion python=3.7
Activate the environment:
activate traderion
Go to the tradingbot folder:
cd path-to-tradingbot
If the trading-bot package files are in
C:\Users\algotest\Desktop\Trading_bots\traderion-1.0
, your command becomes:
cd ``C:\Users\algotest\Desktop\Trading_bots\traderion-1.0
Install the traderion package:
cd traderion-1.0 && pip install . && cd ..
Install pandas:
pip install pandas
Place the example Python files at the root of your traderion-1.0 directory:
Download the example bots from the Starting Kits section and extract the .py files (e.g.,
clients_bot.py
,ema_bot.py
,composite_bot.py
) directly into your unzipped traderion-1.0 folder.
Trading Session¶
In order to run a trading bot, you will need an active trading session on the platform.
Go to https://simulator.traderion.com/ and create a new session (from the scenarios tab).
Note: When you are in an official training session, you don't need to create a new one. Your trainer has already created the session for the class.
After you join the session, you will be redirected to the trading screen. The url should look like this:
https://simulator.traderion.com/treasury/?r=12345
The number after ?r=
is your current trading session number. We call the trading session a room. The number is the room_id.
You can now open any of the example files (e.g., clients_bot.py, ema_bot.py, composite_bot.py) and replace the mock credentials in the main function (at the bottom of the file) with your actual credentials (username, password, room_id).
To start the bot, in the terminal prompt you just run:
python name_of_example.py
For example:
python clients_bot.py
The bot will run while the room is not finished. To stop the bot, just press CTRL + C.
Congratulations! You can now start adding your own custom logic to the bot!