Login Page - Create Account

Support Board


Date/Time: Tue, 16 Sep 2025 14:56:29 +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: 94
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.