Generic Class Library - bugs, description, questions, usage and suggestions - page 30

 
Alexey Rassvetnyy:

Can you tell me why the code doesn't compile?

The problem is in system enums: ENUM_CHART_PROPERTY_DOUBLE, ENUM_CHART_PROPERTY_STRING something is wrong with them. If I use my enum as the key type, the compilation also passes.

Reported a defect, hope they will fix it someday.

https://www.mql5.com/ru/forum/1111/page2952#comment_20527784

Библиотека Generic классов - ошибки, описание, вопросы, особенности использования и предложения
Библиотека Generic классов - ошибки, описание, вопросы, особенности использования и предложения
  • 2019.08.16
  • www.mql5.com
С 6 декабря 2017 года в стандартную поставку MetaTrader 5 стали входить так называемые Generic-классы, реализующие эффективные алгоритмы для хранен...
 
Alexey Rassvetnyy:

Claimed a defect, hopefully they'll fix it someday.

https://www.mql5.com/ru/forum/1111/page2952#comment_20527784

//+------------------------------------------------------------------+
//| fix HashMap.mqh                                                  |
//|  line 21  | was | Entry(void): key(NULL) {}                      |
//|           | now | Entry(void): key((TKey)NULL) {}                |
//|  line 462 | was | m_entries[i].key=NULL;                         |
//|           | now | m_entries[i].key=(TKey)NULL;                   |
//+------------------------------------------------------------------+
 
Hi all

I have a suggestion to add an option that allows traders to use a trailing stop after the take profit level, which would help a lot in manual trading.

This could be a square button to select this option in the custom trailing stop window.

Regards,
 

Who can tell me if it is possible to run this code in Metatrader?

// Product and SerialNumber.
// You can replace these properties by
// an asterisk (*) to get all properties (columns).
ManagementObjectSearcher searcher =
    new ManagementObjectSearcher("SELECT Product, SerialNumber FROM Win32_BaseBoard");

// Executing the query...
// Because the machine has a single Motherborad,
// then a single object (row) returned.
ManagementObjectCollection information = searcher.Get();
foreach (ManagementObject obj in information)
{
    // Retrieving the properties (columns)
    // Writing column name then its value
    foreach (PropertyData data in obj.Properties)
        Console.WriteLine("{0} = {1}", data.Name, data.Value);
    Console.WriteLine();
}

// For typical use of disposable objects
// enclose it in a using statement instead.
searcher.Dispose();

---

Is there any other way to get the Motherboard SerialNumber?

 
Vitaly Muzichenko:

Who can tell me if it is possible to run this code in Metatrader?

---

Is there any other way to get the Motherboard SerialNumber?

And what will it be in the virtual machine?

 
JRandomTrader:

And what will it be like in the virtual machine?

We'll have to see.

 
JRandomTrader:

And what will it be like in the virtual machine?

It should be the same. UPU has the same access to the hard disk as the native system it seems. But it's better to watch, access may be restricted and then ZERO or Error will return.

 
Vitaly Muzichenko:

You need to look at it.

If you want to make a system to bind to the hard disk, it is better to query several devices, see if there are positive responses, and if not, bind to the OS, not to the hard disk. To a reg number or something else constant in the OS.

 
dmidecode
#  dmidecode 3.1
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.
12 structures occupying 524 bytes.
Table at 0x000F5840.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
        Vendor: SeaBIOS
        Version: 1.12.0-1
        Release Date: 04/01/2014
        Address: 0xE8000
        Runtime Size: 96 kB
        ROM Size: 64 kB
        Characteristics:
                BIOS characteristics not supported
                Targeted content distribution is supported
        BIOS Revision: 0.0

Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: QEMU
        Product Name: Standard PC (Q35 + ICH9, 2009)
        Version: pc-q35-3.1
        Serial Number: Not Specified
        UUID: 1 C48EB8C-FD03-4 CD4-A3D9-E3133CB57511
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Not Specified

Handle 0x0300, DMI type 3, 21 bytes
Chassis Information
        Manufacturer: QEMU
        Type: Other
        Lock: Not Present
        Version: pc-q35-3.1
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: Unknown
        OEM Information: 0x00000000
        Height: Unspecified
        Number Of Power Cords: Unspecified
        Contained Elements: 0

Handle 0x0400, DMI type 4, 42 bytes
Processor Information

This is the VM in the KVM. There is not even a mention of the mother.

 
Valeriy Yastremskiy:

If you want to make a system of linking to the hard drive, it would be better to query several devices, see if they respond positively, and if not, then link not to the hard drive, but to the operating system. To a reg number or something else permanent in OS.

Couldn't find the information anywhere. I did it in the hard drive partition, but it's not the same at all.

I need to find something in WinAPI or something else that is more reliable than a hard drive partition number.