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

Can I create an indicator to start my automated strategies each day?

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

    #16
    Regarding IB going offline and that knocking your NinjaTrader offline, you could try as an idea, Tools -> Options -> Strategies -> On connection loss -> Handling = "keep running" or you could increase the threshold amount of time to much more so that IB could reconnect. You could then implement a secondary solution to reconnect IB if needed by restarting TWS such as AutoIT or similar.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #17
      If Orders have been executed from an AddOn (not a Strategy), how does NinjaTrader handle the IB disconnect/reconnect in relation to those existing active Orders? What are the implications, if any, for continuity of management of those Orders from the AddOn?

      Thanks.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      Comment


        #18
        Thanks Bruce, I did try playing with these settings, extending retries etc... But I could not get the results I needed...
        >> My Auto-it script has been doing the job for over two months now with virtually no issues.

        Comment


          #19
          Originally posted by jaybedreamin View Post

          Oh man, this might be just what I was looking for. Seems I have an incorrect understanding of how "Exit on session close" works, however.

          I thought this check was needed to ensure that trades are closed by the end of the session if neither a profit target or a stop loss are hit. Are you saying that I can enable my strategies on Sunday, add the timing logic(already have this as it's part of my strategy), and the strategies will still pretty much behave as they are now, until I manually disable on Friday?
          Hi jaybedreamin,

          I need to correct and clarify... I do use the ExitOnSessionClose:

          In State == State.SetDefaults:
          IsExitOnSessionCloseStrategy = true;
          ExitOnSessionCloseSeconds = (15 * 60) + 20; // 15 min (+20s) before session close to avoid overnight margin requirement


          ​NinjaTrader Brokerage requires all positions to be closed 15 minutes before session ends. Otherwise, you're subject to overnight margins. But, that setting does not shutdown or disable your strategy, it simply ensures all open positions and pending orders are closed/flattened and canceled.

          Hope that helps!
          Matt

          Comment


            #20
            Originally posted by jaybedreamin View Post
            Oh man, this might be just what I was looking for. Seems I have an incorrect understanding of how "Exit on session close" works, however.

            I thought this check was needed to ensure that trades are closed by the end of the session if neither a profit target or a stop loss are hit. Are you saying that I can enable my strategies on Sunday, add the timing logic(already have this as it's part of my strategy), and the strategies will still pretty much behave as they are now, until I manually disable on Friday?
            Yes, the "Exit on session close" feature operates independently for each session,
            and will be reset (aka, re-armed) automatically when a new session is detected
            by your strategy.

            -=o=-

            Btw, a good place to find some strategy code w/logic for start/stop times is here.
            The logic also includes 'exclusion' break times, like for an economic report.

            Some good points
            1. All times are entered as integers, in a 24-Hr format, eg, 0 to 2359.
            2. All times are local time, based upon your PC clock.
            3. Allows trade for start times < end time, eg, 930 to 1300. (9:30am to 1pm)
            4. Allows trade for start times > end time, eg, 2200 to 500. (10pm to 5am)
            5. Denies trade for break times, using same logic as 3 & 4.

            Enjoy!

            Last edited by bltdavid; 03-28-2023, 10:28 PM.

            Comment


              #21
              Curious if anyone has figured out, programmatically, how to enable strategies? Seems like there are two threads, 1. Restarting Ninja when it crashes or disconnects (answered) and 2. How to enable a strategy.

              Ninja/Apex rules have to close all instruments at 445pm automatically everyday. How do you programmatically enable the strategies at 5 pm everyday?

              Thanks for help.

              Comment


                #22
                Hello jblaiser,

                Welcome to the NinjaTrader forums!

                "there is no support for enabling NinjaScript Strategies with code"

                See post # 4 in this thread.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Yes, you have stated 12 times your company has taken this option away, we all know this. This question is for the forum, not support. This is why there is no Ninja Trader support ticket request.

                  Comment


                    #24
                    jblaiser You can keep your strategy running through the 5pm break, just make sure all your open positions are closed and you don't open a new trade until 6pm.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by fx.practic, 10-15-2013, 12:53 AM
                    5 responses
                    5,406 views
                    0 likes
                    Last Post Bidder
                    by Bidder
                     
                    Started by Shai Samuel, 07-02-2022, 02:46 PM
                    4 responses
                    98 views
                    0 likes
                    Last Post Bidder
                    by Bidder
                     
                    Started by DJ888, Yesterday, 10:57 PM
                    0 responses
                    8 views
                    0 likes
                    Last Post DJ888
                    by DJ888
                     
                    Started by MacDad, 02-25-2024, 11:48 PM
                    7 responses
                    160 views
                    0 likes
                    Last Post loganjarosz123  
                    Started by Belfortbucks, Yesterday, 09:29 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post Belfortbucks  
                    Working...
                    X