Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Alert ID

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

    Alert ID

    Quick Question about AlertCallback....

    The docs at http://ninjatrader.com/support/helpG...rtcallback.htm require a "unique" id.

    How unique does this need to be? I want an alert to run on multiple timeframes and instruments.

    Do I need to do something like:


    var alertId = Instrument.Name + BarsPeriod.ToString() + "_MyAlertName"

    or is it sufficient to just use "MyAlertName"?

    #2
    Hello reach4thelasers,

    Thank you for writing in.

    The ID should be unique enough that no other calls contain the same ID, even if its run on a different instrument/timeframe within a different indicators.

    “MyAlertName” would cause issues, and you would be better amending the ID name with a BarsPeriod and instrument name, as you suggested.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Alan. I went with GetHashCode().ToString() which is unique for every running Indicator instance.

      It might make sense to append the hashcode automatically.... under-the-hood - I can't think of a use-case for having instances of the same indicator running on different timeframes/instruments re-arming each other's alerts.... only lots and lots of problems!!

      At the very least the docs should be clarified on this point.

      Thanks for getting back to me.

      Comment


        #4
        Hello reach4thelasers,

        I have passed your suggestion on to development.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        21 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        9 views
        0 likes
        Last Post cre8able  
        Working...
        X