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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    52 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    29 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    194 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    355 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    274 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X