Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exiting Before the Hour

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

    Exiting Before the Hour

    I am working on a strategy that I will be using to trade hourly options. Since hourly options expire on the hour, I want to be able to close out my position just before the hour ends (1 or 2 minutes before). However, since I am using Range Bars, with a setting of COBC = true, the close of the bar essentially never coincides with the hourly time change. Is there a way to force a position close, if one is open, just before the hour closes? In essence is there a way to programmatically get around the limitation of COBC=true for a time change?
    Thanks
    DaveN

    #2
    daven,

    Options shouldn't be supported on NinjaTrader.

    You could use a multi-timeframe strategy here that gives you minute-by-minute updates.



    Then, just separate your strategy logic as follows.

    Code:
    if ( BarsInProgress == 0 )
    {
    
    // all your hourly code here
    
    }
    else if ( BarsInProgress == 1)
    {
    
    // all your minute code here
    
    }
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    93 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    31 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    34 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    70 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X