//+------------------------------------------------------------------+ //| Magnified Market Price.mq4 ver1.4 by Habeeb | //+------------------------------------------------------------------+ #property indicator_chart_window //---- extern string note1="Change font colors automatically? True = Yes"; extern bool Bid_Ask_Colors=false; extern string note2="Default Font Color"; extern color FontColor=Navy; extern string note3="Font Size"; extern int FontSize=14; extern string note4="Font Type"; extern string FontType="Arial"; extern string note5="Display the price in what corner?"; extern string note6="Upper left=0; Upper right=1"; extern string note7="Lower left=2; Lower right=3"; extern int WhatCorner=1; //---- double Old_Price; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { ObjectDelete("Market_Price_Label"); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { if (Bid_Ask_Colors==True) { if (Bid > Old_Price) FontColor=Green; if (Bid < Old_Price) FontColor=Red; Old_Price=Bid; } string Market_Price=DoubleToStr(Bid, Digits); string Spread=DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD), 0); //string Spread=DoubleToStr((Ask - Bid),Digits); //---- ObjectSetText("Market_Price_Label", StringConcatenate(GetTimeFrame(Period()), " - ",Year(),"/",Month(),"/",Day()," - ", Symbol(), " " , Market_Price, " (", Spread, ") "), FontSize, FontType, FontColor); ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner); ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, 100); ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, 20); } //+------------------------------------------------------------------+ string GetTimeFrame(int shift) { switch(shift) { case 1: { return("M1"); break; } case 5: { return("M5"); break; } case 15: { return("M15"); break; } case 30: { return("M30"); break; } case 60: { return("H1"); break; } case 240: { return("H4"); break; } case 1440: { return("D1"); break; } case 10080: { return("W1"); break; } case 43200: { return("MN"); break; } } }