Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create Alert from Indicator with No Plot

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

    Create Alert from Indicator with No Plot

    Hi,

    I have a custom indicator which draws an object (e.g. dot) when certain conditions are met. As such, this is not a Plot and I do not have an AddPlot(). I do have a Series<bool> variable to store "true" values when these conditions are met. I notice that under the Alerts Window, I am not able to create an Alert based on this indicator as it does not use AddPlot() to plot anything on the chart.

    I understand that I can use Alert() to hardcode the alert in the script. But if I do this, does this mean that the alert will be permanently on?
    I would like a way to manually turn on or turn off the alert, like how I can do so using a manually created alert. How can I do this?

    Thanks.

    #2
    Hi nightlights, thanks for posting.

    You can either create a plot and set its brush to Brushes.Transaprent or implement a boolean public property to toggle the alert on or off e.g.

    [NinjaScriptProperty]
    [Display(Name="Toggle", Order=1, GroupName="Parameters")]
    public bool Toggle //this will show up in the indicator settings.
    { get; set; }

    Kind regards,
    -ChrisL

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X