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 CortexZenUSA, Today, 12:53 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by CortexZenUSA, Today, 12:46 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by usazencortex, Today, 12:43 AM
    0 responses
    5 views
    0 likes
    Last Post usazencortex  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    168 responses
    2,265 views
    0 likes
    Last Post sidlercom80  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    12 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X