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

Enable strategy outside rth

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

    Enable strategy outside rth

    Hi,

    I have a question, I tried to start my strategy outside RTH (during the weekend). The strategy was enabled (green). However when inside the RTH no output to the console (i have several Print statements in this OnBarUpdate() ).

    I restarted (disabled and enabled) the strategy during RTH and the strategy seems to run fine (Print statements are executed).

    Is this normal and intended behaviour ? (and why) ? Is there way to changes this ?

    KR
    Tom

    #2
    Hello Tom,

    Where you printing the Time[0] outside of any conditions as the first line in OnBarUpdate()?

    If the Time[0] does print and this is not in any conditions then no data is being processed.

    Is this for historical data as well or real-time only?

    Were there historical bars on the chart? Were there real-time bars appearing on the chart?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thanks for your quick reply.
      I use Time[0]; there is a condition like return if BarsRequiredToTrade is not reached before the Time[0] statement. And time[0] statement I use checks if MarketPosition is Flat.

      For historical data the Time[0] print is executed. For realtime data I would expect a OnBarUpdate at time of opening of the market.

      KR
      Tom

      Comment


        #4
        Hello Tom,

        Thank you for confirming that Time[0] is printing for historical bars.

        What is Calculate set to in the strategy parameters?

        What is the bar type and interval selected for the chart?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi

          I don't have a chart, just the strategies and output window. Strategy uses 15 min FDAX 09-18 data. I don't know what you mean with Calculate (you mean the setting " on bar close " .... ?)

          regards
          Tom

          Comment


            #6
            Hello Tom,

            Yes, the Calculate setting can be 'On each tick', 'On price change', or 'On bar close'.

            If Calculate is set to 'On bar close', the print would appear after the first 15 minute bar closes.

            May I confirm you have waited 15 minutes for the bar to close in real-time and after the bar closed no print has appeared?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Yes, correct I waited more than 15 minutes.

              The strange thing is that I restarted (after a couple of hours within the RTH) the strategy I see (historical and realtime) the time[0] prints in the output window. But that did not happen when I started the strategy outside RTH and waited for a couple go hours after opening.

              Comment


                #8
                Hello Tom,

                During that time did you open a chart to ensure that new bars are appearing on a 15 minute chart?

                The script is using an ETH trading hours template correct?
                If so, I would expect real-time data to trigger the prints after 15 minutes just like a chart would.

                On what instrument and at what time and on what date were you trying to view the real-time data? (I just want to verify that the market was in session at the time you were trying to view it)
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hi

                  I did not open a chart during that time. I just disabled and enabled the strategy. The Instrument is FDAX 09-18. The script uses 'regular trading hours' setting. This occurred today. Opening should have been at 08:00 (German time). At about 13:00 I restarted the strategy.

                  Comment


                    #10
                    Hello Tom,

                    The strategy will not process bars outside of the trading hours template selected for the Strategy.

                    The trading hours template controls the hours that a chart or script is able to run.

                    If the strategy is using RTH hours, it will not process data outside of those hours. Use the ETH template if you want the strategy to run for the ETH hours outside of the RTH hours.

                    Also, next time open a chart and ensure the chart is updating.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi

                      thanks for your help

                      Kind Regards
                      Tom

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by WHICKED, Today, 12:56 PM
                      2 responses
                      14 views
                      0 likes
                      Last Post WHICKED
                      by WHICKED
                       
                      Started by Felix Reichert, Today, 02:12 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post Felix Reichert  
                      Started by Tim-c, Today, 02:10 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post Tim-c
                      by Tim-c
                       
                      Started by cre8able, Today, 01:16 PM
                      2 responses
                      9 views
                      0 likes
                      Last Post cre8able  
                      Started by chbruno, 04-24-2024, 04:10 PM
                      3 responses
                      49 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X