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 GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,280 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    52 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X