//+------------------------------------------------------------------+ //| Subway.mq4 | //| Yuriy Tokman (YTG) | //| http://ytg.com.ua/ | //+------------------------------------------------------------------+ #property copyright "Yuriy Tokman (YTG)" #property link "http://ytg.com.ua/" #property version "1.00" #property strict #property indicator_chart_window #property indicator_buffers 8 #property indicator_color1 Green #property indicator_color2 Blue #property indicator_color3 Red #property indicator_color4 Red #property indicator_color5 Red #property indicator_color6 Red #property indicator_color7 Red #property indicator_color8 Red //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ enum LM { Model_1=1, Model_2=2, Model_3=3, Model_4=4, }; input LM Level_Model=1; extern int MA_1=24; extern int MA_2=28; double E0[]; double E1[]; double E2[]; double E3[]; double E4[]; double E5[]; double E6[]; double E7[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,E0); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,E1); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,E2); SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,E3); SetIndexStyle(4,DRAW_LINE); SetIndexBuffer(4,E4); SetIndexStyle(5,DRAW_LINE); SetIndexBuffer(5,E5); SetIndexStyle(6,DRAW_LINE); SetIndexBuffer(6,E6); SetIndexStyle(7,DRAW_LINE); SetIndexBuffer(7,E7); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| 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[]) { //--- int limit=rates_total-prev_calculated; if(prev_calculated==0)limit--; else limit++; double hi=0,lo=0,ce=0; for(int i=0; i