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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    70 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X