Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sell This Bar on Close

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

    Sell This Bar on Close

    In Tradestation, to exit a long position you can write: "Sell This Bar on Close"

    What would be the Ninja Script equivilent?

    Thx.

    #2
    Brooks, in NinjaScript your can work with ExitLong() for this task - http://www.ninjatrader-support.com/H.../ExitLong.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      If only it were that simple. :-)

      I looked at ExitLong() before posting. Two problems: there does not seem to be an option to exit 'This Bar'. In testing, it always seems to exit the 'next bar'. Also, there does not seem to be any control over Open vs. Close price nor is it mentioned in the documentation. Do you have control of Open vs. Close price? Which is the default?

      Originally posted by NinjaTrader_Bertrand View Post
      Brooks, in NinjaScript your can work with ExitLong() for this task - http://www.ninjatrader-support.com/H.../ExitLong.html

      Comment


        #4
        This is the nature of backtesting Brooks - if you call ExitLong or ExitShort on bar x it will exit on the next possible trade location (bar x + 1 open) with a market order.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          It may be the nature of Ninja backtesting. Tradestation gives you more control, IMHO.

          Originally posted by NinjaTrader_Bertrand View Post
          This is the nature of backtesting Brooks - if you call ExitLong or ExitShort on bar x it will exit on the next possible trade location (bar x + 1 open) with a market order.

          Comment


            #6
            Brooks, we've implemented the most conservative approach here as we feel this is the most important part abot backtesting to able to rather understate than overstate historical strategy performance.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi Bertrand,

              Not to pile on, but I agree that it would be nice to be able to set Exit or Enter On Close when backtesting. This feature can "set a bar" and, at the same time, provide some inherent slippage that a trader executing by hand could try to outperform.

              If one backtests a system that performs well when executing at the close of the bar, the trader wishing to meet or beat the system performance knows that he has until the end of the triggered bar to try to beat the system's execution. Perhaps pulling the trigger a few seconds ahead of the close may accomplish this. It may be one way of producing results that a trader believes are reproducible.

              I recognize that it's not really possible to execute at the close in real time, but using that standard for backtesting can provide some value. I think it might be a useful feature and would recommend its inclusion in future versions of NT.

              All the best,

              Ken

              Comment


                #8
                Bertrand, I hear what you're saying but I believe the choices should be given to the customer.

                As things are now, the 6.5 docs say "Generates a sell market order to exit a long position." It would be a clearer if wording was added: "The order will always be executed on the NEXT bar."

                Originally posted by NinjaTrader_Bertrand View Post
                Brooks, we've implemented the most conservative approach here as we feel this is the most important part abot backtesting to able to rather understate than overstate historical strategy performance.

                Comment


                  #9
                  Thanks for the feedback Brooks.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    I have a system in AmiBroker that I was considering porting to NT, but the order at close is the key thing holding me back. It runs off daily charts, so it needs to trade at the close of a daily chart, not next day's open. You often get an overnight move that significantly changes the performance.

                    Comment


                      #11
                      In the backtest window there is an 'Exit on Close' setting that can be set to True.

                      Brooks

                      Originally posted by dha3936420 View Post
                      I have a system in AmiBroker that I was considering porting to NT, but the order at close is the key thing holding me back. It runs off daily charts, so it needs to trade at the close of a daily chart, not next day's open. You often get an overnight move that significantly changes the performance.

                      Comment


                        #12
                        Good point. But I want to exit one position, and enter a new position on close.

                        I guess the other option is get 1 minute chart data and use multiple time frames. . . .

                        Comment


                          #13
                          Welcome here - correct, you need to code this up then using a smaller, intraday timeframe to be able to submit at a valid trade location before the daily close then.
                          BertrandNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Philippe56140, 04-27-2024, 02:35 PM
                          3 responses
                          22 views
                          0 likes
                          Last Post Philippe56140  
                          Started by port119, 04-27-2024, 02:43 PM
                          2 responses
                          22 views
                          0 likes
                          Last Post port119
                          by port119
                           
                          Started by AaronKTradingForum, Yesterday, 02:37 PM
                          4 responses
                          38 views
                          0 likes
                          Last Post AaronKTradingForum  
                          Started by iceman2018, 04-27-2024, 05:07 PM
                          1 response
                          13 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by adaisguy, Yesterday, 10:27 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post adaisguy  
                          Working...
                          X