Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

entry and exit within same bar

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

    entry and exit within same bar

    Hi,

    Lets say there is a long red bar. My long entry order price is at the bottom of the bar and and profit target is at the top of the bar.

    Ninjatrader is showing this as a profitable trade. Is there any way around this?

    Thanks

    #2
    Mayham, the only way around this is to backtest NinjaScript Strategies with an intrabar granularity.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Im looking at that example, and I still can't figure out how to exit at the end of a bar. As far as I can tell it doesn't give an example of any exit orders. Maybe you could give an example on how to close an order before the market closes on a daily timeframe?

      Comment


        #4
        PCtrade, welcome to our forums - Austin's link would help you on this, too as you have access to finer timestamps by adding also a more granular dataseries than your daily, for example a minute one. Then you can check for time being greater that your exit time and ExitLong / ExitShort your open positions then...
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I am working with the multi time coding, but whenever I do it and add a period type of one minute, it is messing up my conditions for my entry and skipping over conditions that met before

          Comment


            #6
            nevermind I figured it out with a custom fill type I just made! I don't have to use multi-time so it backtests nice and quick

            Comment


              #7
              Hi,

              What code would I add to the Liberal fill type algorithm so that it does the following:

              "Do not fill target order for same bar as entry order"

              Thanks

              Comment


                #8
                mayham, while custom coding fill types is possible, we unfortunately do not offer support for this.

                As workaround you could add a BarsSinceEntry to your strategy before you activate the exits...

                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,605 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                8 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                18 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                4 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                13 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X