Jump to content

New Ninjatrader


ptop

Recommended Posts

  • Replies 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 weeks later...

Hello,

I think changing machine_id is not easy. Machine is locked by machine_id.maybe try to change XML configuration file, if it does help .

Every software or trial software use machine_id to lock to particular system. your question is very interesting. I've never though about it.

I'm sorry, I dont have particular answer for this question.

Link to comment
Share on other sites

Here is a function that calculates the MachineId

 

public static string MachineId
{
   get
   {
       lock (typeof(Globals))
       {
           if (machineId.Length == 0)
           {
               bool flag = true;
               bool flag2 = true;
               ArrayList list = new ArrayList();
               ManagementObjectSearcher searcher = null;
               try
               {
                   ManagementScope scope = new ManagementScope();
                   ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_PhysicalMemory");
                   physicalMemory = 0L;
                   foreach (ManagementObject obj2 in new ManagementObjectSearcher(scope, query).Get())
                   {
                       physicalMemory += (long) ((ulong) obj2.Properties["Capacity"].Value);
                   }
               }
               catch
               {
               }
               try
               {
                   searcher = new ManagementObjectSearcher(new ObjectQuery("select * from Win32_Processor"));
                   foreach (ManagementObject obj3 in searcher.Get())
                   {
                       processor = (string) obj3["Name"];
                       list.Add(obj3["Name"]);
                   }
               }
               catch
               {
                   try
                   {
                       list.Clear();
                       ManagementScope scope2 = new ManagementScope(@"\\" + Environment.MachineName + @"\root\cimv2");
                       searcher = new ManagementObjectSearcher(scope2, new ObjectQuery("select * from Win32_Processor"));
                       foreach (ManagementObject obj4 in searcher.Get())
                       {
                           list.Add(obj4["Name"]);
                       }
                   }
                   catch
                   {
                       flag2 = false;
                       try
                       {
                           RegistryKey key = Registry.LocalMachine.OpenSubKey("HARDWARE");
                           if (key == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'HARDWARE' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           RegistryKey key2 = key.OpenSubKey("DESCRIPTION");
                           if (key2 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'DESCRIPTION' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           RegistryKey key3 = key2.OpenSubKey("System");
                           if (key3 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'System' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           RegistryKey key4 = key3.OpenSubKey("CentralProcessor");
                           if (key4 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'CentralProcessor' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           RegistryKey key5 = key4.OpenSubKey("0");
                           if (key5 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: '0' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           object obj5 = key5.GetValue("ProcessorNameString");
                           if (obj5 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'ProcessorNameString' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           processor = (string) obj5;
                           list.Add(obj5);
                           key4.Close();
                           key5.Close();
                           key3.Close();
                           key2.Close();
                           key.Close();
                       }
                       catch (Exception exception)
                       {
                           LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: " + exception.Message + ((exception.InnerException != null) ? (": " + exception.InnerException.Message) : string.Empty), LogLevel.Error));
                           return string.Empty;
                       }
                   }
               }
               list.Sort();
               Trace.Assert(list.Count > 0, "Cbi.Globals.MachineId1: keys.Count=0");
               string str = (string) list[0];
               list.Clear();
               try
               {
                   searcher = new ManagementObjectSearcher(new ObjectQuery("select * from Win32_BIOS"));
                   foreach (ManagementObject obj6 in searcher.Get())
                   {
                       list.Add(obj6["Name"]);
                   }
               }
               catch
               {
                   try
                   {
                       list.Clear();
                       ManagementScope scope3 = new ManagementScope(@"\\" + Environment.MachineName + @"\root\cimv2");
                       searcher = new ManagementObjectSearcher(scope3, new ObjectQuery("select * from Win32_BIOS"));
                       foreach (ManagementObject obj7 in searcher.Get())
                       {
                           list.Add(obj7["Name"]);
                       }
                   }
                   catch
                   {
                       flag = false;
                       try
                       {
                           RegistryKey key6 = Registry.LocalMachine.OpenSubKey("HARDWARE");
                           if (key6 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'HARDWARE' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           RegistryKey key7 = key6.OpenSubKey("DESCRIPTION");
                           if (key7 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'DESCRIPTION' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           RegistryKey key8 = key7.OpenSubKey("System");
                           if (key8 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'System' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           object obj8 = key8.GetValue("SystemBiosVersion");
                           if (obj8 == null)
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'ProcessorNameString' not found", LogLevel.Error));
                               return string.Empty;
                           }
                           if ((obj8 is string[]) && ((obj8 as string[]).Length != 0))
                           {
                               list.Add((obj8 as string[])[(obj8 as string[]).Length - 1]);
                               key8.Close();
                               key7.Close();
                               key6.Close();
                           }
                           else
                           {
                               LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve processor information to build machine ID: 'ProcessorNameString' is not string array or of length 0", LogLevel.Error));
                               return string.Empty;
                           }
                       }
                       catch (Exception exception2)
                       {
                           LogEventArgs.ProcessEventArgs(new LogEventArgs("Failed to retrieve BIOS information to build machine ID: " + exception2.Message + ((exception2.InnerException != null) ? (": " + exception2.InnerException.Message) : string.Empty), LogLevel.Error));
                           return string.Empty;
                       }
                   }
               }
               list.Sort();
               Trace.Assert(list.Count > 0, "Cbi.Globals.MachineId2: keys.Count=0");
               str = str + ((string) list[0]);
               char[] chArray = str.ToCharArray();
               byte[] buffer = new byte[2 * str.Length];
               for (int i = 0; i < chArray.Length; i++)
               {
                   buffer[2 * i] = BitConverter.GetBytes(chArray[i])[0];
                   buffer[(2 * i) + 1] = BitConverter.GetBytes(chArray[i])[1];
               }
               MD5 md = new MD5CryptoServiceProvider();
               machineId = BitConverter.ToString(md.ComputeHash(buffer)).Replace("-", "");
               Trace.WriteLine(string.Concat(new object[] { "Cbi.Globals.MachineId: ", flag2, "/", flag }));
           }
           return machineId;
       }
   }
}

Link to comment
Share on other sites

RegistryEditor

 

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\ProcessorNameString

 

Change any one character in the "ProcessorNameString" and your MachineId will change after reboot NT7.

 

Changing machineid doesn't affect other software and their registry?

If no, why not? As you're changing LOCAL MACHINE id, not particular software machine id ..

 

Thank you

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
Start to Friday afternoon about 4:00 PM I have time frames less than 1 hour not working with CQG continuum-demo. Is it just my problem or does it happen to you too?

 

Sorry but it seems Ninjatrader with CQG not working well. I'm testing BWt strategy …. in the past I had several executed. In this days very very few. As long as I do not understand I stop activity whit NT platform.

Link to comment
Share on other sites

Yes same pattern as NT6.5 to NT7 - they are slowly killing NT7 in favor of NT8, this is their business model it will happen again 6-8 years from now when NT9 is ready. this is how they keep them self and their partners(specially developer of indicators/systems) in business, i called them and that's pretty much what they said, they already killed about 4+ adapters on NT7 since NT8 came about i am sure CQG would be one of the last ones to get axed since is the most used of them all.

 

 

It seems you are right.

 

right now I have created a new one CQG demo account ….NT8 is working well , with NT7 the chart are completely empty. I have tested both NT7.34 ; NT7.37 cracked and NT7.38 standard release.

 

Therefore from now it seems useless to waste time with NT7

Link to comment
Share on other sites

  • 2 weeks later...
It seems you are right.

 

right now I have created a new one CQG demo account ….NT8 is working well , with NT7 the chart are completely empty. I have tested both NT7.34 ; NT7.37 cracked and NT7.38 standard release.

 

Therefore from now it seems useless to waste time with NT7

 

7.0.1000.37 works too, haven't had any issues whatsoever

Link to comment
Share on other sites

7.0.1000.37 works too, haven't had any issues whatsoever

 

Sorry but there is a misundestanding about my posts.

 

I did not complain about Ninjatrader but I had underline that in some days I have no signal in the BWT strategy I am testing. It is impossible to have several signal in a day and the day after no signal. From my side the CQG Demo Continuum has some gaps.

 

Unfortunately I do not have the possibility to use BWT on NT8. There could be a difference.

Edited by laser1000it
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...