//+------------------------------------------------------------------+ //| _TRO_Multi_Meter_Block2 | //| | //| Copyright © 2007, Avery T. Horton, Jr. aka TheRumpledOne | //| | //| PO BOX 43575, TUCSON, AZ 85733 | //| | //| GIFT AND DONATIONS ACCEPTED | //| | //| therumpldone@gmail.com | //+------------------------------------------------------------------+ //| | //| go to www.kreslik.com for the latest indicator updates | //+------------------------------------------------------------------+ //| | //| Use www.efxgroup.com as your forex broker... | //| ...tell them therumpledone sent you! | //+------------------------------------------------------------------+ // thank you Xard777 from www.forex-tsd.com for showing me how to delete the objects properly. // thank you mladen from www.forex-tsd.com for showing me I had a locals and global variables with same name // Replace ABC with a unique 3 character code #property indicator_chart_window extern bool Show_Heading = true; extern string IndName = "ABC" ; // 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 ABC_PERIOD = 14; //******************* extern double Level5 = 95 ; extern double Level4 = 80 ; extern double Level3 = 50 ; extern double Level2 = 20 ; extern double Level1 = 5 ; extern double Level0 = 0 ; extern color colorLevel5 = Red ; extern color colorLevel4 = Orange ; extern color colorLevel3 = Yellow ; extern color colorLevel2 = YellowGreen ; extern color colorLevel1 = Blue ; extern color colorLevel0 = DarkBlue; //******************* string ObjHead01,ObjHead02,ObjHead03,ObjHead04,ObjHead05,ObjHead06,ObjHead07,ObjHead08,ObjHead09; string Obj0001,Obj0002,Obj0003,Obj0004,Obj0005,Obj0006,Obj0007,Obj0008,Obj0009; //+--------------- color MeterColor( double rsimeter ) { if( rsimeter > Level5 ) { return( colorLevel5 ); } if( rsimeter > Level4 ) { return( colorLevel4 ); } if( rsimeter > Level3 ) { return( colorLevel3 ); } if( rsimeter > Level2 ) { return( colorLevel2 ); } if( rsimeter > Level1 ) { return( colorLevel1 ); } return( colorLevel0 ); } //+------------------------------------------------------------------+ //| 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(); ObjHead01 = "ABCColHead01" + LabelTime ; ObjHead02 = "ABCColHead02" + LabelTime ; ObjHead03 = "ABCColHead03" + LabelTime ; ObjHead04 = "ABCColHead04" + LabelTime ; ObjHead05 = "ABCColHead05" + LabelTime ; ObjHead06 = "ABCColHead06" + LabelTime ; ObjHead07 = "ABCColHead07" + LabelTime ; string ABC_ObjHead01 ="M1 " ; string ABC_ObjHead02 ="M5 " ; string ABC_ObjHead03 ="M15 " ; string ABC_ObjHead04 =" M30 " ; string ABC_ObjHead05 ="H1 " ; string ABC_ObjHead06 ="H4 " ; string ABC_ObjHead07 ="D1 " ; if ( Show_Heading) { if (Corner_of_Chart_RIGHT_TOP == true) { int Col01x = 130+Adjust_Side_to_side ; int Col01y = 28+Shift_UP_DN ; } if (Corner_of_Chart_RIGHT_TOP == false) { Col01x = 119+Adjust_Side_to_side ; Col01y = 24+Shift_UP_DN ; } int ColAdj = -20 ; int Col02x = Col01x + ColAdj ; int Col03x = Col01x + ColAdj*2 ; int Col04x = Col01x + ColAdj*3 ; int Col05x = Col01x + ColAdj*4 ; int Col06x = Col01x + ColAdj*5 ; int Col07x = Col01x + ColAdj*6 ; ObjectCreate(ObjHead01, OBJ_LABEL, 0, 0, 0); ObjectSetText(ObjHead01,ABC_ObjHead01 , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(ObjHead01, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(ObjHead01, OBJPROP_XDISTANCE, Col01x); ObjectSet(ObjHead01, OBJPROP_YDISTANCE, Col01y); ObjectCreate(ObjHead02, OBJ_LABEL, 0, 0, 0); ObjectSetText(ObjHead02,ABC_ObjHead02 , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(ObjHead02, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(ObjHead02, OBJPROP_XDISTANCE, Col02x); ObjectSet(ObjHead02, OBJPROP_YDISTANCE, Col01y); ObjectCreate(ObjHead03, OBJ_LABEL, 0, 0, 0); ObjectSetText(ObjHead03,ABC_ObjHead03 , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(ObjHead03, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(ObjHead03, OBJPROP_XDISTANCE, Col03x); ObjectSet(ObjHead03, OBJPROP_YDISTANCE, 28+Shift_UP_DN); ObjectCreate(ObjHead04, OBJ_LABEL, 0, 0, 0); ObjectSetText(ObjHead04,ABC_ObjHead04 , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(ObjHead04, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(ObjHead04, OBJPROP_XDISTANCE, Col04x); ObjectSet(ObjHead04, OBJPROP_YDISTANCE, 28+Shift_UP_DN); ObjectCreate(ObjHead05, OBJ_LABEL, 0, 0, 0); ObjectSetText(ObjHead05,ABC_ObjHead05 , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(ObjHead05, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(ObjHead05, OBJPROP_XDISTANCE, Col05x); ObjectSet(ObjHead05, OBJPROP_YDISTANCE, 28+Shift_UP_DN); ObjectCreate(ObjHead06, OBJ_LABEL, 0, 0, 0); ObjectSetText(ObjHead06,ABC_ObjHead06 , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(ObjHead06, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(ObjHead06, OBJPROP_XDISTANCE, Col06x); ObjectSet(ObjHead06, OBJPROP_YDISTANCE, 28+Shift_UP_DN); ObjectCreate(ObjHead07, OBJ_LABEL, 0, 0, 0); ObjectSetText(ObjHead07,ABC_ObjHead07 , 7, "Tahoma Narrow", BarLabel_color); ObjectSet(ObjHead07, OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP); ObjectSet(ObjHead07, OBJPROP_XDISTANCE, Col07x); ObjectSet(ObjHead07, OBJPROP_YDISTANCE, 28+Shift_UP_DN); } // Show_Heading //******************* change for your indicator ******************** //ABC Signals double ABC_M1 = iMFI(Symbol(),1,ABC_PERIOD,0 ) ; double ABC_M5 = iMFI(Symbol(),5,ABC_PERIOD,0 ) ; double ABC_M15 = iMFI(Symbol(),15,ABC_PERIOD,0 ) ; double ABC_M30 = iMFI(Symbol(),30,ABC_PERIOD,0 ) ; double ABC_H1 = iMFI(Symbol(),60,ABC_PERIOD,0 ) ; double ABC_H4 = iMFI(Symbol(),240,ABC_PERIOD,0 ) ; double ABC_D1 = iMFI(Symbol(),1440,ABC_PERIOD,0 ) ; string M1_ABC= "",M5_ABC= "", M15_ABC= "", M30_ABC= "", H1_ABC= "", H4_ABC= "", D1_ABC= "",PRC1; color color_ABCm1,color_ABCm5,color_ABCm15,color_ABCm30,color_ABCm60,color_ABCm240,color_ABCm1440; M1_ABC = "-"; color_ABCm1 = MeterColor( ABC_M1 ) ; M5_ABC = "-"; color_ABCm5 = MeterColor( ABC_M5 ) ; M15_ABC = "-"; color_ABCm15 = MeterColor( ABC_M15 ) ; M30_ABC = "-"; color_ABCm30 = MeterColor( ABC_M30 ) ; H1_ABC = "-"; color_ABCm60 = MeterColor( ABC_H1 ) ; H4_ABC = "-"; color_ABCm240 = MeterColor( ABC_H4 ) ; D1_ABC = "-"; color_ABCm1440 = MeterColor( ABC_D1 ) ; Obj0002 = "SignalABCM1t" + 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 = "SignalABCM1" + LabelTime ; ObjectCreate(Obj0003, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0003, M1_ABC, 40, "Tahoma Narrow", color_ABCm1); 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 = "SignalABCM5" + LabelTime ; ObjectCreate(Obj0004, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0004, M5_ABC, 40, "Tahoma Narrow", color_ABCm5); 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 = "SignalABCM15" + LabelTime ; ObjectCreate(Obj0005, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0005, M15_ABC, 40, "Tahoma Narrow", color_ABCm15); 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 = "SignalABCM30" + LabelTime ; ObjectCreate(Obj0006, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0006, M30_ABC, 40, "Tahoma Narrow", color_ABCm30); 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 = "SignalABCM60" + LabelTime ; ObjectCreate(Obj0007, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0007, H1_ABC, 40, "Tahoma Narrow", color_ABCm60); 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 = "SignalABCM240" + LabelTime ; ObjectCreate(Obj0008, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0008, H4_ABC, 40, "Tahoma Narrow", color_ABCm240); 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 = "SignalABCM1440" + LabelTime ; ObjectCreate(Obj0009, OBJ_LABEL, 0, 0, 0); ObjectSetText(Obj0009, D1_ABC, 40, "Tahoma Narrow", color_ABCm1440); 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() { //---- 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); ObjectDelete(ObjHead01); ObjectDelete(ObjHead02); ObjectDelete(ObjHead03); ObjectDelete(ObjHead04); ObjectDelete(ObjHead05); ObjectDelete(ObjHead06); ObjectDelete(ObjHead07); //ObjectDelete(ObjHead08); //ObjectDelete(ObjHead09); }
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Money flow index
Custom Indicators Used:
Order Management characteristics:
Other Features: