Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
Por quê?
string symbol_name, // имя символа
MqlTick& ticks_array[], // массив для приёма тиков
uint flags=COPY_TICKS_ALL, // флаг, определяющий тип получаемых тиков
ulong from=0, // дата, начиная с которой запрашиваются тики
uint count=0 // количество тиков, которые необходимо получить
);
string symbol_name, // имя символа
MqlTick& ticks_array[], // массив для приёма тиков
uint flags=COPY_TICKS_ALL, // флаг, определяющий тип получаемых тиков
ulong from=0, // дата, начиная с которой запрашиваются тики
uint count=0 // количество тиков, которые необходимо получить
);
string symbol_name, // имя символа
MqlTick& ticks_array[], // массив для приёма тиков
uint flags=COPY_TICKS_ALL, // флаг, определяющий тип получаемых тиков
ulong from=0, // дата, начиная с которой запрашиваются тики
uint count=0 // количество тиков, которые необходимо получить
);
Sim, o tamanho dos carrapatos no cache pode ser alocado explicitamente na documentação. Se você quiser obter o cache completo - olhe a documentação e peça o número necessário com a função, com parâmetros como aqui:
intCopyBuffer(
intindicator_handle,// alça indicadora
intbuffer_num,// número de buffer indicador
intstart_pos,// por onde começar
contagem de int,// quantos copiamos
buffer duplo[]// matriz onde os dados serão copiados
);
Tudo já foi inventado, por que você deveria inventar algo novo?
Acho que é muito mais importante fazer um upload até a data do que tentar manter as configurações padrão.
Assim, de data em data, será. CopyTicks tentando combinar em sintaxe as funções de cópia somente devido à presença de Copy no nome não é conveniente. Conveniente e justificado é quando você pode fazer coisas de pré-processador como esta
// А так же задает привычные MT4-функции: iOpen, iHigh, iLow, iClose, iTime, iVolume.
#define DEFINE_TIMESERIE(NAME,FUNC,T) \
class CLASS##NAME \
{ \
public: \
static T Get( const string Symb, const int TimeFrame, const int iShift ) \
{ \
T tValue[]; \
\
return((Copy##FUNC((Symb == NULL) ? _Symbol : Symb, _Period, iShift, 1, tValue) > 0) ? tValue[0] : -1); \
} \
\
T operator []( const int iPos ) const \
{ \
return(CLASS##NAME::Get(_Symbol, _Period, iPos)); \
} \
}; \
\
CLASS##NAME NAME; \
\
T i##NAME( const string Symb, const int TimeFrame, const int iShift ) \
{ \
return(CLASS##NAME::Get(Symb, TimeFrame, iShift)); \
}
DEFINE_TIMESERIE(Volume, TickVolume, long)
DEFINE_TIMESERIE(Time, Time, datetime)
DEFINE_TIMESERIE(Open, Open, double)
DEFINE_TIMESERIE(High, High, double)
DEFINE_TIMESERIE(Low, Low, double)
DEFINE_TIMESERIE(Close, Close, double)
Assim, de data em data, será. CopyTicks tentando combinar a sintaxe com as funções de cópia só por causa da presença de Copy no nome não é conveniente. Conveniente e justificado é quando você pode fazer coisas de pré-processador como esta.
class CLASS##NAME \
{ \
public: \
static T Get( const string Symb, const int TimeFrame, const int iShift ) \
{ \
T tValue[]; \
\
return((Copy##FUNC((Symb == NULL) ? _Symbol : Symb, _Period, iShift, 1, tValue) > 0) ? tValue[0] : -1); \
} \
\
T operator []( const int iPos ) const \
{ \
return(CLASS##NAME::Get(_Symbol, _Period, iPos)); \
} \
}; \
\
CLASS##NAME NAME; \
\
T i##NAME( const string Symb, const int TimeFrame, const int iShift ) \
{ \
return(CLASS##NAME::Get(Symb, TimeFrame, iShift)); \
}
DEFINE_TIMESERIE(Volume, TickVolume, long)
DEFINE_TIMESERIE(Time, Time, datetime)
DEFINE_TIMESERIE(Open, Open, double)
DEFINE_TIMESERIE(High, High, double)
DEFINE_TIMESERIE(Low, Low, double)
DEFINE_TIMESERIE(Close, Close, double)
Antes de você aparecer no fórum, eu não tinha encontrado esta forma de escrever, pela qual eu, é claro, agradeço, mas não tenho certeza de que muitos programadores a considerariam útil.
Em sua demonstração, de fato é. Na BCS, não é.
2016.10.18 15:12:32.949 Test14 (Si-12.16,M1) Time: 29089 msc for 1503 records
2016.10.18 15:12:32.822 Test14 (Si-12.16,M1) Time: 33207 msc for 1501 records
2016.10.18 15:12:32.639 Test14 (Si-12.16,M1) Time: 21389 msc for 1500 records
2016.10.18 15:12:31.959 Test14 (Si-12.16,M1) Time: 21926 msc for 1500 records
E na Alpari não é nada bom.
2016.10.18 15:14:47.159 Test14 (GBPUSD,M1) Time: 31086 msc for 1836 records
2016.10.18 15:14:46.999 Test14 (GBPUSD,M1) Time: 30698 msc for 1836 records
2016.10.18 15:14:46.779 Test14 (GBPUSD,M1) Time: 46306 msc for 1836 records
2016.10.18 15:14:46.612 Test14 (GBPUSD,M1) Time: 30440 msc for 1836 records
2016.10.18 15:14:46.532 Test14 (GBPUSD,M1) Time: 36227 msc for 1836 records
Falou acima sobre o inconveniente do copytix. O indicador apresentado diminui devido ao fato de que tenho que chamar o copytix várias vezes. E todos os atrasos são por causa disso. A questão é a seguinte
A solução foi proposta.
Agora, para fazer o download de ticks entre datas, você precisa fazer pedidos de QUALQUER número de ticks, a partir da data de início. E então olhe cada vez, e se chegou à data final. E dado que cada pedido de copytix é muito caro, e você recebe tais freios.
Dados de abertura real, apenas carrapatos frescos são carregados:
2016.10.20 18:47:06.499 GetTickHistory: Получены все доступные тики. Время [0]: 2016.10.20 16:47
2016.10.20 18:47:06.499 GetTickHistory: Получено 3 тиков за 20 мкс (пинг = 62214 мкс)
2016.10.20 18:47:06.499 GetTickHistory: Получены все доступные тики. Время [0]: 2016.10.20 16:47
2016.10.20 18:47:06.499 GetTickHistory: Получено 3 тиков за 19 мкс (пинг = 62214 мкс)
2016.10.20 18:47:06.499 GetTickHistory: Получены все доступные тики. Время [0]: 2016.10.20 16:47
2016.10.20 18:47:06.540 GetTickHistory: Получено 8 тиков за 107 мкс (пинг = 62214 мкс)
2016.10.20 18:47:06.540 GetTickHistory: Получены все доступные тики. Время [0]: 2016.10.20 16:47
2016.10.20 18:47:06.540 GetTickHistory: Получено 5 тиков за 19 мкс (пинг = 62214 мкс)
2016.10.20 18:47:06.540 GetTickHistory: Получены все доступные тики. Время [0]: 2016.10.20 16:47
2016.10.20 18:47:06.540 GetTickHistory: Получено 5 тиков за 19 мкс (пинг = 62214 мкс)
2016.10.20 18:47:06.540 GetTickHistory: Получены все доступные тики. Время [0]: 2016.10.20 16:47
2016.10.20 18:47:06.540 GetTickHistory: Получено 5 тиков за 18 мкс (пинг = 62214 мкс)
2016.10.20 18:47:06.540 GetTickHistory: Получены все доступные тики. Время [0]: 2016.10.20 16:47
CopyTicks() parece ser uma função assíncrona?
Cansado do terminal. O roteiro
{
MqlTick Ticks[];
Print(CopyTicks(_Symbol, Ticks));
Print(GetLastError());
}
pende. A sua eliminação manual será registrada.
2016.10.28 16:48:57.737 Test (GBPUSD,M1) -1
Mudança de TF e símbolo - similar. Depois de reiniciado funciona.