📢 MededelingenBeginnersgids: berichten, punten en communityregelsMT4/MT5 免安装包(Windows+安卓 APK)gratis downloaden(0 Points)Beginnersbasis: punten en activiteit verdienen
🏷 Functies CopyRates()/CopyClose():历史数据批量读取
MT5 读历史 K 线的标配Functies。
【基本用法】MqlRates rates[]; int n = CopyRates(Symbol(), PERIOD_H1, 0, 100, rates); 一次取 100 根 H1 K 线(含 OHLC、tick_volume、spread、time)。
【两种取法】
- 起点模式:CopyRates(symbol, tf, start_pos, count, array);
- tijd模式:CopyRates(symbol, tf, start_time, stop_time, array)。
【配合 ArraySetAsSeries】CopyBuffer/CopyRates opbrengst数组Standaard index0=最旧,SetAsSeries(rates, true) 后 index0=up-to-date,写Strategie逻辑更直观。
【opbrengst值检查】n<0 是mislukking(数据未加载完,用 BarsCalculated 检查),n<count 是部分succes——都要Behandelen。
【性能建议】每根 K 线只kopiëren一次(新 K 线检测后再vernieuwen),不要每个 tick 都全量kopiëren,回测速度差十倍。
【基本用法】MqlRates rates[]; int n = CopyRates(Symbol(), PERIOD_H1, 0, 100, rates); 一次取 100 根 H1 K 线(含 OHLC、tick_volume、spread、time)。
【两种取法】
- 起点模式:CopyRates(symbol, tf, start_pos, count, array);
- tijd模式:CopyRates(symbol, tf, start_time, stop_time, array)。
【配合 ArraySetAsSeries】CopyBuffer/CopyRates opbrengst数组Standaard index0=最旧,SetAsSeries(rates, true) 后 index0=up-to-date,写Strategie逻辑更直观。
【opbrengst值检查】n<0 是mislukking(数据未加载完,用 BarsCalculated 检查),n<count 是部分succes——都要Behandelen。
【性能建议】每根 K 线只kopiëren一次(新 K 线检测后再vernieuwen),不要每个 tick 都全量kopiëren,回测速度差十倍。
🔥 Populaire berichten van deze gebruiker
🆕 Nieuwste berichten van deze gebruiker
Reacties(0)
Nog geen reacties – neem de eerste plek