Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why does NT not consider signals from yesterday?

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

    Why does NT not consider signals from yesterday?

    Hello
    I have a strategy based on daily bars. In the backtests, as expected, NT generates submitted orders for the next day.
    I have now the following situation:
    I have daily data until yesterday (17.03). My Strategy would/should submit an order, which should be shown today. But when backtesting, it show"exit on close" on 17.03 and when running the strategy in the strategy tab live, then no order is generated. why?
    Can NT not display the orders generated yesterday for today?

    regards
    Andre

    #2
    Andre, NT is event based meaning there's no daily OnBarUpdate() call until the opening tick of the new bar is received - have you tried from a daily chart with COBC set to false?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      thanks for your first feedback, I have 3 remarks/questions:

      1. General: Is there no way take current stock prices (stock market is open) and use it as new bar?

      2. About your suggestion on chart: Yes, I have done this and yes, I see that it considers in this case also 17.3. I can see this in my logfile. But on the chart nothing changes, still shows on 17.3 "exit on close".

      3. Furthermore: When I enable strategy in the "strategies" tab, should it then not produce now a signal? The order was generated yesterday and the market is open now

      Comment


        #4
        Andre, for the realtime data coming in, it would depend what session template you're working off, if for example you use RTH hours then the current (pre) market data would not be considered. With what option are you generally starting up your strategy, are they waiting to be flat or should the immediately submit any historical orders?

        Thanks,
        BertrandNinjaTrader Customer Service

        Comment


          #5
          hmm, don't understand at all what you mean.
          My strategy is applied to european equity market and considers ca. 200 days backwards. So, when I run it, it submits an order on thursday, which must be visible on friday. but it is even now not visible, it becomes only visible on saturday, when I have also friday data.

          Comment


            #6
            Beauregard,

            The behavior depends on numerous factors contributing to the exact scenario of your strategy. Please inform us about the exact specifics of your example:

            1. What instrument are you testing?
            2. What time frame? Daily charts? Minute charts?
            3. What is the exact session template being applied to this instrument?
            4. At what point did you run your strategy? Friday during the market so after the signal was already generated?
            5. What CalculateOnBarClose setting are you running the strategy on?
            6. Which data provider are you using?

            Thank you.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              >1. What instrument are you testing?
              Equities on swiss and german stock market.

              <2. What time frame? Daily charts? Minute charts?
              As written above: Only daily. I use only daily data.Therefore when I run my strategy on Friday it considers all daily data until Thursday, the day before. Based on the data it generates an order on Thursday, which NT would execute on Friday morning at the opening (=during backtests NT takes the open price of Friday).
              The problem is: When I execute it on Friday, I can nowhere see that on Thursday an order was created to be executed on Friday.

              <3. What is the exact session template being applied to this instrument?
              I created my own, called "Europe Equities". Sessions are from Monday-Friday from 09:00 to 17:30.
              Time Zone is UTC+01.00 (Amsterdam, Berlin, Bern...)

              <4. At what point did you run your strategy? Friday during the market so after the <signal was already generated?
              a) Friday morning before the market. This is logical, since my strategy produces with data until thursday a signal whether I should buy/sell or not on Friday. But, as written, no signal is shown. This is only shown, when I execute it next week with backtesting, then it shows me, that at Fridays open the order was executed
              b) Friday morning during the market. no difference

              <5. What CalculateOnBarClose setting are you running the strategy on?
              I tested both, true and false.

              <6. Which data provider are you using?
              Yahoo

              Comment


                #8
                Hi Beauregard,

                Unfortunately this is expected with the yahoo feed. It is is delayed end of day, so you will not see a bar until after the close of the session, which is later than the timing of your strategy requires. In order to evaluate this properly, you really need a data provider that supplies real time data. The link below goes to a table which outlines our providers and the level of data supported for each:


                You can use the simulated data feed if you are looking for a way to evaluate real time strategy behavior without subscribing to a data feed.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by Beauregard View Post
                  hmm, don't understand at all what you mean.
                  My strategy is applied to european equity market and considers ca. 200 days backwards. So, when I run it, it submits an order on thursday, which must be visible on friday. but it is even now not visible, it becomes only visible on saturday, when I have also friday data.
                  Strategy has a property where you can tell it to NOT close positions at end of day.
                  Attached Files

                  Comment


                    #10
                    coming back to this question to clarify.
                    @koganam: Thanks for the tipp, but this did not solve my problem

                    @NinjaTraderSupport
                    I made now a simple test-strategy which enters long when day=wednesday. Today we have thursday. In my database is data until yesterday.
                    Both following variants do not work
                    1. I test with the strategy analyzer and print to output. Obviously the strategy should come to the statement where the EnterLong command is written. But it does not, seems the last loop done is on 9th August. Even I have data in my database until 10th August
                    2. I added the strategy to the tab "strategies" and enable it. Obviously, it should with the data of yesterday generate a EnterLong Order which should be shown today (and executed with open price). But it does not also not pass the statement

                    I understand right: This is the desired behaviour and not a bug? Because technically there is no reason for it, to have an incentive for uses to buy realtime data would be a reason

                    And a 3rd question:
                    I have activated the simulated data feed. The strategy in "strategies" tab now passes the statement in the code, but in the tab "order" nothing is listed. Should there not be an order pending?

                    thanks,
                    Andre

                    Comment


                      #11
                      Andre, this will not work as your do not have a bar for Thursaday yet, so the Wednesday bar is not closed and thus the order not generated - NinjaTrader is not time based, but event based - so the opening tick of Thursday's bar close the Wednesday one.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        ok, clear.
                        Let's assume I have real time data feed. As I understood you, I still then have to wait for the first tick to come in order to know whether my EOD strategy generated yesterday a signal?

                        Comment


                          #13
                          Correct, the OnBarUpdate() triggering your signal would be called once the bar is closed, this happens if the new bar opens. To get the signal earlier run live with CalculateOnBarClose = false and filter the signal then with a time filter as well, so for example at 1600 EST so you can act before the close of the day if so desired.
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            OK, thanks. I will do that.
                            To make sure: if I set CalculateOnBarClose = false and do a backtest with daily data, having daily and minute data in the db, it considers only the daily data, right?

                            Comment


                              #15
                              Hi Beauregard,

                              You can consider that CalculateOnBarClose is always true in a backtest. The strategy logic is only processed on bar close.

                              The strategy can be run against available daily and minute data. When you run the backtest in strategy analyzer, you choose the interval that it's run against. If you select daily, then it's run against the daily bar series. It's only run on one series at a time, unless you specifically code a multiseries strategy.
                              Ryan M.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by helpwanted, Today, 03:06 AM
                              2 responses
                              21 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Started by DayTradingDEMON, Today, 09:28 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post DayTradingDEMON  
                              Started by navyguy06, Today, 09:28 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post navyguy06  
                              Started by rjbtrade1, 11-30-2023, 04:38 PM
                              2 responses
                              77 views
                              0 likes
                              Last Post DavidHP
                              by DavidHP
                               
                              Started by cmtjoancolmenero, Yesterday, 03:58 PM
                              8 responses
                              31 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X