Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting barNumber to CurrentBar

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

    Setting barNumber to CurrentBar

    Hello,


    I have an int for barNumberOfOrder and barNumberOfEntry which I set to CurrentBar at appropriate times.
    The barNumber ofOrder is for limit orders so that I can see if it "sits" there as pending for too long. For barNumberOfEntry, I also track to see how many bars I've been in a trade.

    I'm trying to determine if this could/or should be set in OnOrderUpdate or OnExecution immediately after the trade is executed or if it should only be done in OnBarUpdate.

    Thanks,

    Kirk

    ps, I've already looked at the SampleCancelOrder.cs - that file doesn't show where to reset the barNumberOf Order to zero which I need to understand as well...
    Last edited by zeller4; 12-05-2011, 01:47 PM.

    #2
    Hello,

    Thanks for the note.

    You can do this in OnOrderUpdate, however as far as the incrementing you will need to do this in OnBarUpdate().

    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    661 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    375 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X