Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bulk Disable of Alerts

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

    Bulk Disable of Alerts

    I'm using alerts to detect certain indicator conditions, and once executed, it submits an ATM order that has a Trailing Stop template. I have a few instruments I am doing this with.

    I'd like to be able to essentially disable all the alerts (so new orders won't be placed) and flatten all open positions if I hit a certain PnL (both positive and negative). Is this possible?

    Thanks in advance.

    #2
    Don't know if you want this programmatically or manually. You can do it manually in HotKeys. The Window in which the Alerts reside must be active.

    Comment


      #3
      Prefer programmatically; once I hit a certain limit automatically flatten and disable alerts.

      Comment


        #4
        Hello ypbtrainer,

        Enabling or disabling manually created alerts is not supported from NinjaScript.

        However, if you wanted to make an addon or strategy that has the logic for sending orders and triggering alerts, it would be possible to code a loss limit into this and when reached have the script send orders to flatten a position and stop sending alerts.

        Below is a link to an example of a loss limit.
        Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea.

          I saw how to flatten positions across an account, but I didn't see any code to actually go through and disable alerts for a set of instruments. I saw an Alert object but not sure what the methods are underneath to be able to disable them. Of course, the reason I have to do this is that I could flatten the positions to get out, but the alerts would still be active, thereby just re-executing positions once the conditions were met again.

          Thanks in advance!

          Comment


            #6
            Hello ypbtrainer,

            I am not aware of a way to disable or enable manually setup alerts.

            If the script itself is triggering the alerts, you can code the logic to not send alerts at certain times. This would mean coding the script to send the alerts instead of setting manual alerts in the Alerts window.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I see.

              Is there a way, then, after flattening a position, that I can disconnect my account from the data connection, so in effect the alert won't have any impact?

              Or, if not, what would be the best way for me to learn how to code logic for an alert, so I can build what I have done through the Alert UI?

              Comment


                #8
                Hello ypbtrainer,

                To disconnect from a connection, you will need to find the connection (which can be found from an account) and call <connection>.Disconnect().


                Below I am providing links to the help guide on triggering alerts from NinjaScript.



                As well as a link to a forum post with helpful information about getting started with NinjaScript.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by RookieTrader, Today, 09:37 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by alifarahani, Today, 09:40 AM
                0 responses
                5 views
                0 likes
                Last Post alifarahani  
                Started by Gerik, Today, 09:40 AM
                0 responses
                4 views
                0 likes
                Last Post Gerik
                by Gerik
                 
                Started by KennyK, 05-29-2017, 02:02 AM
                3 responses
                1,283 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by AttiM, 02-14-2024, 05:20 PM
                11 responses
                185 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X