Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

calculate on each tick AND exit after x bars

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    calculate on each tick AND exit after x bars

    Hi, I'm working with a script that places a limit order below the prior candle's high if that high is touched or breached, so I needed to use "calculate on each tick" for that to work, but I also want to close the trade after 1 bar, but this seems to conflict with "on each tick" (the trade closes after 1 tick instead of after 1 bar). Is there a method I can use to close a trade after 1 bar even though my strat is working on ticks?
    thanks,
    David

    #2
    Hello trader3000a,

    Thank you for your post.

    For that, you can use BarsSinceEntryExecution() to check that 1 bar has elapsed prior to sending an exit order:



    For example:

    if (BarsSinceEntryExecution() == 1)
    {
    ExitLong();
    }

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    12 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    59 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    41 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X