This board has been archived, no new registrations are allowed. Please come join us on our discord!

Close position if bot does not trade for x hours

Discuss and share different settings for safeties.
giannia
Registered User
Posts: 17
Joined: Thu Jun 08, 2017 7:12 am

Close position if bot does not trade for x hours

Postby giannia » Mon Jan 22, 2018 11:57 am

Hello,

I would like to write a custom script safety that does the thing on subject. I need advice, I cannot find a method to read the last trade date.

The logic should be:

main() {
if (a position IS open)
{
if (hours(current_date - last_trade_date) > max_hours)
{
ExitPosition() ;
}
}


Thank you for any help!

Return to “Safeties”

Who is online

Users browsing this forum: No registered users and 1 guest