Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Running a strategy that prints message from another strategy

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

    Running a strategy that prints message from another strategy

    Hi!,

    Today I was testing one strategy until it didn't work any more, I put a print instruction in first line of OnUpdateBar, but it never showed when running again this strategy, it only displays the messages in initialize method.

    Then I createad a new strategy, and it didn't work at the first test, but this time I saw it was printing the messages first from the old strategy (only within initialize method) and then the own messages (again only in initialize method) and never reaches the onupdatebar method where (in this second strategy) I only put a print statement...

    I shutted off the NT and restart again, but it displays the same, it doesn't works.

    What can I do?

    thanks in advance

    #2
    joanNT, welcome to the forums - this is partially expected as the Initialize() method is called across all scripts - is the default SampleMACrossOver strategy working for you normally?

    Do you see any error message in the log tab as you run the strategies giving you issues?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Reply

      The sample strategy doesn't work too.

      The log gives me no error when I run a strategy, except for one that it gave me I think at beginning of tests:

      24/02/2010 11:57:32;Strategy;Error on calling 'OnBarUpdate' method for strategy 'LarryWilliams1': El índice estaba fuera del intervalo. Debe ser un valor no negativo e inferior al tamaño de la colección.;

      24/02/2010 11:41:39;Strategy;A Buy order placed at '21/03/2007 20:00:00' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.;

      This messages could be sent when the first strategy I ran started to work bad, after that problably all the new and old strategies didn't work.

      Hope you can fix it.
      Thanks

      Comment


        #4
        joanNT, please restart NT fresh, open one chart connected and only apply the SampleMACrossOver from us to check.

        The message you get in the log means at some point you submitted an invalid stop order that caused NinjaTrader to ignore it, you would need to debug your order placement to ensure sending valid orders.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Reply

          Hi again,

          I've tested the strategy with a new chart and connected, it works with all strategies, BUT within the Strategy Analyzer (SA) doesn't works, when I push the "b" of Run backtest and select the SampleMACrossOver it runs the three initialize methods of the three new strategies I've created today and never reaches the onbarupdate method of any strategy.

          By now I can use the strategies in the Chart window and only open de SA for consulting the output window, but I used to write and test the strategies from the SA this was easier.

          Could you know another solution to fix this problem?

          thanks!!

          Comment


            #6
            joanNT,

            So are you saying you cannot even run a backtest of SampleMACrossOver in the Strategy Analyzer? That is odd. Are you sure you have data for that instrument?
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hi again!

              I do not know what was happening yesterday, today all is working fine, I can run with the AS my strategies and I get what it's supposed to.

              I'm running and testing "Multi-Time Frame & Instruments" strategies and I'm wondering why sometimes the openning order executed on a barsinprogress=1 it's drawed in the next barsinprogress=0 bar while in the executtion tab the time of the entry order was at the previous bar, you can see this on the picture annexed:

              Thanks
              Attached Files

              Comment


                #8
                Is this generated from realtime executions or backtesting on this chart?

                For realtime execution you want to ensure your PC clock is synched up as incoming executions would be stamped by this as reference.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  reply

                  Bertrand,

                  It's generated from backtesting.

                  Is this behaviour normal?

                  Thanks!

                  Comment


                    #10
                    For backtesting, it's expected that trades will be executed on the next possible trade location, which is the open of the next bar per default, as the intrabar tick formation is unfortunately not known when backtesting.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Reply

                      Yes, it's what I've expected, cause the log of trades, executions, etc showed in AS where with different timestamp as showed in chart.

                      Do you know if in the new version of NT does this happen? I ask this cause I know it's possible to add more than one instrument or another dimension time of the same instrument in a chart.

                      Thanks

                      Comment


                        #12
                        If you have added a smaller series to execute to like in our sample this could be the case...however when you plot the execution it will still be aligned with available timestamps of the bars.

                        NT7 will support MultiSeries charts, correct -

                        BertrandNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by cre8able, Today, 03:20 PM
                        0 responses
                        5 views
                        0 likes
                        Last Post cre8able  
                        Started by Fran888, 02-16-2024, 10:48 AM
                        3 responses
                        47 views
                        0 likes
                        Last Post Sam2515
                        by Sam2515
                         
                        Started by martin70, 03-24-2023, 04:58 AM
                        15 responses
                        114 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by The_Sec, Today, 02:29 PM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by jeronymite, 04-12-2024, 04:26 PM
                        2 responses
                        31 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Working...
                        X