//+------------------------------------------------------------------+ //| hm.mq5 | //| hoz | //| | //+------------------------------------------------------------------+ #property copyright "hoz" #property link "" #property version "1.00" #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { return INIT_SUCCEEDED; } //==================================================================================================================== // 1.1 Возвращает количество баров в окне торгового инструмента активного окна на заданном таймфрейме. =============== int barsTotal(ENUM_TIMEFRAMES tf = PERIOD_CURRENT) { // ТаймФрейм, количество баров которого требуется получить //--- return Bars(_Symbol, tf); }//=================================================================================================================== // Определение индекса бара, с которого необходимо производить перерасчет. =========================================== int recalcIndex(int barsTotal, // Количество пришедших баров таймфрейма открытого графика int countedBars) { // Количество уже обработанных баров таймфрейма открытого графика //--- int barsTotalOtherTF = barsTotal(); //--- return 1; } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- //--- return value of prev_calculated for next call return rates_total; }