I would like to ask if it is possible to implement a function that would allow a position to be automatically closed after a specified number of days, regardless of the price trend. The goal is to avoid keeping positions open for too long periods, but without interrupting the operation of the bot.
From my backtests on Gainium, I noticed that on those days when the bot would be inactive until the positions were closed, additional gains could be made. Therefore, I believe that this feature could optimize trading strategies.
Ha!
Perfect timing, I was also going to as about this as well.
I have a strategy that also needs a way to stop the bot after a certain amount of days.
I did get a suggestion from Donny on TTP discord that suggested this: (i have not yet tried it yet)
Using a TV Webhook to stop the bot
- So make a vertical line on the chart, attach an alert when time crosses that line. Look in the ‘notifications’ tab. Check ‘webhook URL’ and put in the URL gainium says. In the message of the alert, use the webhook code that Gainium says in the ‘stop bot’ section for the bot controller bit
Do you think this would work?
Interesting.
You can easily do this with a cronjob.
Just a snip in python or js.
Python
0 3 * * * /usr/bin/python3 /path/to/stop_bot.py
js
0 3 * * * /usr/bin/node /path/to/stopBot.js
Lmk if you need the scrips. Its easily executable.
Closing after a X time is already possible with the ‘Close by timer’ option.
Or am I misinterpreting you?
1 Like