solandr: Até o momento, nada mudou fundamentalmente. A mesma discrepância nos resultados de execuções simultâneas em todos os pares. Vou investigar mais.
Ou seja, o resultado é o seguinte: a lista de negócios coincide absolutamente em qualquer modo de teste - tanto para todos os pares quanto ao testar apenas um par. Apenas os momentos de troca do controle de equilíbrio não coincidem?
Dima_S: Ou seja, verifica-se que a lista de negócios é absolutamente a mesma em qualquer modo de teste - tanto para todos os pares quanto ao testar apenas um par. Apenas os momentos de troca de controle de equilíbrio não coincidem?
Sim.
Isso é o que eu já descobri hoje.
Entrei no includnik e comecei a colocar impressões em lugares interessantes, e foi isso que descobri ao executar mais de um par. Normalmente, os dados são mais ou menos adequados, mas às vezes os dados individuais da matriz voam para o céu. De onde isso pode acontecer? Abaixo está a variante de trabalho com o parâmetro de transações igual a 15:
A propósito, acabei de encontrar o efeito acima ao testar em um dos pares. Parece que em algum lugar algo não está zerado ou acessa a área com dados incorretos já existentes. Como isso pode ser detectado e eliminado? Acho que precisamos reforçar o controle dos dados que entram nas matrizes. Como fazer isso?
A propósito, acabei de encontrar o efeito acima ao testar em um dos pares. Parece que em algum lugar algo não está zerado ou acessa a área com dados incorretos já existentes. Como isso pode ser detectado e eliminado? Acho que precisamos reforçar o controle dos dados que entram nas matrizes. Como você faz isso?
Sim, parece ser esse o caso. Vou dar uma olhada nisso neste fim de semana. Interessante também)
Encontrei um lugar no includnik "onde o cachorro está no buraco"! A classificação da matriz está com problemas. Inseri a impressão antes e depois da classificação:
//MEU CHEQUEfor( index = 0; index < count; index++ )
{
Print("BEFORE SORTING org_result_array[",index,"]=",org_result_array[ index ]," this.org_datetime_array[",index,"]=",this.org_datetime_array[ index ]);
}
// Ordenar a matriz "bruta" por data/hora do fechamento do pedido:
SortMasterSlaveArray( this.org_datetime_array, this.org_result_array );
//MEU CHEQUEfor( index = 0; index < count; index++ )
{
Print("AFTER SORTING org_result_array[",index,"]=",org_result_array[ index ]," this.org_datetime_array[",index,"]=",this.org_datetime_array[ index ]);
}
Aqui está o resultado que apareceu ao testar UM dos pares:
MQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[0]=-279.9 this.org_datetime_array[0]=22307921.0 QQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[1]=-275.4 this.org_datetime_array[1]=22307227.0 QR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[2]=-302.5 this.org_datetime_array[2]=22289679.0 QR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[3]=-281.4999999999999 this.org_datetime_array[3]=22287959.0 PQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[4]=-274.4 this.org_datetime_array[4]=22276174.0 PR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[5]=-323.9999999999999 this.org_datetime_array[5]=22276026.0 IP 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[6]=5354.0 this.org_datetime_array[6]=22269123.0 MQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[7]=-249.0 this.org_datetime_array[7]=22196301.0 GR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[8]=-249.0 this.org_datetime_array[8]=22196242.0 GR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[9]=-250.0 this.org_datetime_array[9]=22195632.0 GS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[10]=-249.0 this.org_datetime_array[10]=22195447.0 NS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[11]=-249.0 this.org_datetime_array[11]=22195279.0 DS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[12]=-249.0 this.org_datetime_array[12]=22194812.0 QS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[13]=-250.0 this.org_datetime_array[13]=22194448.0 OL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[14]=-249.0 this.org_datetime_array[14]=22193876.0 OL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[15]=-315.0 this.org_datetime_array[15]=22188593.0 EL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[16]=-249.0 this.org_datetime_array[16]=22188401.0 LL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[17]=-249.0 this.org_datetime_array[17]=22188390.0 KM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[18]=-318.0 this.org_datetime_array[18]=22178692.0 NM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[19]=-250.0 this.org_datetime_array[19]=22171680.0 QM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[20]=-249.0 this.org_datetime_array[20]=22168711.0 OM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[21]=-250.0 this.org_datetime_array[21]=22168595.0 KN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[22]=-248.9 this.org_datetime_array[22]=22168313.0 CN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[23]=-249.5 this.org_datetime_array[23]=22167843.0 PN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[24]=-249.0 this.org_datetime_array[24]=22165238.0 FN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[25]=-249.6 this.org_datetime_array[25]=22165036.0 MO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[26]=-271.0 this.org_datetime_array[26]=22164783.0 GO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[27]=-256.0 this.org_datetime_array[27]=22161600.0 QO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[28]=-249.0 this.org_datetime_array[28]=22158602.0 OO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[29]=-250.0 this.org_datetime_array[29]=22158129.0 PH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[30]=-249.0 this.org_datetime_array[30]=22157426.0 MH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[31]=-249.0 this.org_datetime_array[31]=22156983.0 KH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[32]=-249.0 this.org_datetime_array[32]=22156408.0 FH 0 Core 1 13:48:51 2012.05.05.31 14:41:59 BEFORE SORTING org_result_array[33]=-249.0 this.org_datetime_array[33]=22154526.0 EI 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[34]=-249.0 this.org_datetime_array[34]=22153931.0 PI 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[35]=-271.0 this.org_datetime_array[35]=22153579.0 MH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[36]=2387.0 this.org_datetime_array[36]=22153263.0 KI 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[37]=-274.0 this.org_datetime_array[37]=22135056.0 DJ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[38]=-273.0 this.org_datetime_array[38]=22132446.0 FJ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[39]=-277.0 this.org_datetime_array[39]=22132307.0 DJ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[40]=-597.0 this.org_datetime_array[40]=22093229.0 NG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[0]=-279.9 this.org_datetime_array[0]=22307921.0 DF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[1]=-275.4 this.org_datetime_array[1]=22307227.0 FI 0 FI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[2]=-302.5 this.org_datetime_array[2]=22289679.0 HI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[3]=-281.4999999999999 this.org_datetime_array[3]=22287959.0 GF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[4]=-274.4 this.org_datetime_array[4]=22276174.0 MI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[5]=-323.9999999999999 this.org_datetime_array[5]=22276026.0 FG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[6]=5354.0 this.org_datetime_array[6]=22269123.0 GG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[7]=1.61390681602331e+116 this.org_datetime_array[7]=22269123.0 PF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[8]=-249.0 this.org_datetime_array[8]=22196301.0 PK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[9]=7.86951818189098558e-151 this.org_datetime_array[9]=22196301.0 RG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[10]=-249.0 this.org_datetime_array[10]=22196242.0 LG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[11]=-250.0 this.org_datetime_array[11]=22195632.0 NF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[12]=-249.0 this.org_datetime_array[12]=22195447.0 IF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[13]=-249.0 this.org_datetime_array[13]=22195279.0 MF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[14]=-249.0 this.org_datetime_array[14]=22194812.0 RI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[15]=-250.0 this.org_datetime_array[15]=22194448.0 NI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[16]=-249.0 this.org_datetime_array[16]=22193876.0 LI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[17]=-315.0 this.org_datetime_array[17]=22188593.0 DH 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[18]=-249.0 this.org_datetime_array[18]=22188401.0 CH 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[19]=-249.0 this.org_datetime_array[19]=22188390.0 JK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[20]=-318.0 this.org_datetime_array[20]=22178692.0 IK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[21]=-250.0 this.org_datetime_array[21]=22171680.0 HK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[22]=-249.0 this.org_datetime_array[22]=22168711.0 PJ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[23]=-250.0 this.org_datetime_array[23]=22168595.0 RJ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[24]=-248.9 this.org_datetime_array[24]=22168313.0 HJ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[25]=-249.5 this.org_datetime_array[25]=22167843.0 QM 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[26]=-249.0 this.org_datetime_array[26]=22165238.0 MM 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[27]=-249.6 this.org_datetime_array[27]=22165036.0 HL 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[28]=-271.0 this.org_datetime_array[28]=22164783.0 LL 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[29]=-256.0 this.org_datetime_array[29]=22161600.0 HL 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[30]=-249.0 this.org_datetime_array[30]=22158602.0 PO 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[31]=-250.0 this.org_datetime_array[31]=22158129.0 MO 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[32]=-249.0 this.org_datetime_array[32]=22157426.0 RO 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[33]=-249.0 this.org_datetime_array[33]=22156983.0 NN 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[34]=-249.0 this.org_datetime_array[34]=22156408.0 MN 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[35]=-249.0 this.org_datetime_array[35]=22154526.0 PQ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[36]=-249.0 this.org_datetime_array[36]=22153931.0 CQ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[37]=-271.0 this.org_datetime_array[37]=22153579.0 DP 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[38]=2387.0 this.org_datetime_array[38]=22153263.0 LP 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[39]=-274.0 this.org_datetime_array[39]=22135056.0 IP 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[40]=-273.0 this.org_datetime_array[40]=22132446.0
YAY!!! Consegui resolver o problema! O problema era a transferência incorreta da matriz como um elemento de objeto por referência para a função de classificação. Se você primeiro copiar a matriz de objetos em uma matriz regular e depois transferir essa matriz temporária para a função de classificação, não ocorrerão falhas inesperadas. Os dados nas matrizes não voam para o céu e todas as trocas de lote coincidem. Além disso, o saldo final em uma execução conjunta de pares de moedas coincide quase completamente (as diferenças são microscópicas). Abaixo estão os resultados dos testes e o código que uso para eliminar a falha. (Observe que os dados atuais são diferentes, mesmo em execuções únicas no primeiro par, dos dados que foram obtidos antes da correção do código)
Com o controle de lote ativado 34 0 0 0 6487,33 primeiro par 0 36 0 5556,60 segundo par 0 0 0 168 4374,44 terceiro par 34 36 168 16418,47 todos os três pares soma do saldo nos três pares 16418,37 (diferença com a execução conjunta 0,1)
Com o controle de lote desligado 0 0 0 0 6702.44 primeiro par 0 0 0 0 5742.89 segundo par 0 0 0 0 4358.22 terceiro par 0 0 0 0 16804.53 todos os três pares soma do saldo em três pares 16803.55 (Diferença com a execução conjunta 0.98).
double temp_array1[],temp_array2[];
ArrayResize(temp_array1,count);
ArrayResize(temp_array2,count);
for( index = 0; index < count; index++ )
{
temp_array1[index]=this.org_datetime_array[index];
temp_array2[index]=this.org_result_array[index];
}
// Ordenar a matriz "bruta" por data/hora do fechamento do pedido://SortMasterSlaveArray( this.org_datetime_array, this.org_result_array ); - esse código nem sempre funciona corretamente
SortMasterSlaveArray(temp_array1,temp_array2);
for( index = 0; index < count; index++ )
{
this.org_datetime_array[index]=temp_array1[index];
this.org_result_array[index]=temp_array2[index];
}
Por favor, altere o includnik no artigo, para que outras pessoas não tenham que quebrar a cabeça por dias com testes divergentes. Obrigado!
Caros desenvolvedores do MT5, gostaria de chamar sua atenção para um problema inesperado detectado durante os testes no MT5 Build 695 (6 de setembro de 2012, Championship Terminal-2012, Conta: 1101505, Servidor: MetaQuotes-Demo) em execução no Windows 7 Enterprise (licenciado, inglês). O problema é a distorção inexplicável dos dados (matriz como um elemento de objeto) passados por referência à função de classificação.
Em anexo estão as fontes dos códigos-fonte ORIGINAL (com erro) e CORRIGIDO (sem erro), bem como os arquivos de registro do trabalho do Expert Advisor, demonstrando o trabalho de ambas as variantes de código. O erro com distorção de dados é reproduzido de forma estável sob as mesmas condições de teste especificadas. Por favor, preste atenção aos registros de 2012.02.24 08:03:40 (os dados da matriz estão misturados) e 2012.05.31 14:41:59 (os dados "voaram para o céu").
Caros desenvolvedores do MT5, gostaria de chamar sua atenção para um problema inesperado detectado durante os testes no MT5 Build 695 (6 de setembro de 2012, Championship Terminal-2012, Conta: 1101505, Servidor: MetaQuotes-Demo) em execução no Windows 7 Enterprise (licenciado, inglês). O problema é a distorção inexplicável dos dados (matriz como um elemento de objeto) passados por referência à função de classificação.
Em anexo estão as fontes dos códigos-fonte ORIGINAL (com erro) e CORRIGIDO (sem erro), bem como os arquivos de registro do trabalho do Expert Advisor, demonstrando o trabalho de ambas as variantes de código. O erro com distorção de dados é reproduzido de forma estável sob as mesmas condições de teste especificadas. Por favor, preste atenção aos registros de 2012.02.24 08:03:40 (os dados da matriz estão misturados) e 2012.05.31 14:41:59 (os dados "voaram para o céu").
Muito obrigado!
Conclusão.
Erro do lado do usuário na função GetTradeResultsArray.
Uma matriz dinâmica com X dados é preparada, mas é preenchida com N (N<X), por exemplo, se houver uma negociação com magia "alienígena".
Antes da classificação, N dados são enviados, mas X está envolvido na classificação, é claro que os dados X-N são números aleatórios na memória. Dependendo do valor, eles são "levantados" durante a classificação e enviados para o registro após a classificação.
Solução: 1) "Aparar" a matriz após preenchê-la com N 2) Passar N para a função de classificação 3) Inicializar a matriz X com dados obviamente grandes/pequenos, que serão deixados "ao mar" após a classificação.
Vamos ver o quanto essas alterações podem afetar o EA
Até o momento, nada mudou fundamentalmente. A mesma discrepância nos resultados de execuções simultâneas em todos os pares. Vou investigar mais.
Ou seja, verifica-se que a lista de negócios é absolutamente a mesma em qualquer modo de teste - tanto para todos os pares quanto ao testar apenas um par. Apenas os momentos de troca de controle de equilíbrio não coincidem?
Sim.
Isso é o que eu já descobri hoje.
Entrei no includnik e comecei a colocar impressões em lugares interessantes, e foi isso que descobri ao executar mais de um par. Normalmente, os dados são mais ou menos adequados, mas às vezes os dados individuais da matriz voam para o céu. De onde isso pode acontecer? Abaixo está a variante de trabalho com o parâmetro de transações igual a 15:
2012.08.08 15:03:00 this.group_result_array[0]=3.105036941761521e+231
ER 0 Core 1 12:09:30 2012.08.08 08 15:03:00 this.group_result_array[1]=497.9999999999999
JG 0 Core 1 12:09:30 2012.08.08.08.08 15:03:00 this.group_result_array[2]=-1447.0
ON 0 Core 1 12:09:30 2012.08.08.08 15:03:00 this.group_result_array[3]=-75.0
ND 0 Core 1 12:09:30 2012.08.08.08.08 15:03:00 this.group_result_array[4]=-1173.0
DH 0 Core 1 12:09:30 2012.08.08 15:03:00 this.group_result_array[5]=4697.0
GS 0 Core 1 12:09:30 2012.08.08.08.08 15:03:00 this.group_result_array[6]=-56.99999999999999
DD 0 Core 1 12:09:30 2012.08.08.08 15:03:00 this.group_result_array[7]=187.0
JH 0 Core 1 12:09:30 2012.08.08.08 15:03:00 this.group_result_array[8]=-914.0
HQ 0 Core 1 12:09:30 2012.08.08 15:03:00 this.group_result_array[9]=-982.0
MJ 0 Core 1 12:09:30 2012.08.08.08 15:03:00 this.group_result_array[10]=805.0
GL 0 Core 1 12:09:30 2012.08.08 15:03:00 this.group_result_array[11]=385.0
ID 0 Core 1 12:09:30 2012.08.08.08 15:03:00 this.group_result_array[12]=-798.0
DJ 0 Core 1 12:09:30 2012.08.08 15:03:00 this.group_result_array[13]=1561.0
FR 0 Core 1 12:09:30 2012.08.08.08 15:03:00 X[0]=22183803.0 Y[0]=1561.0
FH 0 Core 1 12:09:30 2012.08.08 15:03:00 X[1]=22186960.0 Y[1]=763.0
GL 0 Core 1 12:09:30 2012.08.08.08 15:03:00 X[2]=22197303.0 Y[2]=1148.0
RE 0 Core 1 12:09:30 2012.08.08 15:03:00 X[3]=22207443.0 Y[3]=1953.0
OM 0 Core 1 12:09:30 2012.08.08.08 15:03:00 X[4]=22212063.0 Y[4]=971.0
MG 0 Core 1 12:09:30 2012.08.08.08 15:03:00 X[5]=22225383.0 Y[5]=57.0
FK 0 Core 1 12:09:30 2012.08.08 08 15:03:00 X[6]=22248723.0 Y[6]=244.0
QR 0 Core 1 12:09:30 2012.08.08 08 15:03:00 X[7]=22265943.0 Y[7]=187.0
MJ 0 Core 1 12:09:30 2012.08.08 15:03:00 X[8]=22335543.0 Y[8]=4884.0
JS 0 Core 1 12:09:30 2012.08.08 15:03:00 X[9]=22338363.0 Y[9]=3711.0
JD 0 Core 1 12:09:30 2012.08.08 15:03:00 X[10]=22349163.0 Y[10]=3636.0
OM 0 Core 1 12:09:30 2012.08.08 15:03:00 X[11]=22358283.0 Y[11]=2189.0
FF 0 Core 1 12:09:30 2012.08.08 15:03:00 X[12]=22400283.0 Y[12]=2687.0
GS 0 Core 1 12:09:30 2012.08.08 15:03:00 X[13]=22407303.0 Y[13]=3.105036941761521e+231
NL 0 Core 1 12:09:30 2012.08.08.08.08 15:03:00 var_0=3.960436915196813e+236 var_1=86864140528.35715
RD 0 Core 1 12:09:30 2012.08.08.08 15:03:00 this.current_slope=4.559346228613075e+225
A propósito, acabei de encontrar o efeito acima ao testar em um dos pares. Parece que em algum lugar algo não está zerado ou acessa a área com dados incorretos já existentes. Como isso pode ser detectado e eliminado? Acho que precisamos reforçar o controle dos dados que entram nas matrizes. Como fazer isso?
2012.05.31 14:41:59 this.group_result_array[0]=-279.9
PF 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[1]=-275.4
MH 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[2]=-302.5
OQ 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[3]=-281.4999999999999
PE 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[4]=-274.4
QN 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[5]=-323.9999999999999
LL 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[6]=1.61390681602331e+116
QE 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[7]=-249.0
PO 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[8]=-249.0
CQ 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[9]=-250.0
OI 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[10]=-249.0
RO 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[11]=-249.0
ME 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[12]=-249.0
DK 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[13]=-250.0
CQ 0 Core 1 12:48:50 2012.05.31 14:41:59 this.group_result_array[14]=-249.0
IE 0 Core 1 12:48:50 2012.05.31 14:41:59 X[0]=22193876.0 Y[0]=-249.0
NL 0 Core 1 12:48:50 2012.05.31 14:41:59 X[1]=22194448.0 Y[1]=-499.0
JG 0 Core 1 12:48:50 2012.05.31 14:41:59 X[2]=22194812.0 Y[2]=-748.0
PN 0 Core 1 12:48:50 2012.05.31 14:41:59 X[3]=22195279.0 Y[3]=-997.0
CR 0 Core 1 12:48:50 2012.05.31 14:41:59 X[4]=22195447.0 Y[4]=-1246.0
LK 0 Core 1 12:48:50 2012.05.31 14:41:59 X[5]=22195632.0 Y[5]=-1496.0
MP 0 Core 1 12:48:50 2012.05.31 14:41:59 X[6]=22196242.0 Y[6]=-1745.0
OI 0 Core 1 12:48:50 2012.05.31 14:41:59 X[7]=22196301.0 Y[7]=-1994.0
PS 0 Core 1 12:48:50 2012.05.31 14:41:59 X[8]=22269123.0 Y[8]=1.61390681602331e+116
DH 0 Core 1 12:48:50 2012.05.31 14:41:59 X[9]=22276026.0 Y[9]=1.61390681602331e+116
HE 0 Core 1 12:48:50 2012.05.31 14:41:59 X[10]=22276174.0 Y[10]=1.61390681602331e+116
QR 0 Core 1 12:48:50 2012.05.31 14:41:59 X[11]=22287959.0 Y[11]=1.61390681602331e+116
NO 0 Core 1 12:48:50 2012.05.31 14:41:59 X[12]=22289679.0 Y[12]=1.61390681602331e+116
DD 0 Core 1 12:48:50 2012.05.31 14:41:59 X[13]=22307227.0 Y[13]=1.61390681602331e+116
EP 0 Core 1 12:48:50 2012.05.31 14:41:59 X[14]=22307921.0 Y[14]=1.61390681602331e+116
HM 0 Core 1 12:48:50 2012.05.05.31 14:41:59 var_0=5.571865878831281e+121 var_1=33339632014.93333
HE 0 Core 1 12:48:50 2012.05.31 14:41:59 this.current_slope=1.671243964641108e+111
A propósito, acabei de encontrar o efeito acima ao testar em um dos pares. Parece que em algum lugar algo não está zerado ou acessa a área com dados incorretos já existentes. Como isso pode ser detectado e eliminado? Acho que precisamos reforçar o controle dos dados que entram nas matrizes. Como você faz isso?
Encontrei um lugar no includnik "onde o cachorro está no buraco"! A classificação da matriz está com problemas. Inseri a impressão antes e depois da classificação:
Aqui está o resultado que apareceu ao testar UM dos pares:
MQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[0]=-279.9 this.org_datetime_array[0]=22307921.0
QQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[1]=-275.4 this.org_datetime_array[1]=22307227.0
QR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[2]=-302.5 this.org_datetime_array[2]=22289679.0
QR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[3]=-281.4999999999999 this.org_datetime_array[3]=22287959.0
PQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[4]=-274.4 this.org_datetime_array[4]=22276174.0
PR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[5]=-323.9999999999999 this.org_datetime_array[5]=22276026.0
IP 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[6]=5354.0 this.org_datetime_array[6]=22269123.0
MQ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[7]=-249.0 this.org_datetime_array[7]=22196301.0
GR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[8]=-249.0 this.org_datetime_array[8]=22196242.0
GR 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[9]=-250.0 this.org_datetime_array[9]=22195632.0
GS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[10]=-249.0 this.org_datetime_array[10]=22195447.0
NS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[11]=-249.0 this.org_datetime_array[11]=22195279.0
DS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[12]=-249.0 this.org_datetime_array[12]=22194812.0
QS 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[13]=-250.0 this.org_datetime_array[13]=22194448.0
OL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[14]=-249.0 this.org_datetime_array[14]=22193876.0
OL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[15]=-315.0 this.org_datetime_array[15]=22188593.0
EL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[16]=-249.0 this.org_datetime_array[16]=22188401.0
LL 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[17]=-249.0 this.org_datetime_array[17]=22188390.0
KM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[18]=-318.0 this.org_datetime_array[18]=22178692.0
NM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[19]=-250.0 this.org_datetime_array[19]=22171680.0
QM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[20]=-249.0 this.org_datetime_array[20]=22168711.0
OM 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[21]=-250.0 this.org_datetime_array[21]=22168595.0
KN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[22]=-248.9 this.org_datetime_array[22]=22168313.0
CN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[23]=-249.5 this.org_datetime_array[23]=22167843.0
PN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[24]=-249.0 this.org_datetime_array[24]=22165238.0
FN 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[25]=-249.6 this.org_datetime_array[25]=22165036.0
MO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[26]=-271.0 this.org_datetime_array[26]=22164783.0
GO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[27]=-256.0 this.org_datetime_array[27]=22161600.0
QO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[28]=-249.0 this.org_datetime_array[28]=22158602.0
OO 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[29]=-250.0 this.org_datetime_array[29]=22158129.0
PH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[30]=-249.0 this.org_datetime_array[30]=22157426.0
MH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[31]=-249.0 this.org_datetime_array[31]=22156983.0
KH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[32]=-249.0 this.org_datetime_array[32]=22156408.0
FH 0 Core 1 13:48:51 2012.05.05.31 14:41:59 BEFORE SORTING org_result_array[33]=-249.0 this.org_datetime_array[33]=22154526.0
EI 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[34]=-249.0 this.org_datetime_array[34]=22153931.0
PI 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[35]=-271.0 this.org_datetime_array[35]=22153579.0
MH 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[36]=2387.0 this.org_datetime_array[36]=22153263.0
KI 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[37]=-274.0 this.org_datetime_array[37]=22135056.0
DJ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[38]=-273.0 this.org_datetime_array[38]=22132446.0
FJ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[39]=-277.0 this.org_datetime_array[39]=22132307.0
DJ 0 Core 1 13:48:51 2012.05.31 14:41:59 BEFORE SORTING org_result_array[40]=-597.0 this.org_datetime_array[40]=22093229.0
NG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[0]=-279.9 this.org_datetime_array[0]=22307921.0
DF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[1]=-275.4 this.org_datetime_array[1]=22307227.0
FI 0 FI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[2]=-302.5 this.org_datetime_array[2]=22289679.0
HI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[3]=-281.4999999999999 this.org_datetime_array[3]=22287959.0
GF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[4]=-274.4 this.org_datetime_array[4]=22276174.0
MI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[5]=-323.9999999999999 this.org_datetime_array[5]=22276026.0
FG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[6]=5354.0 this.org_datetime_array[6]=22269123.0
GG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[7]=1.61390681602331e+116 this.org_datetime_array[7]=22269123.0
PF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[8]=-249.0 this.org_datetime_array[8]=22196301.0
PK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[9]=7.86951818189098558e-151 this.org_datetime_array[9]=22196301.0
RG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[10]=-249.0 this.org_datetime_array[10]=22196242.0
LG 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[11]=-250.0 this.org_datetime_array[11]=22195632.0
NF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[12]=-249.0 this.org_datetime_array[12]=22195447.0
IF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[13]=-249.0 this.org_datetime_array[13]=22195279.0
MF 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[14]=-249.0 this.org_datetime_array[14]=22194812.0
RI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[15]=-250.0 this.org_datetime_array[15]=22194448.0
NI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[16]=-249.0 this.org_datetime_array[16]=22193876.0
LI 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[17]=-315.0 this.org_datetime_array[17]=22188593.0
DH 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[18]=-249.0 this.org_datetime_array[18]=22188401.0
CH 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[19]=-249.0 this.org_datetime_array[19]=22188390.0
JK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[20]=-318.0 this.org_datetime_array[20]=22178692.0
IK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[21]=-250.0 this.org_datetime_array[21]=22171680.0
HK 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[22]=-249.0 this.org_datetime_array[22]=22168711.0
PJ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[23]=-250.0 this.org_datetime_array[23]=22168595.0
RJ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[24]=-248.9 this.org_datetime_array[24]=22168313.0
HJ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[25]=-249.5 this.org_datetime_array[25]=22167843.0
QM 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[26]=-249.0 this.org_datetime_array[26]=22165238.0
MM 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[27]=-249.6 this.org_datetime_array[27]=22165036.0
HL 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[28]=-271.0 this.org_datetime_array[28]=22164783.0
LL 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[29]=-256.0 this.org_datetime_array[29]=22161600.0
HL 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[30]=-249.0 this.org_datetime_array[30]=22158602.0
PO 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[31]=-250.0 this.org_datetime_array[31]=22158129.0
MO 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[32]=-249.0 this.org_datetime_array[32]=22157426.0
RO 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[33]=-249.0 this.org_datetime_array[33]=22156983.0
NN 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[34]=-249.0 this.org_datetime_array[34]=22156408.0
MN 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[35]=-249.0 this.org_datetime_array[35]=22154526.0
PQ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[36]=-249.0 this.org_datetime_array[36]=22153931.0
CQ 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[37]=-271.0 this.org_datetime_array[37]=22153579.0
DP 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[38]=2387.0 this.org_datetime_array[38]=22153263.0
LP 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[39]=-274.0 this.org_datetime_array[39]=22135056.0
IP 0 Core 1 13:48:51 2012.05.31 14:41:59 AFTER SORTING org_result_array[40]=-273.0 this.org_datetime_array[40]=22132446.0
YAY!!! Consegui resolver o problema! O problema era a transferência incorreta da matriz como um elemento de objeto por referência para a função de classificação.
Se você primeiro copiar a matriz de objetos em uma matriz regular e depois transferir essa matriz temporária para a função de classificação, não ocorrerão falhas inesperadas. Os dados nas matrizes não voam para o céu e todas as trocas de lote coincidem. Além disso, o saldo final em uma execução conjunta de pares de moedas coincide quase completamente (as diferenças são microscópicas).
Abaixo estão os resultados dos testes e o código que uso para eliminar a falha. (Observe que os dados atuais são diferentes, mesmo em execuções únicas no primeiro par, dos dados que foram obtidos antes da correção do código)
solandr 2012.09.26 23:16 2012.09.26 23:16:04 # )
Com o controle de lote ativado
34 0 0 0 6487,33 primeiro par
0 36 0 5556,60 segundo par
0 0 0 168 4374,44 terceiro par
34 36 168 16418,47 todos os três pares
soma do saldo nos três pares 16418,37 (diferença com a execução conjunta 0,1)
Com o controle de lote desligado
0 0 0 0 6702.44 primeiro par
0 0 0 0 5742.89 segundo par
0 0 0 0 4358.22 terceiro par
0 0 0 0 16804.53 todos os três pares
soma do saldo em três pares 16803.55 (Diferença com a execução conjunta 0.98).
Por favor, altere o includnik no artigo, para que outras pessoas não tenham que quebrar a cabeça por dias com testes divergentes. Obrigado!
Na minha opinião, você deveria escrever para o service-desk em vez de alterar o incluidor.
Não deveria ser assim. E a cópia desnecessária é desnecessária, de todos os pontos de vista. E, em geral, você é bom!
Dê a si mesmo uma avaliação positiva por meio do service-desk)))
Mensagem para a equipe do MQ:
Caros desenvolvedores do MT5, gostaria de chamar sua atenção para um problema inesperado detectado durante os testes no MT5 Build 695 (6 de setembro de 2012, Championship Terminal-2012, Conta: 1101505, Servidor: MetaQuotes-Demo) em execução no Windows 7 Enterprise (licenciado, inglês). O problema é a distorção inexplicável dos dados (matriz como um elemento de objeto) passados por referência à função de classificação.
Em anexo estão as fontes dos códigos-fonte ORIGINAL (com erro) e CORRIGIDO (sem erro), bem como os arquivos de registro do trabalho do Expert Advisor, demonstrando o trabalho de ambas as variantes de código. O erro com distorção de dados é reproduzido de forma estável sob as mesmas condições de teste especificadas. Por favor, preste atenção aos registros de 2012.02.24 08:03:40 (os dados da matriz estão misturados) e 2012.05.31 14:41:59 (os dados "voaram para o céu").
Muito obrigado!
Mensagem para a equipe MQ:
Caros desenvolvedores do MT5, gostaria de chamar sua atenção para um problema inesperado detectado durante os testes no MT5 Build 695 (6 de setembro de 2012, Championship Terminal-2012, Conta: 1101505, Servidor: MetaQuotes-Demo) em execução no Windows 7 Enterprise (licenciado, inglês). O problema é a distorção inexplicável dos dados (matriz como um elemento de objeto) passados por referência à função de classificação.
Em anexo estão as fontes dos códigos-fonte ORIGINAL (com erro) e CORRIGIDO (sem erro), bem como os arquivos de registro do trabalho do Expert Advisor, demonstrando o trabalho de ambas as variantes de código. O erro com distorção de dados é reproduzido de forma estável sob as mesmas condições de teste especificadas. Por favor, preste atenção aos registros de 2012.02.24 08:03:40 (os dados da matriz estão misturados) e 2012.05.31 14:41:59 (os dados "voaram para o céu").
Muito obrigado!
Erro do lado do usuário na função GetTradeResultsArray.
Uma matriz dinâmica com X dados é preparada, mas é preenchida com N (N<X), por exemplo, se houver uma negociação com magia "alienígena".
Antes da classificação, N dados são enviados, mas X está envolvido na classificação, é claro que os dados X-N são números aleatórios na memória.
Dependendo do valor, eles são "levantados" durante a classificação e enviados para o registro após a classificação.
Solução:
1) "Aparar" a matriz após preenchê-la com N
2) Passar N para a função de classificação
3) Inicializar a matriz X com dados obviamente grandes/pequenos, que serão deixados "ao mar" após a classificação.