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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    56 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    57 views
    0 likes
    Last Post PaulMohn  
    Working...
    X