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 FrancisMorro, Today, 03:24 AM
    0 responses
    1 view
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,769 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    10 views
    0 likes
    Last Post Max238
    by Max238
     
    Working...
    X