• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


Is it possible to create a custom drawing object with alert attached?

  • Filter
  • Time
  • Show
Clear All
new posts

    Is it possible to create a custom drawing object with alert attached?

    I would like to have an alert condition attached to a drawing object, saved. Is this possible?
    E.g. a saved Horizontal Line style that has an alert condition to play a sound file whenever price approaches the line, say 10 ticks away approaching from above or below. So whenever I add this 'custom line' to a chart, the alert is already attached/activated?

    I've watched the Help video and searched but can't find a solution. I see I can set an alert on an instrument, make a drawing object (e.g. crossing a Line) a condition and use a +&- Offset but this is a pain when I always want the same thing every time I attach the line, and I see that I can't attach an alert to a drawing object although if I recall correctly there may have been some talk of changing this but don't know if done.

    The 'line' could be drawn by an indicator - e.g. price returns to within 10 ticks of the high or low drawn by Current OHL. Is there a path to getting what I want that way? If I attach an alert to an OHL indicator with a 10tick offset, will that do the job i.e. if rearm and all that good stuff taken care of whenever price approaches the H/L within x ticks it will alert? And can I save it, either to the indicator or to the chart template so that it is 'always on' and ideally attached to the indicator so will always be applied? This would half satisfy compared with a drawn line, insofar as I ideally want to do same on manually not indicator-drawn line such as trendlines, Rays as and when they are drawn


    It is not possible to save an alert to an object as part of a template. You'll need to configure the alert manually each time. Alert templates are a popular feature request, so I'll add your vote to that. I'll edit this post when I get the tracking number. EDIT: the tracking number is SFT-1988.

    It is possible to save the alert to an indicator as you suggest in your last paragraph using custom NinjaScript programming.
    Last edited by NinjaTrader_PatrickG; 03-27-2018, 10:17 AM.
    Patrick G.NinjaTrader Customer Service


      Hello Patrick and thanks.
      On your second part - attach to indicator 'using custom Ninjascript programming' do you mean writing the Alert into the indicator e.g. take the 'Current OHL' indicator and code in the Alerts I want? If so, that's not what I intended to convey. I'm familiar with that from 7 and have/have done but no what I was getting at (presumably the Alerts functionality is to give Users options without there having to exist a coded indicator).

      What I was getting at was setting up an Alert and then it 'remaining'. i.e. if I set up an alert, save my chart template and then apply my chart template to another chart, will the Alert be there?
      I've just created an alert, done 'Duplicate in New Window' and the alert isn't there on the new duplicate chart in the new Window, so that doesn't 'keep' the alert. Having put the alert on the chart, will it be saved with my workspace so that it is there tomorrow? i.e. close today, will it be there when I open tomorrow (assuming save workspace on close?

      Creating an alert - for example to trigger 10 ticks either side of 3 OHL indicators is fairly laborious, my question was around trying to figure how I can get more use out of doing so than a 'one shot deal'/doing it repeatedly for every chart every day....

      Or, is it implied in the first part reply that you can't, it will need Alert templates to do so and without these it is a 'one off' exercise that doesn't 'stay'/can't be duplicated at all?



        Your configured alerts will be saved with the workspace.

        It is implied that "you can't without alert templates" because there is no way to duplicate alert settings currently.

        There are many variables involved which would all need answers before an alert could be saved as a template. For example, if you have an alert template which has specific conditions involving specific objects, and you then apply the alert template to a chart without those objects, what happens? This is a simplified example which is meant to demonstrate the current issue as to why they aren't implemented yet.
        Patrick G.NinjaTrader Customer Service


          Hello Patrick and thanks.
          That's fine & thanks for explaining, I follow the challenges - just wanting to know/understand/be clear what I can and can't do before embarking on anything.
          To summarise - there's no current way of creating an alert once, then applying elsewhere, but if I create alerts individually on each chart, once I've done it they stay with my workspace so they'll work every day.

          2 more clarifications if I may -
          - do Alerts work 'across workspaces' and when the workspace is not active
          I.e. scenario would be I add to charts in a workspace which is open but may not always be the active one - will the alert trigger when open but not active?
          and if so, will it display/does the type of Alert make any difference to this e.g. if a 'pop-up', will it pop-up 'globally' independent of which Workspace is active? If not, does sound?
          So many things to consider.
          Kind regards


            Alerts will still trigger when a workspace is open but not active.

            The easiest way to test different scenarios would be to configure an alert that is guaranteed to trigger every 10 seconds. Something like "If data series is greater than numeric value 0, action is pop-up dialog" with a rearm of 10 seconds. Here is an example:


            With this alert in place on a timer, you can try out different scenarios to ensure the alert still triggers.

            Experiment with different setups with this "auto alert" so you can see what does and what does not work.
            Patrick G.NinjaTrader Customer Service


            Latest Posts


            Topics Statistics Last Post
            Started by pjsmith, Today, 12:50 AM
            0 responses
            Last Post pjsmith
            by pjsmith
            Started by quinton77, Yesterday, 09:59 PM
            1 response
            Last Post NinjaTrader_EricB  
            Started by akuntysh, Today, 12:02 AM
            0 responses
            Last Post akuntysh  
            Started by Revan, Yesterday, 11:53 PM
            0 responses
            Last Post Revan
            by Revan
            Started by allangl, Yesterday, 10:50 PM
            0 responses
            Last Post allangl
            by allangl