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 DanDaMan, 02-23-2021, 09:02 AM
    2 responses
    11 views
    0 likes
    Last Post brucerobinson  
    Started by vaughn, Today, 02:58 AM
    0 responses
    1 view
    0 likes
    Last Post vaughn
    by vaughn
     
    Started by Byndhwkfrs, Today, 02:29 AM
    0 responses
    3 views
    0 likes
    Last Post Byndhwkfrs  
    Started by slenderketodiet, Today, 01:57 AM
    0 responses
    3 views
    0 likes
    Last Post slenderketodiet  
    Started by slenderketodiet, Today, 01:56 AM
    0 responses
    1 view
    0 likes
    Last Post slenderketodiet  
    Working...
    X