Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order of Bars in Progress

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

    Order of Bars in Progress

    I have a strategy that needs to take the value of a second time frame and use it to calculate whether to enter or not in the default data series. The series is setup as series #2.

    What appears to be happening is on, for example, the 9:45 bar I get a buy signal on series #2 (which is 15 minute time frame) and I get a buy signal on the same bar in the default series (which is 5 minutes) but the signal from the 15 minute bar is not recognized until the next 5 minute bar calculation.

    It looks to me that the dataseries are processed starting with the default data series, series #1 and then series #2. So, as the buy order can only be initiated in the default series, it is run at 9:45 with the data signal from 9:30 (the previous bar)for data series #2.

    Is there a way to have the program calculate data series #2 (ie. 15 min bars) prior to the default series (ie. 5 min bars) so that the result of the 15 min bars can be used to initiate trades when the default series is run on the same bar closing?

    thx,

    Fred

    #2
    imported post

    Here's a copy of what I'm seeing:

    0 02/05/2007 9:45:00 AM TimeCheck = 1 LTFLong = 0 STFLong = 1 LTFShort = 0 STFShort = 0

    1 02/05/2007 9:45:00 AM TimeCheck = 1 LTFLong = 0 STFLong = 1 LTFShort = 0 STFShort = 0

    2 02/05/2007 9:45:00 AM TimeCheck = 1 LTFLong = 1 STFLong = 1 LTFShort = 0 STFShort = 0

    You see that LTFLong = 1 for series 2 but is not calculated until after series "0" is run. I need the LTFlong signal at 9:45 to be used in the 9:45 series 0 calculation as to whether to enter or not.

    Fred

    Comment


      #3
      imported post

      Freddie wrote:
      I have a strategy that needs to take the value of a second time frame and use it to calculate whether to enter or not in the default data series. The series is setup as series #2.

      What appears to be happening is on, for example, the 9:45 bar I get a buy signal on series #2 (which is 15 minute time frame) and I get a buy signal on the same bar in the default series (which is 5 minutes) but the signal from the 15 minute bar is not recognized until the next 5 minute bar calculation.

      It looks to me that the dataseries are processed starting with the default data series, series #1 and then series #2.

      >> correct

      So, as the buy order can only be initiated in the default series, it is run at 9:45 with the data signal from 9:30 (the previous bar)for data series #2.

      Is there a way to have the program calculate data series #2 (ie. 15 min bars) prior to the default series (ie. 5 min bars) so that the result of the 15 min bars can be used to initiate trades when the default series is run on the same bar closing?

      >> no, you would need to switch the series in your setup

      thx,

      Fred

      Comment


        #4
        imported post

        Dierk,

        If I switch the series in the setup then the 15 minute series becomes default and then I cannot initiate trades on the 5 minute time frame.

        So for example if at 9:45 the 15 minutes signal is to buy and the 5 minute has not triggered yet then I don't enter the trade. At 9:50, I'd like to check again if the 5 min signal has triggered given that I know that the 9:45 signal on the 15 minute is still a buy as it will not change again until 10 am but I won't be able to if the 15 minute is the default time frame.

        It looks to me, based on your last reply, that you can only use multi time frames in instances where you want to trade in the longer time period and use signals from short time periods. Is that correct?

        Fred










        Comment


          #5
          imported post

          This likely is the same issue as here: http://ninjatrader.mywowbb.com/view_..._to=9784#p9784

          Sorry, but right now I can not provide you a better answer.

          Comment


            #6
            imported post

            Dierk,

            I might have found a work around for it. Is there a way to place an order at the open of the current bar even though the bar is calculated on the close? This would work for backtesting but not for using the strategy for automated trading.

            The program is setup now to run the logic for the default series first. I've put the 5 min signal in dataseries #1, 15 min signal in dataseries #2. So when it runs dataseries #0 first it is using the values from the close of the previous bar in terms of 5 minute and 15 minute signals.

            Fred

            .

            Comment


              #7
              imported post

              Freddie wrote:
              Dierk,

              I might have found a work around for it. Is there a way to place an order at the open of the current bar even though the bar is calculated on the close?

              >> sorry no

              Comment


                #8
                imported post

                Thx Dierk for your help.

                Just one follow-up; in the software there is a sample multi-timeframe sample strategy. I've run it on numerous instruments but no entries or exits. Not sure why but anyways it is similar to what I want to do.

                Why would this one work and mine not? It appears to me that it will have the same problems that I'm having with having data not line up on the current bar during calculation and thus using some data from the previous bar. Can you help me understand the differences between this program and mine?

                Fred


                Comment


                  #9
                  imported post

                  Hmm .. hard to tell. I suggest taking the NT sample, copying to your code and change it step by step to see where it finally breaks...

                  Comment


                    #10
                    imported post

                    Dierk,

                    I've run the sample code as I said and it does not trigger any signals on any instruments and based on our discussion I don't see how it could work.

                    Does it work on your computer?

                    Fred


                    Comment


                      #11
                      imported post

                      All samples are tested and do work. It could be that the signal conditions are not triggerd based on your test data set. Please try simplifying them or even eliminating them.

                      Comment


                        #12
                        imported post

                        Dierk,

                        I'd really appreciate it if you ran the multi time frame sample as it really does not work. I ran the sample MA crossover and it works fine. Basically the two are the same strategy except one uses multi time frames.

                        I'm really trying to understand why my strategy does not work or how I could modify to make it work differently and am trying to find something that might give me an idea of how it might be modified (ie. the sample multi time frame strategy) but it appears, as I said, not to work. Maybe none of the multi time frame strategies work. Based on what I know and what you've told me I can't see how any of them could work accurately.

                        I'm willing and have put a lot of work in on my end to get up to speed on the programming, etc. and I don't want to have it all go to waste and have to start over with a new software program. If the software cannot do multi timeframes then let me know and I'll figure out another way to do it.

                        thx,

                        Comment


                          #13
                          imported post

                          Freddie,

                          NT for sure has the limitations as outlined below: http://ninjatrader.mywowbb.com/view_topic.php?id=2075&forum_id=16&jump_to =9784#p9784

                          Unfortuntely we can not offer a work around for you at this time.

                          Sorry

                          Comment


                            #14
                            imported post

                            More clarification on that issue:

                            - as you have a strategy with 2 different time frames on the same instrument you only can place orders/signals in the OnBarUpdate method of series #1 but not in the OnBarUpdate method of series #2: you'll see log entries that these orders/signals will be rejected

                            - as you have a strategy with 2 series on different instruments you can place orders/signals in the OnBarUpdate method of series #1 and series #2, but you can not place an order/signal for series #1 while in the OnBarUpdate method of series #2 (and vice versa)

                            We will consider eliminating this limitation later on this year.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            558 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            324 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            101 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            545 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            547 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X