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 hazylizard, Today, 08:38 AM
      0 responses
      1 view
      0 likes
      Last Post hazylizard  
      Started by Max238, Today, 01:28 AM
      5 responses
      42 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by giulyko00, Yesterday, 12:03 PM
      3 responses
      12 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by habeebft, Today, 07:27 AM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_ChristopherS  
      Started by AveryFlynn, Today, 04:57 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Erick  
      Working...
      X