Ti stai perdendo delle opportunità di trading:
- App di trading gratuite
- Oltre 8.000 segnali per il copy trading
- Notizie economiche per esplorare i mercati finanziari
Registrazione
Accedi
Accetti la politica del sito e le condizioni d’uso
Se non hai un account, registrati
Perché?
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 // количество тиков, которые необходимо получить
);
Sì, la dimensione delle zecche nella cache può essere assegnata esplicitamente nella documentazione. Se volete ottenere l'intera cache - guardate la documentazione e chiedete il numero richiesto con la funzione, con parametri come qui:
intCopyBuffer(
intindicator_handle,// handle dell'indicatore
intbuffer_num,// numero del buffer dell'indicatore
intstart_pos,//dove iniziare
intcount,// quanti ne copiamo
doublebuffer[]// array dove i dati saranno copiati
);
Tutto è già stato inventato, perché inventare qualcosa di nuovo?
Penso che sia molto più importante fare un download data-to-date che cercare di mantenere le impostazioni di default.
Quindi da una data all'altra sarà così. CopyTicks che cerca di corrispondere nella sintassi alle funzioni Copy solo per la presenza di Copy nel nome non è conveniente. Comodo e giustificato è quando puoi fare cose da preprocessore come questa
// А так же задает привычные 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)
Quindi da una data all'altra sarà così. CopyTicks che cerca di far corrispondere la sintassi alle funzioni Copy solo per la presenza di Copy nel nome non è conveniente. Conveniente e giustificato è quando si possono fare cose da preprocessore come questa.
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)
Prima che tu apparissi sul forum, non avevo incontrato questo modo di scrivere, per il quale, ovviamente, ti ringrazio, ma non sono sicuro che molti programmatori lo troverebbero utile.
Sul tuo demo, in effetti lo è. Su BCS non lo è.
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 su Alpari non è affatto buono.
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
Ho parlato sopra dell'inconveniente di copytix. L'indicatore presentato rallenta a causa del fatto che devo chiamare più volte copytix. E tutti i ritardi sono dovuti a questo. Il punto è questo
La soluzione è stata proposta.
Ora, per scaricare le zecche tra le date, è necessario fare richieste per QUALSIASI numero di zecche, a partire dalla data di inizio. E poi guardare ogni volta, e se ha raggiunto la data finale. E dato che ogni richiesta di copytix è molto costosa, e si ottengono tali freni.
Dati dall'apertura reale, vengono caricati solo tick freschi:
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() sembra essere una funzione asincrona?
Stanco del terminale. La sceneggiatura
{
MqlTick Ticks[];
Print(CopyTicks(_Symbol, Ticks));
Print(GetLastError());
}
impiccagioni. Cancellandolo manualmente, lo si disconnette.
2016.10.28 16:48:57.737 Test (GBPUSD,M1) -1
Cambiare TF e simbolo - simile. Dopo il riavvio funziona.