//+------------------------------------------------------------------+ //| _TRO_Multi_Meter_STR | //| | //| Copyright © 2007, Avery T. Horton, Jr. aka TheRumpledOne | //| | //| PO BOX 43575, TUCSON, AZ 85733 | //| | //| GIFT AND DONATIONS ACCEPTED | //| | //| therumpldone@gmail.com | //+------------------------------------------------------------------+ #property indicator_chart_window extern bool Show_Heading = false; extern string IndName = "STR" ; // change //******************* extern bool Corner_of_Chart_RIGHT_TOP = true; extern int Shift_UP_DN =0; extern int Adjust_Side_to_side = 20; extern color BarLabel_color = LightBlue; extern color CommentLabel_color = LightBlue; //******************* // change inputs for your indicator extern int RSI_Period = 9; extern int RSI_PRICE_TYPE = 0; extern int CCI_Period = 13; extern int CCI_PRICE_TYPE = 0; extern int STOCH_K_Period = 5; extern int STOCH_D_Period = 3; extern int STOCH_Slowing = 3; extern int STOCH_MA_MODE = 1; //******************* string Obj0001,Obj0002,Obj0003,Obj0004,Obj0005,Obj0006,Obj0007,Obj0008,Obj0009; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { //*********************************************************************************************************************** string LabelTime=""; if (LabelTime=="") {LabelTime=TimeToStr(TimeLocal(),TIME_SECONDS); } int counted_bars=IndicatorCounted(); if ( Show_Heading) { if (Corner_of_Chart_RIGHT_TOP == true) { Obj0001 = "STR_Head" + LabelTime ; string STR_Head = " M1 M5 M15 M30 H1 H4 D1" ; ObjectCreate(Obj0001, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0001, STR_Head , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(Obj0001, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0001, OBJPROP_XDISTANCE, 17+Adjust_Side_to_side); ObjectSet(Obj0001, OBJPROP_YDISTANCE, 28+Shift_UP_DN); } if (Corner_of_Chart_RIGHT_TOP == false) { ObjectCreate(Obj0001, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0001, STR_Head, 7, "Tahoma Narrow", BarLabel_color); ObjectSet(Obj0001, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0001, OBJPROP_XDISTANCE, 17+Adjust_Side_to_side); ObjectSet(Obj0001, OBJPROP_YDISTANCE, 24+Shift_UP_DN); } } // Show_Heading //******************* change for your indicator ******************** //STR Signals double rsi_d1 = iRSI(NULL, PERIOD_D1, RSI_Period , RSI_PRICE_TYPE, 0); double rsi_h4 = iRSI(NULL, PERIOD_H4, RSI_Period , RSI_PRICE_TYPE, 0); double rsi_h1 = iRSI(NULL, PERIOD_H1, RSI_Period , RSI_PRICE_TYPE, 0); double rsi_m30 = iRSI(NULL, PERIOD_M30, RSI_Period , RSI_PRICE_TYPE, 0); double rsi_m15 = iRSI(NULL, PERIOD_M15, RSI_Period , RSI_PRICE_TYPE, 0); double rsi_m5 = iRSI(NULL, PERIOD_M5, RSI_Period , RSI_PRICE_TYPE, 0); double rsi_m1 = iRSI(NULL, PERIOD_M1, RSI_Period , RSI_PRICE_TYPE, 0); double stoc_D1 = iStochastic(NULL, PERIOD_D1, STOCH_K_Period,STOCH_D_Period,STOCH_Slowing, STOCH_MA_MODE, 0, MODE_MAIN, 0); double stoc_H4 = iStochastic(NULL, PERIOD_H4, STOCH_K_Period,STOCH_D_Period,STOCH_Slowing, STOCH_MA_MODE, 0, MODE_MAIN, 0); double stoc_H1 = iStochastic(NULL, PERIOD_H1, STOCH_K_Period,STOCH_D_Period,STOCH_Slowing, STOCH_MA_MODE, 0, MODE_MAIN, 0); double stoc_M30 = iStochastic(NULL, PERIOD_M30, STOCH_K_Period,STOCH_D_Period,STOCH_Slowing, STOCH_MA_MODE, 0, MODE_MAIN, 0); double stoc_M15 = iStochastic(NULL, PERIOD_M15, STOCH_K_Period,STOCH_D_Period,STOCH_Slowing, STOCH_MA_MODE, 0, MODE_MAIN, 0);//sto was 15,5,5 double stoc_M5 = iStochastic(NULL, PERIOD_M5, STOCH_K_Period,STOCH_D_Period,STOCH_Slowing, STOCH_MA_MODE, 0, MODE_MAIN, 0); double stoc_M1 = iStochastic(NULL, PERIOD_M1, STOCH_K_Period,STOCH_D_Period,STOCH_Slowing, STOCH_MA_MODE, 0, MODE_MAIN, 0);// was mode signal now gets value off main line double cci_DD1 = iCCI(NULL, PERIOD_D1,CCI_Period , CCI_PRICE_TYPE, 0); double cci_HH4 = iCCI(NULL, PERIOD_H4,CCI_Period , CCI_PRICE_TYPE, 0); double cci_HH1 = iCCI(NULL, PERIOD_H1,CCI_Period , CCI_PRICE_TYPE, 0); double cci_MM30 = iCCI(NULL, PERIOD_M30,CCI_Period , CCI_PRICE_TYPE, 0); double cci_MM15 = iCCI(NULL, PERIOD_M15,CCI_Period , CCI_PRICE_TYPE, 0); double cci_MM5 = iCCI(NULL, PERIOD_M5,CCI_Period , CCI_PRICE_TYPE, 0); double cci_MM1 = iCCI(NULL, PERIOD_M1,CCI_Period , CCI_PRICE_TYPE, 0); string H1_STR = "", M15_STR = "", M5_STR = "", M1_STR = "", H4_STR ="",M30_STR= "",D1_STR= "",STR_w1= ""; color color_signal,color_STRm1,color_STRm5,color_STRm15,color_STRm30,color_STRm60,color_STRm240,color_STRm1440; if ((rsi_d1 > 50) && (stoc_D1 > 40) && (cci_DD1 > 0)) { D1_STR = "-";color_STRm1440 = Lime;} if ((rsi_h4 > 50) && (stoc_H4 > 40) && (cci_HH4 > 0)) { H4_STR = "-";color_STRm240 = Lime;} if ((rsi_h1 > 50) && (stoc_H1 > 40) && (cci_HH1 > 0)) { H1_STR = "-";color_STRm60 = Lime;} if ((rsi_m30 > 50) && (stoc_M30 > 40) && (cci_MM30 > 0)) { M30_STR = "-";color_STRm30 = Lime; } if ((rsi_m15 > 50) && (stoc_M15 > 40) && (cci_MM15 > 0)) { M15_STR = "-";color_STRm15 = Lime; } if ((rsi_m5 > 50) && (stoc_M5 > 40) && (cci_MM5 > 0)) { M5_STR = "-"; color_STRm5 = Lime;} if ((rsi_m1 > 50) && (stoc_M1 > 40) && (cci_MM1 > 0)) { M1_STR = "-"; color_STRm1 = Lime;} if ((rsi_d1 < 50) && (stoc_D1 < 60) && (cci_DD1 < 0)) { D1_STR = "-";color_STRm1440 = Red;} if ((rsi_h4 < 50) && (stoc_H4 < 60) && (cci_HH4 < 0)) { H4_STR = "-";color_STRm240 = Red;} if ((rsi_h1 < 50) && (stoc_H1 < 60) && (cci_HH1 < 0)) { H1_STR = "-";color_STRm60 = Red;} if ((rsi_m30 < 50) && (stoc_M30 < 60) && (cci_MM30 < 0)) { M30_STR = "-";color_STRm30 = Red;} if ((rsi_m15 < 50) && (stoc_M15 < 60) && (cci_MM15 < 0)) { M15_STR = "-";color_STRm15 = Red;} if ((rsi_m5 < 50) && (stoc_M5 < 60) && (cci_MM5 < 0)) { M5_STR = "-";color_STRm5 = Red;} if ((rsi_m1 < 50) && (stoc_M1 < 60) && (cci_MM1 < 0)) { M1_STR = "-"; color_STRm1 = Red;} if ((rsi_m1 < 50) && (stoc_M1 > 40) && (cci_MM1 > 0)) { M1_STR = "-"; color_STRm1 = Orange;} if ((rsi_m1 > 50) && (stoc_M1 < 60) && (cci_MM1 < 0)) { M1_STR = "-"; color_STRm1 = Orange;} if ((rsi_m1 < 50) && (stoc_M1 > 40) && (cci_MM1 < 0)) { M1_STR = "-"; color_STRm1 = Orange;} if ((rsi_m1 > 50) && (stoc_M1 < 60) && (cci_MM1 > 0)) { M1_STR = "-"; color_STRm1 = Orange;} if ((rsi_m1 > 50) && (stoc_M1 > 40) && (cci_MM1 < 0)) { M1_STR = "-"; color_STRm1 = Orange;} if ((rsi_m1 > 50) && (stoc_M1 < 60) && (cci_MM1 < 0)) { M1_STR = "-"; color_STRm1 = Orange;} if ((rsi_m5 < 50) && (stoc_M5 > 40) && (cci_MM5 > 0)) { M5_STR = "-"; color_STRm5 = Orange;} if ((rsi_m5 > 50) && (stoc_M5 < 60) && (cci_MM5 < 0)) { M5_STR = "-"; color_STRm5 = Orange;} if ((rsi_m5 < 50) && (stoc_M5 > 40) && (cci_MM5 < 0)) { M5_STR = "-"; color_STRm5 = Orange;} if ((rsi_m5 > 50) && (stoc_M5 < 60) && (cci_MM5 > 0)) { M5_STR = "-"; color_STRm5 = Orange;} if ((rsi_m5 > 50) && (stoc_M5 > 40) && (cci_MM5 < 0)) { M5_STR = "-"; color_STRm5 = Orange;} if ((rsi_m5 > 50) && (stoc_M5 < 60) && (cci_MM5 < 0)) { M5_STR = "-"; color_STRm5 = Orange;} if ((rsi_m15 < 50) && (stoc_M15 > 40) && (cci_MM15 > 0)) { M15_STR = "-"; color_STRm15 = Orange;} if ((rsi_m15 > 50) && (stoc_M15 < 60) && (cci_MM15 < 0)) { M15_STR = "-"; color_STRm15 = Orange;} if ((rsi_m15 < 50) && (stoc_M15 > 40) && (cci_MM15 < 0)) { M15_STR = "-"; color_STRm15 = Orange;} if ((rsi_m15 > 50) && (stoc_M15 < 60) && (cci_MM15 > 0)) { M15_STR = "-"; color_STRm15 = Orange;} if ((rsi_m15 > 50) && (stoc_M15 > 40) && (cci_MM15 < 0)) { M15_STR = "-"; color_STRm15 = Orange;} if ((rsi_m15 > 50) && (stoc_M15 < 60) && (cci_MM15 < 0)) { M15_STR = "-"; color_STRm15 = Orange;} if ((rsi_m30 < 50) && (stoc_M30 > 40) && (cci_MM30 > 0)) { M30_STR = "-"; color_STRm30 = Orange;} if ((rsi_m30 > 50) && (stoc_M30 < 60) && (cci_MM30 < 0)) { M30_STR = "-"; color_STRm30 = Orange;} if ((rsi_m30 < 50) && (stoc_M30 > 40) && (cci_MM30 < 0)) { M30_STR = "-"; color_STRm30 = Orange;} if ((rsi_m30 > 50) && (stoc_M30 < 60) && (cci_MM30 > 0)) { M30_STR = "-"; color_STRm30 = Orange;} if ((rsi_m30 > 50) && (stoc_M30 > 40) && (cci_MM30 < 0)) { M30_STR = "-"; color_STRm30 = Orange;} if ((rsi_m30 > 50) && (stoc_M30 < 60) && (cci_MM30 < 0)) { M30_STR = "-"; color_STRm30 = Orange;} if ((rsi_h1 < 50) && (stoc_H1 > 40) && (cci_HH1 > 0)) { H1_STR = "-"; color_STRm60 = Orange;} if ((rsi_h1 > 50) && (stoc_H1 < 60) && (cci_HH1 < 0)) { H1_STR = "-"; color_STRm60 = Orange;} if ((rsi_h1 < 50) && (stoc_H1 > 40) && (cci_HH1 < 0)) { H1_STR = "-"; color_STRm60 = Orange;} if ((rsi_h1 > 50) && (stoc_H1 < 60) && (cci_HH1 > 0)) { H1_STR = "-"; color_STRm60 = Orange;} if ((rsi_h1 > 50) && (stoc_H1 > 40) && (cci_HH1 < 0)) { H1_STR = "-"; color_STRm60 = Orange;} if ((rsi_h1 > 50) && (stoc_H1 < 60) && (cci_HH1 < 0)) { H1_STR = "-"; color_STRm60 = Orange;} if ((rsi_h4 < 50) && (stoc_H4 > 40) && (cci_HH4 > 0)) { H4_STR = "-"; color_STRm240 = Orange;} if ((rsi_h4 > 50) && (stoc_H4 < 60) && (cci_HH4 < 0)) { H4_STR = "-"; color_STRm240 = Orange;} if ((rsi_h4 < 50) && (stoc_H4 > 40) && (cci_HH4 < 0)) { H4_STR = "-"; color_STRm240 = Orange;} if ((rsi_h4 > 50) && (stoc_H4 < 60) && (cci_HH4 > 0)) { H4_STR = "-"; color_STRm240 = Orange;} if ((rsi_h4 > 50) && (stoc_H4 > 40) && (cci_HH4 < 0)) { H4_STR = "-"; color_STRm240 = Orange;} if ((rsi_h4 > 50) && (stoc_H4 < 60) && (cci_HH4 < 0)) { H4_STR = "-"; color_STRm240 = Orange;} if ((rsi_d1 < 50) && (stoc_D1 > 40) && (cci_DD1 > 0)) { D1_STR = "-"; color_STRm1440 = Orange;} if ((rsi_d1 > 50) && (stoc_D1 < 60) && (cci_DD1 < 0)) { D1_STR = "-"; color_STRm1440 = Orange;} if ((rsi_d1 < 50) && (stoc_D1 > 40) && (cci_DD1 < 0)) { D1_STR = "-"; color_STRm1440 = Orange;} if ((rsi_d1 > 50) && (stoc_D1 < 60) && (cci_DD1 > 0)) { D1_STR = "-"; color_STRm1440 = Orange;} if ((rsi_d1 > 50) && (stoc_D1 > 40) && (cci_DD1 < 0)) { D1_STR = "-"; color_STRm1440 = Orange;} if ((rsi_d1 > 50) && (stoc_D1 < 60) && (cci_DD1 < 0)) { D1_STR = "-"; color_STRm1440 = Orange;} Obj0002 = "SignalSTRM1t" + LabelTime ; ObjectCreate(Obj0002, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0002,IndName, 7, "Tahoma Narrow", BarLabel_color); ObjectSet(Obj0002, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0002, OBJPROP_XDISTANCE, 155+Adjust_Side_to_side); ObjectSet(Obj0002, OBJPROP_YDISTANCE, 50+Shift_UP_DN); Obj0003 = "SignalSTRM1" + LabelTime ; ObjectCreate(Obj0003, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0003, M1_STR, 40, "Tahoma Narrow", color_STRm1); ObjectSet(Obj0003, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0003, OBJPROP_XDISTANCE, 130+Adjust_Side_to_side); ObjectSet(Obj0003, OBJPROP_YDISTANCE, 20+Shift_UP_DN); Obj0004 = "SignalSTRM5" + LabelTime ; ObjectCreate(Obj0004, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0004, M5_STR, 40, "Tahoma Narrow", color_STRm5); ObjectSet(Obj0004, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0004, OBJPROP_XDISTANCE, 110+Adjust_Side_to_side); ObjectSet(Obj0004, OBJPROP_YDISTANCE, 20+Shift_UP_DN); Obj0005 = "SignalSTRM15" + LabelTime ; ObjectCreate(Obj0005, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0005, M15_STR, 40, "Tahoma Narrow", color_STRm15); ObjectSet(Obj0005, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0005, OBJPROP_XDISTANCE, 90+Adjust_Side_to_side); ObjectSet(Obj0005, OBJPROP_YDISTANCE, 20+Shift_UP_DN); Obj0006 = "SignalSTRM30" + LabelTime ; ObjectCreate(Obj0006, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0006, M30_STR, 40, "Tahoma Narrow", color_STRm30); ObjectSet(Obj0006, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0006, OBJPROP_XDISTANCE, 70+Adjust_Side_to_side); ObjectSet(Obj0006, OBJPROP_YDISTANCE, 20+Shift_UP_DN); Obj0007 = "SignalSTRM60" + LabelTime ; ObjectCreate(Obj0007, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0007, H1_STR, 40, "Tahoma Narrow", color_STRm60); ObjectSet(Obj0007, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0007, OBJPROP_XDISTANCE, 50+Adjust_Side_to_side); ObjectSet(Obj0007, OBJPROP_YDISTANCE, 20+Shift_UP_DN); Obj0008 = "SignalSTRM240" + LabelTime ; ObjectCreate(Obj0008, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0008, H4_STR, 40, "Tahoma Narrow", color_STRm240); ObjectSet(Obj0008, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0008, OBJPROP_XDISTANCE, 30+Adjust_Side_to_side); ObjectSet(Obj0008, OBJPROP_YDISTANCE, 20+Shift_UP_DN); Obj0009 = "SignalSTRM1440" + LabelTime ; ObjectCreate(Obj0009, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0009, D1_STR, 40, "Tahoma Narrow", color_STRm1440); ObjectSet(Obj0009, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(Obj0009, OBJPROP_XDISTANCE, 10+Adjust_Side_to_side); ObjectSet(Obj0009, OBJPROP_YDISTANCE, 20+Shift_UP_DN); //---- return(0); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- // thank you Xard777 from www.forex-tsd.com for showing me how to delete the objects properly. ObjectsDeleteAll(0,OBJ_HLINE); ObjectsDeleteAll(0,OBJ_TEXT); ObjectsDeleteAll(0,OBJ_LABEL); deleteObject(); //---- return(0); } void deleteObject() { ObjectDelete(Obj0001); ObjectDelete(Obj0002); ObjectDelete(Obj0003); ObjectDelete(Obj0004); ObjectDelete(Obj0005); ObjectDelete(Obj0006); ObjectDelete(Obj0007); ObjectDelete(Obj0008); ObjectDelete(Obj0009); }
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Relative strength index
Stochastic oscillator
Commodity channel index
Custom Indicators Used:
Order Management characteristics:
Other Features: