• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Update Processing

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

    Strategy Update Processing

    How would I structure a Strategy that would issue Entry orders on a Bar close basis, and Issue Exits on Every Tick. The Strategy should still be usable for BackTesting. I tried the code below but it does not work for backtest.
    [line]
    CalculateOnBarClose = false;

    if(Bars.Complete==1)
    {
    // Entry orders
    }

    // Exit Orders


    #2
    imported post

    See the FirstTickOfBar property in the Help Guide. There is a catch -
    • Backtestresolution is only by bar not by tick so you will not be able to truly backtest this strategy
    • Since FirstTickOfBar is true on the first tick of a bar, you need to access the values from the prior bar to analyze the close of the prior bar to generate your signal, in backtest, this will throw things off since backtest only evaluates on bar close

    Ray
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Thanks,

      My hat is off to you Ray and the Ninja Team, for having thought through so many of these situations.

      Comment


        #4
        imported post

        Backtest resolution is only by bar not by tick so you will not be able to truly backtest this strategy
        Has this changed?

        When I use the Strategy Analyzer to backtest, under "Data series" it allows me to select Type of Year, Month, Week, Day Hour, Minute, Second, Volume, and Tick.

        So, if "Type" were selected as "Tick", would this provide a tick-by-tick backtest scenario?

        If not, what does it do when I select "Tick"?

        Thanks.

        KBJ

        Comment


          #5
          imported post

          Provides a tick based interval at a user defined compression level. IE 50 tick bar, 100 tick bar.
          RayNinjaTrader Customer Service

          Comment


            #6
            imported post

            I'm not sure what to think about a "user defined compression level". This doesn't answer my first two questions, and leaves me wanting to ask more questions to clarify what is meant "user defined compression level".

            So, here's my list of current confusions on this topic:

            1. Does "user defined compression level" mean that's how the bar widths are defined when charts are displayed?

            2. Does this also affect how often OnBarUpdate() is called on a backtest?

            3. Has the feature changed, so that tick-level backtest resolution is now available?

            4. If I set the backtest "Data series" type to "Tick" and value to 1, will this create NO "user defined compression"?

            5. And if so, will this then provide a tick-by-tick backtest scnario?

            Thanks.

            KBJ

            Comment


              #7
              imported post

              We are talking apples to oranges here.

              Tick by tick level backtesting is not possible. Backtesting is based on a bar which has OHLC information. Tick by tick level backtesting means that you can backtest on a 1 min bar but each historical tick that makes up that 1 min bar is used in the backtest vs the bar by itself.

              1. No. Minute, Tick, Second, Day etc... is an interval. Compression is the period value. So a 5-minute bar is has a compression value of 5. a 100 tick bar has a compression value of 100.

              2. No.

              3. No.

              4. You get a 1 tick bar to backtest on.

              5. You get a bar based backtest resolution however, since a 1 tick bar is the lowest common denominator for any bar, you in fact get a tick by tick backtest.

              Ray
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by xasser, 05-29-2020, 02:17 PM
              6 responses
              57 views
              0 likes
              Last Post NinjaTrader_Jim  
              Started by weav74, Today, 07:36 AM
              0 responses
              1 view
              0 likes
              Last Post weav74
              by weav74
               
              Started by billythekid72, Today, 07:10 AM
              2 responses
              6 views
              0 likes
              Last Post billythekid72  
              Started by Gav_G, 05-28-2020, 01:23 PM
              3 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jim  
              Started by JustinOfNazareth, Today, 07:22 AM
              0 responses
              5 views
              0 likes
              Last Post JustinOfNazareth  
              Working...
              X