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 burtoninlondon, Today, 12:38 AM
    0 responses
    9 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    14 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,983 views
    3 likes
    Last Post jhudas88  
    Working...
    X