- Python - 3.10.12
- pip3 install -r requirements.txt
- Create .env file
- Put the following
APP_CLIENT_ID="xxx"
APP_CLIENT_SECRET="xxx"
ACCESS_TOKEN="xxx"
REFRESH_TOKEN="xxx"
CURRENT_ACCOUNT_ID="xxx"
ACCOUNT_TYPE="demo"
- To get the value, go to https://openapi.ctrader.com/apps
- Click "Credentails"
- Click "Sandbox"
- You know how to get the values
- After that, to start the script, run
python3 main.py
- The heartbeat thing
- Go to /usr/local/lib/python3.10/dist-packages/ctrader_open_api/tcpProtocol.py
- Look for
def heartbeat(self):
- This sends heartbeat to server
- And look for
def stringReceived(self, data):
- This is triggered everytime you receives message from server
- When you type
sub 41
, it will becomesub 4
and sends command - You have to type 1 more char behind, for termux
main
- Set entry with spread, set expiry, set lotsize to 0.01lotsize
- Set lotsize of your desired amounttpp
- monitor your running position and take partial profitspread
- monitor spread of asset you desiredhelper
- to set lotsize every morning and close positions on sat