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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      63 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      54 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      61 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Working...
      X