Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buy open and sell close

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

    Buy open and sell close

    I'm trying to figure out a way to buy the daily open and sell the same bar's daily close. I don't have access to intraday data so it's impossible for me to do this via a smaller granularity...What's the work-around that would allow me to sell at the close of the same bar that the long position was entered on?

    if(Close[0]>High[1])
    {
    EnterLong(); // Buying at the open
    // I want to exit on the close of this same bar
    }

    // Now, assuming that that the statement in the if(...) is true and I go long at the next bar's open how do I exit the long position on the close of the same bar?

    #2
    d.allen, thank you for your question.

    As far as I know, this isn't possible without intraday data. I'm not 100% though, so I will double check with a coworker and get back to you tomorrow.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Unfortunately this is not possible in backtesting without adding more granular data as shown in this sample - http://www.ninjatrader-support2.com/...ead.php?t=6652

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      650 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 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
      577 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X