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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X