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 NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    93 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    152 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    80 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    54 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    66 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X