Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 04:28:08 +0000



Post From: [Programming help] How to exit any position after 20 bars since it's opened using ASCII?

[2023-03-10 12:07:57]
User395175 - Posts: 67
Hi, i want my programme exit the position after a fixed number of bars (like 20), how can i do it?

I will have multiple positions open at the same time, for each, i want it to be closed after 20 bars since it opened. I saw there is a sc function called sc.GetBarsSinceLastTradeOrderEntry(), but it only consider the last trade. i don't think i can use it in my case.

Please help me, thank you.