Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Are user defined IDs always generatedby suffixing with a minus?

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

    Are user defined IDs always generatedby suffixing with a minus?

    Hello,
    I have a question concerning the assignment of user defined IDs in the menu "Help" -> “3rd partylicensing…”. Is it always the case that the generated new machine ID has the form original machine ID + minus-sign + user defined ID ?

    We want to provide our customers with a customer ID after they purchase our indicator, so they can use this customer ID for generating a unique machine ID. But we also have to keep track of all generated IDs, which would be easier if the outcome of the generation process is predictable.
    Thanks in advance,
    Johannes Neubarth

    #2
    That's correct Johannes, that would be covered as well in section 10 of the Vendor License guide you should have received via email - if not please let us know at support at ninjatrader dot com.

    Thanks,
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you Bertrand. Yes I have read section 10 of the License Guide, but wanted to double-check, because it's crucial as we are designing and implementing our purchasal process now.
      Johannes Neubarth

      Comment


        #4
        Originally posted by SentiTrade View Post
        Is it always the case that the generated new machine ID has the form original machine ID + minus-sign + user defined ID ?
        Is there a way to determine what the "User defined Id" is via ninjascript?

        I realize that you can access NinjaTrader.Cbi.License.MachineId from code, but this only gets the MachineId, without the User Defined Id.

        I didn't see any likely suspects within NinjaTrader.Cbi.License.

        Thanks!
        Daniel

        Comment


          #5
          There is not a property for the user defined ID that you can access directly.

          You would need to read this from the Documents\NinjaTrader 7\config.xml file
          MatthewNinjaTrader Product Management

          Comment


            #6
            For everyone who is interested, I'm pasting below the code we are using for retrieving the user-defined machine ID. Beware: No guarantee for correctness! :-)
            Plus, the code must be adapted whenever the structure of the NT config file changes.


            Code:
            using System.Xml;
            
            string machineId = Cbi.License.MachineId;
            XmlElement nt = Cbi.Globals.ConfigFile["NinjaTrader"];
            XmlElement vl = nt != null ? nt["VendorLicenses"] : null;
            XmlElement st = vl != null ? vl["SentiTrade"] : null;
            XmlElement ui = st != null ? st["UserID"] : null;
            XmlNode fc = ui != null ? ui.FirstChild : null;
            string userSuffix = fc != null ? fc.Value : null;
            if (userSuffix != null) {
                machineId += "-" + userSuffix;
            }

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            6 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Started by alifarahani, Today, 09:40 AM
            6 responses
            41 views
            0 likes
            Last Post alifarahani  
            Working...
            X