Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enter at close

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

    Enter at close

    Is there a way to Enter a position under certain conditions at (just prior to) session close?

    Background, I see many easy language scripts which open a new position if, for example, it closes above a moving average. Realistically, how do you know that before the daily bar closes, but for strategy back testing purposes, it could use the close price and know there may be slippage if it actually opened X min before close.

    My potential solution would be to use a second series with a more granular time-frame than daily to check the condition and enter the trade, but the problem is that it requires intra-day data for back testing and my data providers don't go back that far with historical intra-day data.

    #2
    Hello,

    Thank you for the question.

    Because the Backtest runs all tests on CalculateOnBarClose = true, you would need a secondary or lower timeframe series to run the test in this case. If the logic requires that an Intrabar condition is checked, you would need intrabar data for that period of time.

    The trades would only be evaluated on the close of the bar, if that series is a daily series that would not work for getting the trade in before the session closed. In this case if the test requires more data than you have available you would likely either need to reduce the testing period or record data from realtime until you have enough data to proceed. There are other options like Importing data to get from another source as well.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I understand what you are saying.

      Can't there easily be an option (call it an enhancement request) to use the daily bar close price as the entry price? We do that when we exit at the end of a session.

      I'm trying to test 100 of the S&P 100 stocks all the way back to 1995 to see if I can duplicate the results of several studies. It would require a massive amount of minute data to add that higher time frame into my testing. Also, currently TD Ameritrade account connection doesn't support intra-day historical stock pricing.
      Last edited by dynoweb; 06-20-2016, 04:30 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kujista, Yesterday, 12:39 AM
      4 responses
      16 views
      0 likes
      Last Post kujista
      by kujista
       
      Started by Mindset, Yesterday, 06:19 AM
      2 responses
      15 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by bubblegum, 03-18-2024, 10:41 AM
      4 responses
      51 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Yasharandom, 05-04-2024, 07:45 AM
      2 responses
      24 views
      0 likes
      Last Post Yasharandom  
      Started by francesjandujar, Today, 05:15 AM
      0 responses
      4 views
      0 likes
      Last Post francesjandujar  
      Working...
      X