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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      60 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      147 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      284 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X