Errores, fallos, preguntas - página 1579

 
Dennis Kirichenko:

Mira la función PrintFormat(). En su caso, es mejor utilizarlo.

Entonces es así:

La parsimonia manda :-)

Probé el código, obtuve ceros

2016.05.12 00:41:43.336 Info_SymbolList AUDJPY,M15: symbolName=AUDJPY, ATR_D_1001=0.0000

 
Dennis Kirichenko:

Intenta escribir sólo variables de cadena en el archivo.

Es así:

todas las variables se escriben normalmente, exceptoATR_D_1000 , esto no está claro...
 
-Aleks-:
todas las variables se escriben normalmente, exceptoATR_D_1000 , no está claro...

G probarlo así

FileWrite(handle,symbolName);
FileWrite(handle,MarketInfo(symbolName,MODE_SPREAD));
FileWrite(handle,MarketInfo(symbolName,MODE_MINLOT));
FileWrite(handle,MarketInfo(symbolName,MODE_MARGINREQUIRED)*MarketInfo(symbolName,MODE_MINLOT));
FileWrite(handle,MarketInfo(symbolName,MODE_TICKVALUE)*MarketInfo(symbolName,MODE_MINLOT)*100);
FileWrite(handle,MarketInfo(symbolName,MODE_STOPLEVEL));
FileWrite(handle,str2);
FileWrite(handle,ATR_D_1000);
FileWrite(handle,ATR_M15_9600)
FileWrite(handle,iBars(symbolName,1440));
FileWrite(handle,iBars(symbolName,15));
 
Sergey Gritsay:

G Prueba esto

Gracias, lo probaré. Pero, si la variableATR_D_1000 no se imprime, ¿cómo podemos esperar que se escriba?
 
-Aleks-:
Gracias, lo intentaré. Pero, si la variableATR_D_1000 no se imprime, ¿cómo podemos esperar que se escriba?
D Se imprimirá. Lo más probable es que el problema esté en la paginación del historial, porque 1000 barras de días es bastante grande, el indicador tarda mucho en calcular en la primera ejecución, luego todo es normal
0       18:17:32.387    Script test_1 USDCHF,H1: loaded successfully
0       18:17:35.135    test_1 USDCHF,H1 inputs: Start=1463014800; End=1463025600; 
0       18:17:40.219    test_1 USDCHF,H1: initialized
0       18:17:55.643    test_1 USDCHF,H1: ATR_D_1000=0.0
0       18:17:55.643    test_1 USDCHF,H1:  symbolName=USDCHF ATR_D_1001=0.0
0       18:17:55.643    test_1 USDCHF,H1: uninit reason 0
0       18:17:55.644    Script test_1 USDCHF,H1: removed
0       18:20:26.749    Script test_1 USDCHF,H1: loaded successfully
0       18:20:33.592    test_1 USDCHF,H1: initialized
0       18:20:33.593    test_1 USDCHF,H1: ATR_D_1000=0.008878300000000023
0       18:20:33.593    test_1 USDCHF,H1:  symbolName=USDCHF ATR_D_1001=0.008878300000000023
0       18:20:33.593    test_1 USDCHF,H1: uninit reason 0
0       18:20:33.594    Script test_1 USDCHF,H1: removed
0       18:21:48.047    Script test_1 USDCHF,Daily: loaded successfully
0       18:21:53.155    test_1 USDCHF,Daily: initialized
0       18:21:53.155    test_1 USDCHF,Daily: ATR_D_1000=0.008468200000000019
0       18:21:53.155    test_1 USDCHF,Daily:  symbolName=USDCHF ATR_D_1001=0.008468200000000019
0       18:21:53.156    test_1 USDCHF,Daily: uninit reason 0
0       18:21:53.157    Script test_1 USDCHF,Daily: removed
0       18:22:13.167    Script test_1 USDCHF,H4: loaded successfully
0       18:22:19.313    test_1 USDCHF,H4: initialized
0       18:22:19.313    test_1 USDCHF,H4: ATR_D_1000=0.008468200000000019
0       18:22:19.313    test_1 USDCHF,H4:  symbolName=USDCHF ATR_D_1001=0.008468200000000019
0       18:22:19.313    test_1 USDCHF,H4: uninit reason 0
0       18:22:19.314    Script test_1 USDCHF,H4: removed
0       18:22:26.488    Script test_1 USDCHF,H1: loaded successfully
0       18:22:32.343    test_1 USDCHF,H1: initialized
0       18:22:32.344    test_1 USDCHF,H1: ATR_D_1000=0.008468200000000019
0       18:22:32.344    test_1 USDCHF,H1:  symbolName=USDCHF ATR_D_1001=0.008468200000000019
0       18:22:32.344    test_1 USDCHF,H1: uninit reason 0
0       18:22:32.345    Script test_1 USDCHF,H1: removed
 
Sergey Gritsay:
D Todo se imprime. Lo más probable es que el problema esté en la carga del historial, porque 1000 barras de un día es bastante grande, el indicador tarda mucho en calcular en la primera ejecución, luego todo es normal.
¿Cuál es el código, puedes adjuntar el script? No consigo que se mueva, gracias.
 
-Aleks-:
¿Cuál es el código, puedes adjuntar un script? No consigo que se mueva, gracias.
Es el mismo que el tuyo.
//+------------------------------------------------------------------+
//|                                                       test_1.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {

   double ATR_D_1000=0;

   string symbolName=_Symbol;

   ATR_D_1000=iATR(symbolName,1440,1000,1);

   Print("ATR_D_1000=",ATR_D_1000);

   Print(" symbolName=",symbolName," ATR_D_1001=",iATR(symbolName,1440,1000,1));
  }
//+------------------------------------------------------------------+
 

Fallo en la carga de EX5 (en ejecución)

typedef void (*fn)();
fn GP( fn f ) { return f; }
void OnStart2() { Print( __FUNCSIG__ ); }
void OnStart()
{
        Print( GP( OnStart2 ));
}

por lo demás - bien

void OnStart()
{
        Print( GP( OnStart ));
}
 
si la función de ticket de pedido devuelve un valor de tipo int, ¿qué ocurre cuando llegamos a un límite máximo, por ejemplo, ahora tenemos números de ticket de 9 dígitos, hay un límite máximo de 10 dígitos? o ¿el corredor reiniciará el contador de pedidos?
 
Sergey Gritsay:
igual que el tuyo.
Gracias, he encontrado un error en el código.