Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Executing a trade at EOD price.

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

    Executing a trade at EOD price.

    Hi,

    I have daily OHLCV data of BANKNIFTY (any scrip, for that matter) and I also have a basic strategy like a MA Crossover. I wish to enter the strategy such that it enters a trade at the EOD price, rather than at the next day's Open. Is this possible? I understand that this effectively means checking the EOD data for conditions of entry/exit, and then assuming that the entry should've happened at that price. But is there a way to do it?

    #2
    Hello eey0069,

    Thank you for your inquiry.

    To clarify, what do you have the CalculateOnBarClose property on your strategy set to?

    With this set to true, any logic inside of the OnBarUpdate() method will execute once a bar closes. Additionally, any executions appearing on the chart will display upon the opening of the next bar, however, they occur when the previous bar closes.

    With this property set to true, Close[0] will obtain the end-of-bar price, or end-of-day price in terms of daily bars.

    You can then utilize this price for your trade logic which will execute at the close of the bar.

    More information about the CalculateOnBarClose property can be found in the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG...onbarclose.htm

    More information about the Close collection can be found in the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG...nt7/?close.htm

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Ok. What are the steps to follow to activate both these, when using the strategy wizard? Do you have any screenshots to elucidate what you've mentioned?

      Currently, it seems to calculate values at EOD, but is executing trades at next Open.

      Comment


        #4
        Hello eey0069,

        With calculate on bar close enabled, any logic that you have for your script will execute on the close of each bar. However, the actual executions plotted on your chart will appear on the newly opened bar.

        Please click on Tools -> Edit NinjaScript -> Strategy. Select your strategy and click on OK.

        This will bring up the Edit Strategy window. Click Next.

        Is the Calculate on bar close setting checked or unchecked?
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by eey0069 View Post
          Hi,

          I have daily OHLCV data of BANKNIFTY (any scrip, for that matter) and I also have a basic strategy like a MA Crossover. I wish to enter the strategy such that it enters a trade at the EOD price, rather than at the next day's Open. Is this possible? I understand that this effectively means checking the EOD data for conditions of entry/exit, and then assuming that the entry should've happened at that price. But is there a way to do it?
          If you want to specify the price at which an order is to execute, you use a Limit Order at the price that you want, so just issue a Limit Order at the correct price.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by BarzTrading, Today, 07:25 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by EB Worx, 04-04-2023, 02:34 AM
          7 responses
          161 views
          0 likes
          Last Post VFI26
          by VFI26
           
          Started by Mizzouman1, Today, 07:35 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Radano, 06-10-2021, 01:40 AM
          20 responses
          616 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by i019945nj, 12-14-2023, 06:41 AM
          6 responses
          68 views
          0 likes
          Last Post i019945nj  
          Working...
          X