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

Booking in second timeframe doesn't vary with period value

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

    Booking in second timeframe doesn't vary with period value

    I created a multiframe strategy where I book trades on the second period, for example, of type Second, value 1. I made the period value a variable parameter. When I test this strategy in SA I get different results depending on the period value, however when I test it in Market Replay (x500) the results are all the same. Is this intentional or is it a bug? Strategy attached.
    Attached Files

    #2
    nailz420, yes I would expect that outcome - in Market Replay the full intrabar formation is available so you'll be always executing on the 1 tick level.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      I want to make sure you understand my question. I vary the bars period on which I am booking trades, but whether it's 1 or 200 seconds the trades get booked the same. I expect that if the period is 200 seconds, then the trade would get booked at the open of the next 200 second bar.

      Comment


        #4
        Thanks, yes understood - in Market Replay I would expect those results. For back-testing the variation would be seen, as it depends to which series you submit for an intrabar fill simulation.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Sorry, I am not sure if you agree or disagree with me.

          Originally posted by NinjaTrader_Bertrand View Post
          Thanks, yes understood - in Market Replay I would expect those results.
          - what do you mean by "those" results? Trades booked at different times depending on the period length against which the trade was booked or trades booked at the same time regardless of the period length?

          For back-testing the variation would be seen, as it depends to which series you submit for an intrabar fill simulation.
          - Could you please take a look at my example strategy that I created and attached to my post to demonstrate this test case? I want to make sure we're on the same page.

          What I want to be able to do here is have a controlled delay before the trade is booked. So if I submit a trade against a 5 second period, I want the trade to book after at least 5 seconds have elapsed.

          Thanks,
          Tim

          Comment


            #6
            Tim, what I meant was: I would expect the differences you saw in your first post - you do not introduce any delay here with the code you have, as it's the same series in realtime you submit to - you have not coded in to wait for a bar update on the smaller series and only then submit.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              you have not coded in to wait for a bar update on the smaller series and only then submit.
              Could you point me to a post or documentation which would give me a hint on how to code it to wait for the bar update on the secondary series?

              Thanks,
              Tim

              Comment


                #8
                Tim, would not have a sample or post to refer you to unfortunately. You would be looking into creating for example a flag that allows to enter in BIP0 and then you would monitor for a bar update in your BIP3 (or whatever series you wish) and then Enter if the flag permits and reset it's state.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by knighty6508, 05-10-2024, 01:20 AM
                4 responses
                26 views
                0 likes
                Last Post knighty6508  
                Started by OllieFeraher, 05-09-2024, 11:14 AM
                6 responses
                19 views
                0 likes
                Last Post OllieFeraher  
                Started by PaulMohn, 05-02-2024, 06:59 PM
                2 responses
                44 views
                0 likes
                Last Post PaulMohn  
                Started by ETFVoyageur, Today, 02:10 AM
                0 responses
                17 views
                0 likes
                Last Post ETFVoyageur  
                Started by rayyyu12, Today, 12:47 AM
                0 responses
                12 views
                0 likes
                Last Post rayyyu12  
                Working...
                X