Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

strategy position entry problem

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

    strategy position entry problem

    Hi, I'm trying to create a strategy based on entering a long position when PRICE (close) crosses below a 60 minute chart's 50 period SMA. I've set the strategy to "on each tick" but when i run the strategy through the analyzer, the position isn't being entered when price crosses the SMA. Instead, the position is entered on the open of the next hourly bar after the signal. How do I get the position to be entered at the moment of the price crossing the SMA?

    #2
    Hello trader3000a,

    Thanks for your post.

    We'll move this topic to the NinjaTrader8 Strategy Forum, this helps us all keep the forums organized.

    Even though you are running with Calculate.OnEachTick, the strategy analyzer will only get one tick per 60 minute bar. This is because the bars only have the values of Open, High, Low, Close, Volume and time. With that in mind then your strategy can only run as if you are using Calculate.OnBarClose. This means that at the end of tht bar if the entry is made, it cannot be filled until the next bar.

    In order to place an order intrabar, you would have to modify your strategy by adding a 1 tick data series to it, submitting the orders to the 1 tick series AND using Tick Replay to get the intrabar processing. This also means that you must have historical tick data for the entire strategy analysis period. Please note that this also means you cannot select a high order fill in the strategy analyzer (which is not needed because you are adding the 1 tick series).

    Here is a link to an education example strategy: https://ninjatrader.com/support/help...ipt_strate.htm

    Alternately, you can use your strategy as is and use the Playback connection with Market replay data. You can use this because the data is provided tick by tick and that is how the bars are built. This is an easy path but the limitations are the amount of replay data you can download and replay does take longer to run.
    Reference: https://ninjatrader.com/support/help...connection.htm



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul, thanks for your reply.
      Is there an open ticket in your functionality requests list to address this problem? The vast majority of traders would appreciate it, I'm sure. People trade by entering signals that happen intra-bar. They don't wait for the following bar, as you know. The example strategy doesn't help me understand how to adapt my own strategy using the strategy builder.

      Comment


        #4
        Hello trader3000a,

        Thanks for your reply.

        If you are using the strategy builder and do not wish to work in Ninjascript then the only recommendation for you would be to perform your test using Playback with market replay data. You would not need to add a data series or modify your strategy to get intrabar fills in Playback with market replay data.

        I've added your vote to SFT-1002, "Support Intrabar Order Generation with Tick Replay".

        Feature Request Disclaimer
        We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.
        When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.
        Release Notes - https://ninjatrader.com/support/help...ease_notes.htm






        Paul H.NinjaTrader Customer Service

        Comment


          #5
          thanks Paul, intrabar order generation in backtesting software is really the most basic point of it's existence. I was rather shocked to discover it's omission.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Barry Milan, Yesterday, 10:35 PM
          5 responses
          16 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by DanielSanMartin, Yesterday, 02:37 PM
          2 responses
          13 views
          0 likes
          Last Post DanielSanMartin  
          Started by DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          11 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          8 views
          0 likes
          Last Post nandhumca  
          Working...
          X