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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      46 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      14 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      22 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X