Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Confused

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

    Confused

    Hi,
    i'm a bit confused when I read that backtest is ONLY possible with OHLC data.

    For example, lets say my backtest entry point is previous back high +10 tick.

    So when doing the backtest, it will only enter at current bar either OHLC value, and is not "smart" enough to calculate previous bar high + 10 tick (providing that current bar high > previous bar high of course) ?

    So at current bar, it is IMPOSSIBLE to have an entry at a value other than OHLC ?

    Cordially,
    Duval

    #2
    Duval,

    One of our NinjaScript trainees will respond to you later today. Thank you for your patience.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Duval,

      This statement only refers to the absense of the tick formation inside your bar when backtesting, which for example means, you don't know which came first - the high or the low of the bar.

      Of course you can place an order like you outlined in your post below.

      Please also review this link -

      BertrandNinjaTrader Customer Service

      Comment


        #4
        Ok thanks for your answer..... so for example in a backtest, going long, I can set a profit stop at my entry level + ATR of 5 bars..... and have this stop "taken" in a backtest if any bar touches this level.... and have my profit calculated on exactly my entry price + ATR(5) even if it doesn't correspond exactly to an OHLC value ?

        Sorry to insist but before deciding to spend the next few months working with NT, i must be really sure it is well suited for me.

        Thanks,
        Duval

        Comment


          #5
          Hi Duval,

          Thanks for following up, yes this is possible in NinjaTrader.

          Just keep in mind that any historical (backtesting) fill is always an assumption, since tick formations and queues at certain price levels are only present realtime.

          You can choose between two fill algorithms in NinjaTrader -

          1. Default - more conservative approach, price has to penetrate limit price to fill

          2. Liberal - limit orders only need a touch to fill

          Please also review this link http://www.ninjatrader-support.com/H...AStrategy.html under 'Historical Fill Processing'

          Thanks and have a great day!
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Thanks, you seem to have the best compromise between power and ease of access, I will definitely give Ninjatrader a try.

            I particularly like the free historical intraday feed provided by GAIN forex..... this is really perfect for backtesting before going live.

            Comment


              #7
              You are welcome Duval, have a good developing time with NinjaTrader!

              Here's a link to our help guide, which is very comprehensive and a great learning start - http://www.ninjatrader-support.com/H...njaTrader.html
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Ok, in the context of a backtest on 5 minutes bars where I set not to update strategy on bar close, I developped a simple strategy, and final trigger for long entry is:

                bar price (close) > High of yesterday, with condition that bar open < yesterday high. The goal was to enter position just when price cross yesterday high even if not an OHLC value.

                What happens is that the entry is always on next bar open, never in the bar at exactly yesterday high + 1 tick.

                Is the only solution in this context is to have entry the closest possible to yesterday high + 1 tick, is to use multi time frame strategy, with signals generated on smaller time frame when smaller time frame close > yesterday 5 minute bar high ?

                Cordially,
                Duval

                Comment


                  #9
                  Hello Duval,

                  You will need to set "Calculate on bar close" to False for your strategy in Initialize(). More information can be found at the link below.
                  JasonNinjaTrader Customer Service

                  Comment


                    #10
                    Thanks for continuous support, but I really have this problem still with entry systematically on next bar open. Stop loss and profit are well calculated though and don't wait bar to close in backtests to be triggered.

                    Of course I unchecked calculate on bar close.

                    Maybe I set my parameter wrong ?
                    In the wizard I say that condition that Close(0) > High(1). I expect from this that a long is generated at high(1) +1 tick level in current bar from last bar. Maybe I specify wrong.

                    Cordially,
                    Duval

                    Originally posted by NinjaTrader_Jason View Post
                    Hello Duval,

                    You will need to set "Calculate on bar close" to False for your strategy in Initialize(). More information can be found at the link below.
                    http://www.ninjatrader-support.com/H...dateEvent.html

                    Comment


                      #11
                      What you will get is an entry when close of current bar is greater than the high of the last bar by at least 1 tick. When running your strategy in real-time and calculate on bar close parameter is set to false, this condition will be checked on each incoming tick.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Ray View Post
                        What you will get is an entry when close of current bar is greater than the high of the last bar by at least 1 tick. When running your strategy in real-time and calculate on bar close parameter is set to false, this condition will be checked on each incoming tick.
                        Thanks for your support.
                        Ok I understand why I get this. the point is: is there a way to have the signal from the backtest entered right at the high of previous bar + 1 tick ?
                        If backtests can only simulate entry at next bar open after signal is triggered... then this is a serious problem for me since backtest will be useless as there are big variation between signal and next bar open.

                        Cordially,
                        Benj

                        Comment


                          #13
                          You have then run into the limitation of backtesting. Backtest fills can only occur on the bar after the signal bar. This will not be any different on any other commercial backtest application in the market.
                          RayNinjaTrader Customer Service

                          Comment


                            #14
                            Ok.
                            And can this be overcome with Ninjatrader's multi time frame capabilities ?

                            For example, still in a backtest environement, have signals generated on 3 seconds charts of instrument Y, based on setups of 5 minutes charts of same instrument Y ?

                            For example, compare 3 second chart close of current bar to high of latest 5 minute bar (once bar is completed) and generate signal if the 3 second bar close is higher ?

                            This would be a real solution to the problem but i'm wondering if it can be done in such a way in backtest environment ?

                            Thanks,
                            Duval

                            Comment


                              #15
                              Duval,

                              Please see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=6652

                              Be advised that even with more granularity it will still not be the same as forward testing though.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by junkone, Today, 11:37 AM
                              2 responses
                              14 views
                              0 likes
                              Last Post junkone
                              by junkone
                               
                              Started by frankthearm, Yesterday, 09:08 AM
                              12 responses
                              44 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              5 responses
                              35 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by proptrade13, Today, 11:06 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              35 views
                              0 likes
                              Last Post love2code2trade  
                              Working...
                              X