Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

One order per bar

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

    One order per bar

    Hi,
    I would have only one execution (entry long / short / stop loss ) per bar, I'm trying to use IsFirstTickOfBar, in historical data seems to work, but doesn't work while the bar is creating
    I use Calculate.OnEachTick, a bool var bExe

    this is my code

    On bar update

    if (IsFirstTickOfBar)
    bExe = true;

    if (Position.Quantity == 0 && bEsegui) {
    enter position and set stop loss
    bExe = false
    else
    if (bExe and other condition)
    set stop loss

    When the stopp loss is performed in last bar I want the enter position on the next bar

    #2
    Hi,
    just understood and solved the issue!

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    56 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X