//+------------------------------------------------------------------+ //| spread swap.mq4 | //| Copyright © 2007, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2007, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_color1 White //---- double swaplong,swapshort,MARGINREQUIRED; extern color BClockClr= Red; extern color ClksColor= Ivory; extern color TDCOL= White; extern bool show_Bclk=true ; extern string myFont ="Arial Bold" ; extern string myFont2 ="Tahoma Bold" ; extern bool show_M1=true ; extern bool show_M5=true ; extern bool show_M15=true ; extern bool show_M30=true ; extern bool show_M60=true ; extern bool show_M240=false ; extern bool show_M1440=false ; int TimeFrame =0 ; int spread; double s1[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { IndicatorShortName("spread/swap monitor ("+Symbol()+")"); //---- switch(TimeFrame) { case 1 : string TimeFrameStr="M1"; break; case 5 : TimeFrameStr= "M5"; break; case 15 : TimeFrameStr= "M15"; break; case 30 : TimeFrameStr= "M30"; break; case 60 : TimeFrameStr= "H1"; break; case 240 : TimeFrameStr= "H4"; break; case 1440 : TimeFrameStr= "D1"; break; case 10080 : TimeFrameStr= "W1"; break; case 43200 : TimeFrameStr= "MN1"; break; default : TimeFrameStr= "CurrTF"; } //if (TimeFrame",10, "Tahoma Bold", Black); ObjectSet("T1", OBJPROP_CORNER, 0); ObjectSet("T1", OBJPROP_XDISTANCE, 155); ObjectSet("T1", OBJPROP_YDISTANCE, 47); ObjectCreate("T2", OBJ_LABEL, WindowFind("spread/swap monitor ("+Symbol()+")"), 0, 0); ObjectSetText("T2",TimeToStr(CurTime(),TIME_SECONDS),10, "Tahoma", Yellow); ObjectSet("T2", OBJPROP_CORNER, 0); ObjectSet("T2", OBJPROP_XDISTANCE, 245); ObjectSet("T2", OBJPROP_YDISTANCE, 47); ObjectCreate("T3", OBJ_LABEL, WindowFind("spread/swap monitor ("+Symbol()+")"), 0, 0); ObjectSetText("T3",TimeToStr(CurTime(),TIME_DATE),10, "Tahoma", Yellow); ObjectSet("T3", OBJPROP_CORNER, 0); ObjectSet("T3", OBJPROP_XDISTANCE, 325); ObjectSet("T3", OBJPROP_YDISTANCE, 47); //---- if(show_M1) { ObjectCreate("spread/swap monitorM", OBJ_LABEL, WindowFind("spread/swap monitor ("+Symbol()+")"), 0, 0); ObjectSetText("spread/swap monitorM",StringSubstr((M1),0), 11, myFont2 ,ClksColor); ObjectSet("spread/swap monitorM", OBJPROP_CORNER, 0); ObjectSet("spread/swap monitorM", OBJPROP_XDISTANCE, 10); ObjectSet("spread/swap monitorM", OBJPROP_YDISTANCE, 63); } if(show_M5) { ObjectCreate("spread/swap monitorN", OBJ_LABEL, WindowFind("spread/swap monitor ("+Symbol()+")"), 0, 0); ObjectSetText("spread/swap monitorN",StringSubstr((M5),0) , 11, myFont2 ,ClksColor); ObjectSet("spread/swap monitorN", OBJPROP_CORNER, 0); ObjectSet("spread/swap monitorN", OBJPROP_XDISTANCE, 150); ObjectSet("spread/swap monitorN", OBJPROP_YDISTANCE, 63); } if(show_M15) { ObjectCreate("spread/swap monitorO", OBJ_LABEL, WindowFind("spread/swap monitor ("+Symbol()+")"), 0, 0); ObjectSetText("spread/swap monitorO",StringSubstr((M15),0), 11, myFont2 ,ClksColor); ObjectSet("spread/swap monitorO", OBJPROP_CORNER, 0); ObjectSet("spread/swap monitorO", OBJPROP_XDISTANCE, 280); ObjectSet("spread/swap monitorO", OBJPROP_YDISTANCE, 63); } if(show_M30) { ObjectCreate("spread/swap monitorP", OBJ_LABEL, WindowFind("spread/swap monitor ("+Symbol()+")"), 0, 0); ObjectSetText("spread/swap monitorP",StringSubstr((M30),0), 11, myFont2 ,ClksColor); ObjectSet("spread/swap monitorP", OBJPROP_CORNER, 0); ObjectSet("spread/swap monitorP", OBJPROP_XDISTANCE, 430); ObjectSet("spread/swap monitorP", OBJPROP_YDISTANCE, 63);} if(show_M60) { ObjectCreate("spread/swap monitorQ", OBJ_LABEL, WindowFind("spread/swap monitor ("+Symbol()+")"), 0, 0); ObjectSetText("spread/swap monitorQ",StringSubstr((M60),0), 11, myFont2 ,ClksColor); ObjectSet("spread/swap monitorQ", OBJPROP_CORNER, 0); ObjectSet("spread/swap monitorQ", OBJPROP_XDISTANCE, 580); ObjectSet("spread/swap monitorQ", OBJPROP_YDISTANCE, 63); } } //---- return(0); } //+------------------------------------------------------------------+