Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can I check if an alert on a line is enabled via NinjaScript

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

    Can I check if an alert on a line is enabled via NinjaScript

    Hi,

    I currently configure alerts on lines with place order action to enter trades via the UI.

    I would like to run a script to check the configuration in case I fat finger something.

    Is there a ninja script lib that would allow me to check Enabled status, and Actions?

    I see AlertConditionItems in the editor but no documentation found (yet)

    for reference, I am currently locating the line like this..

    Code:
    var objLine = DrawObjects.ToList().Where(i => i.Tag == "buy-tag").FirstOrDefault();
    var realLine = (NinjaTrader.NinjaScript.DrawingTools.Line)buyMarker
    Cheers!

    #2
    Hello robforee2,

    Thank you for the post.

    At this time there is currently no documented API for working with alerts from NinjaScript. With that being said I am not aware of a specific way to check if an alert is enabled fora s specific object. I took a look at the properties the object has and the methods to get its alert condition items however I don't see anything for the alert its self or its enabled property.

    The only workaround I can think of, assuming that you wanted to know if a line has an alert enabled, would be to name the line accordingly and check the Tag. If you plan to enable an alert on a line, rename the line to include something specific like adding a letter before the tag like A_ or include something in the name like Has Alert that could be checked for.

    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by f.saeidi, Today, 12:14 PM
    7 responses
    16 views
    0 likes
    Last Post f.saeidi  
    Started by Russ Moreland, Today, 12:54 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by philmg, Today, 12:55 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by TradeForge, 04-19-2024, 02:09 AM
    2 responses
    32 views
    0 likes
    Last Post TradeForge  
    Started by aprilfool, 12-03-2022, 03:01 PM
    3 responses
    329 views
    0 likes
    Last Post NinjaTrader_Adrian  
    Working...
    X