TradeLocker is a webhook bot designed to seamlessly integrate with TradingView, enabling automated opening and closing of trading positions.
If you update the code, run the following command to delete the previous image:
docker rmi -f ghcr.io/akinzou/tradelocker_bot:latest
Download the latest image using the command:
docker pull ghcr.io/akinzou/tradelocker_bot:latest
Check if the image has been downloaded:
docker images
You should see:
ghcr.io/akinzou/tradelocker_bot latest
Run the container with the following command:
docker run -t -p 443:443 -e username = "your_username" -e password = "your_password" -e server = "your_server" -e env=demo/live --rm ghcr.io/akinzou/tradelocker_bot:latest
If you have more than one trading account under your main account, you can specify which one to use by:
-e acc_id = your_acc_id
or
-e acc_num = your_acc_number
After running the container, you should see green text indicating successful authentication:
_____ _ _ _ ____ _
|_ _| __ __ _ __| | ___| | ___ ___| | _____ _ __| __ ) ___ | |_
| || '__/ _` |/ _` |/ _ \ | / _ \ / __| |/ / _ \ '__| _ \ / _ \| __|
| || | | (_| | (_| | __/ |__| (_) | (__| < __/ | | |_) | (_) | |_
|_||_| \__,_|\__,_|\___|_____\___/ \___|_|\_\___|_| |____/ \___/ \__|
+[INFO] tradelocker.tradelocker_api 2024-05-30 11:25:31,834 tradelocker_api _auth_with_password: 665 Successfully fetched authentication tokens
Additionally, check on which account you are signed in; it will print the number and ID.
You can now access the webhook bot at:
http://localhost:443/strategy
or
http://yourIP:443/strategy
You should see the following message on the site:
{"detail":"Method Not Allowed"}
Run Container with addtional argument
-e url=/your_url
Use:
-e url=generate
and you should see:
_
___ __ ___ _____ _ _ _ __| |
/ __|/ _` \ \ / / _ \ | | | | '__| |
\__ \ (_| |\ V / __/ | |_| | | | |
|___/\__,_| \_/ \___| \__,_|_| |_|
/yourgenerated/url
This URL is for webhook execution in the trading environment.
Use this format
XAUUSD
{{strategy.order.action}}
0.01
500
1000
{{strategy.order.alert_message}}
where
XAUUSD -> name of tradable instrument
{{strategy.order.action}} -> "buy"/"sell"
0.01 -> lot
500 -> take profit (offset mode)
1000 -> stop loss (offset mode)
{{strategy.order.alert_message}} -> "Open" for opening a position and closing the previous one, "Close" for only closing a position on the specific instrument
Remember to configure Nginx or another appropriate software to enable access to HTTPS. You will be able to use, for example
https://localhost/strategy
This program is provided "as is" without any warranty. Use it at your own risk. Before using this program in a live trading environment, thoroughly test it on a demo account to ensure its correctness and reliability.