Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

dont want the strategy to stop operating at end of session

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

    dont want the strategy to stop operating at end of session

    I dont understand what I am doing wrong.
    I want to switch the Strategy on and not need to start it every day again.
    I do realise that if the data connection will be lost beyond the set delay interval, the strategy will exit.
    I also know that my data stream stops in the end of the week.
    But in theory, if I dont have a data connection issues, the strategy should run without exiting.

    what should I look at , if I want the above ?

    in the strategy configuration I didnt set the " exit end of session" , i have my code take care of end of session exit for me.

    what else ?

    #2
    Hello dadarara,

    Thank you for your note.

    Exit at End of Session doesn't mean the strategy ceases operations entirely - it simply means that at the end of the daily session, it exits so that you start the next day's session in a flat position. If you leave the strategy active with this turned on, it will simply start trading again when the next session begins.

    The first thing to look to help keep a strategy running over a longer period at would be reliability of your internet connection. You may want to look into a VPS or Virtual Private Server that could host your NinjaTrader installation if you are planning to run a strategy over multiple days. Often these hosts are in a position to better guard against connection losses.

    You'll need to make sure that your PC will not start going to sleep if left unattended, so you'd want to look at the Windows Power settings to make sure your computer won't shut down your hard drive or internet while you're using it. You can find these settings under the Advanced settings for Power & Sleep in Windows.

    I would also review your strategy setting for ConnectionLossHandling:



    Please let us know if we may be of further assistance to you.


    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Kate

      I run NINJA instance on a cloud environment
      there are no disconnections
      not network and no other
      it simply exist
      the log says:

      2019-12-24 22:58:00:164|1|64|Auto close on account 'Sim202' triggered at '24/12/2019 22:58:00' on all instruments
      2019-12-24 22:58:00:217|1|64|Flatten account='Sim202'
      2019-12-24 22:58:00:217|1|64|Auto close on account 'Wxxxx' triggered at '24/12/2019 22:58:00' on all instruments
      2019-12-24 22:58:00:217|1|64|Flatten account='Wxxx'
      2019-12-24 22:58:00:164|1|4|Disabling NinjaScript strategy 'x36v11/188310091'
      2019-12-24 22:58:00:279|1|64|Auto close on account 'Sim101' triggered at '24/12/2019 22:58:00' on all instruments
      2019-12-24 22:58:00:279|1|64|Flatten account='Sim101'

      I have no idea why the "Disabling NinjaScript strategy ... " is done.
      the code I have that remotely can cause this is:

      if (Time[0].TimeOfDay >= sessionIterator.ActualSessionEnd.TimeOfDay.Subtrac t(new TimeSpan(00, 02, 00)))
      {
      ExitLong();
      ExitShort();
      return;
      }

      any ideas are welcome
      ​​​​​​​

      Comment


        #4
        Hello dadarara,

        Thank you for your reply.

        Check under Tools > Options > Trading > Auto Close Position - is this enabled? If this is enabled and anything is checked under Instruments there, when the time set in this section occurs, the platform will automatically flatten any positions on the chosen instruments. Flattening will also disable any strategies enabled on these instruments. What are your settings here?

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          this is it probably
          I had it as on.
          thought it will not affect as I already have it in the strategy
          and stupid me, I didnt test by switching it off.

          thanks
          sorry for taking up your time needlessly

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RubenCazorla, Today, 09:07 AM
          2 responses
          11 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by i019945nj, 12-14-2023, 06:41 AM
          7 responses
          81 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by timmbbo, 07-05-2023, 10:21 PM
          4 responses
          158 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by tkaboris, Today, 08:01 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Lumbeezl, 01-11-2022, 06:50 PM
          31 responses
          819 views
          1 like
          Last Post NinjaTrader_Adrian  
          Working...
          X