//+------------------------------------------------------------------+ //| gy_mp_rsi_ccx.mq4 | //| | //+------------------------------------------------------------------+ #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 1 #property indicator_buffers 2 #property indicator_color1 Lime #property indicator_color2 Red // indicators parameters extern string CCI_Settings = "=== CCI Settings ==="; extern int CCIPeriod = 14; // CCI Period extern int CCInagyobbmint = 30; // extern color CCInagyobbmintC = Red; // extern int CCIkisebbmint = -30; // extern color CCIkisebbmintC = Lime; // extern color CCIColor = Green; // extern string RSI_Settings = "=== RSI Settings ==="; extern int RSIPeriod = 14; // RSI period extern int RSInagyobbmint = 80; // extern color RSInagyobbmintC = Red; // extern int RSIkisebbmint = 20; // extern color RSIkisebbmintC = Lime; // extern color RSIColor = Green; // //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- name for indicator window string short_name="gy_mp_rsi_cci"; IndicatorShortName(short_name); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { color color_common_line = White; color color_common_text = White; color color_connection; //---- Timeframe and symbol string Timeframe = ""; color color_timeframe=SkyBlue; double time_frame=Period(); string symbol=Symbol(); if(time_frame==1) { Timeframe = "M1"; } if(time_frame==5) { Timeframe = "M5"; } if(time_frame==15) { Timeframe = "M15"; } if(time_frame==30) { Timeframe = "M30"; } if(time_frame==60) { Timeframe = "H1"; } if(time_frame==240) { Timeframe = "H4"; } if(time_frame==1440) { Timeframe = "D1"; } if(time_frame==10080) { Timeframe = "W1"; } if(time_frame==43200) { Timeframe = "MN"; } //------------------------------------------ color color_ind = PowderBlue; color color_indic = Green; int x, rt, mrt; int np, cp; string ap, kiir, fejlec, tper; int szorzo; double CCI_1=0; double RSI_1=0; string tpairs[18] = {"","EURUSD", "GBPUSD", "USDJPY", "USDCHF", "USDCAD", "AUDUSD", "GBPCHF", "GBPJPY", "NZDUSD", "EURCHF", "EURGBP", "CADJPY", "CHFJPY", "EURAUD", "AUDJPY", "EURJPY", "EURCAD", "AUDNZD"}; for (np=1;np<19;np++) { ap=tpairs[np]; ObjectCreate("TR1"+DoubleToStr(np,2), OBJ_LABEL, WindowFind("gy_mp_rsi_cci"), 0, 0); ObjectSetText("TR1"+DoubleToStr(np,2), ap ,7, "Verdana", Green); ObjectSet("TR1"+DoubleToStr(np,2), OBJPROP_CORNER, 0); ObjectSet("TR1"+DoubleToStr(np,2), OBJPROP_XDISTANCE, 1); ObjectSet("TR1"+DoubleToStr(np,2), OBJPROP_YDISTANCE, 15+(np*15)); // 22, 37, 52, 67, 82, 97, 112, 127 for (x=1;x<8;x++) { if (x==1) { fejlec="CCI M1"; tper="PERIOD_M1"; CCI_1=iCCI(ap, PERIOD_M1 , CCIPeriod, PRICE_CLOSE,0); } if (x==2) { fejlec="CCI M5"; tper="PERIOD_M5"; CCI_1=iCCI(ap, PERIOD_M5 , CCIPeriod, PRICE_CLOSE,0); } if (x==3) { fejlec="CCI M15"; tper="PERIOD_M15"; CCI_1=iCCI(ap, PERIOD_M15, CCIPeriod, PRICE_CLOSE,0); } if (x==4) { fejlec="CCI M30"; tper="PERIOD_M30"; CCI_1=iCCI(ap, PERIOD_M30, CCIPeriod, PRICE_CLOSE,0); } if (x==5) { fejlec="CCI H1"; tper="PERIOD_H1"; CCI_1=iCCI(ap, PERIOD_H1 , CCIPeriod, PRICE_CLOSE,0); } if (x==6) { fejlec="CCI H4"; tper="PERIOD_H4"; CCI_1=iCCI(ap, PERIOD_H4 , CCIPeriod, PRICE_CLOSE,0); } if (x==7) { fejlec="CCI D1"; tper="PERIOD_D1"; CCI_1=iCCI(ap, PERIOD_D1 , CCIPeriod, PRICE_CLOSE,0); } // fejléc kiírása ObjectCreate("cci"+DoubleToStr(x,0), OBJ_LABEL, WindowFind("gy_mp_rsi_cci"), 0, 0); ObjectSetText("cci"+DoubleToStr(x,0), fejlec ,9, "Verdana", Green); ObjectSet("cci"+DoubleToStr(x,0), OBJPROP_CORNER, 0); ObjectSet("cci"+DoubleToStr(x,0), OBJPROP_XDISTANCE, 40+(x*60)); ObjectSet("cci"+DoubleToStr(x,0), OBJPROP_YDISTANCE, 15); // double CCI_1=iCCI(ap, tper , CCIPeriod, PRICE_CLOSE,0); color_indic = Green; if ((CCI_1 > CCInagyobbmint)) { color_indic = CCInagyobbmintC; } if ((CCI_1 < CCIkisebbmint)) { color_indic = CCIkisebbmintC; } ObjectCreate("TR"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJ_LABEL, WindowFind("gy_mp_rsi_cci"), 0, 0); ObjectSetText("TR"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), DoubleToStr(CCI_1,0) ,7, "Verdana", color_indic); ObjectSet("TR"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJPROP_CORNER, 0); ObjectSet("TR"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJPROP_XDISTANCE, 40+(x*60)); ObjectSet("TR"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJPROP_YDISTANCE, 15+(np*15)); } for (x=1;x<8;x++) { if (x==1) { fejlec="RSI M1"; tper="PERIOD_M1"; RSI_1=iRSI(ap, PERIOD_M1 , RSIPeriod, PRICE_CLOSE,0); } if (x==2) { fejlec="RSI M5"; tper="PERIOD_M5"; RSI_1=iRSI(ap, PERIOD_M5 , RSIPeriod, PRICE_CLOSE,0); } if (x==3) { fejlec="RSI M15"; tper="PERIOD_M15"; RSI_1=iRSI(ap, PERIOD_M15, RSIPeriod, PRICE_CLOSE,0); } if (x==4) { fejlec="RSI M30"; tper="PERIOD_M30"; RSI_1=iRSI(ap, PERIOD_M30, RSIPeriod, PRICE_CLOSE,0); } if (x==5) { fejlec="RSI H1"; tper="PERIOD_H1"; RSI_1=iRSI(ap, PERIOD_H1 , RSIPeriod, PRICE_CLOSE,0); } if (x==6) { fejlec="RSI H4"; tper="PERIOD_H4"; RSI_1=iRSI(ap, PERIOD_H4 , RSIPeriod, PRICE_CLOSE,0); } if (x==7) { fejlec="RSI D1"; tper="PERIOD_D1"; RSI_1=iRSI(ap, PERIOD_D1 , RSIPeriod, PRICE_CLOSE,0); } // fejléc kiírása ObjectCreate("RSI"+DoubleToStr(x,0), OBJ_LABEL, WindowFind("gy_mp_rsi_cci"), 0, 0); ObjectSetText("RSI"+DoubleToStr(x,0), fejlec ,9, "Verdana", Green); ObjectSet("RSI"+DoubleToStr(x,0), OBJPROP_CORNER, 0); ObjectSet("RSI"+DoubleToStr(x,0), OBJPROP_XDISTANCE, 500+(x*60)); ObjectSet("RSI"+DoubleToStr(x,0), OBJPROP_YDISTANCE, 15); // double RSI_1=iRSI(ap, tper , RSIPeriod, PRICE_CLOSE,0); color_indic = Green; if ((RSI_1 > RSInagyobbmint)) { color_indic = RSInagyobbmintC; } if ((RSI_1 < RSIkisebbmint)) { color_indic = RSIkisebbmintC; } ObjectCreate("TRC"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJ_LABEL, WindowFind("gy_mp_rsi_cci"), 0, 0); ObjectSetText("TRC"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), DoubleToStr(RSI_1,0) ,7, "Verdana", color_indic); ObjectSet("TRC"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJPROP_CORNER, 0); ObjectSet("TRC"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJPROP_XDISTANCE, 500+(x*60)); ObjectSet("TRC"+DoubleToStr(x,0)+"-"+DoubleToStr(np,0), OBJPROP_YDISTANCE, 15+(np*15)); } } return(0); }