Show Spread
//+--------- --------- --------- --------- --------- --------- --------- ---+
//| 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= True;
extern string note2="Default Font Color";
extern colorFontColor=DarkViolet;
extern string note3="Font Size";
extern int FontSize=24;
extern string note4="Font Type";
extern string FontType="Arial Black";
extern string note5="Display the spread 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 div=1;
int precision=0;
//----
double Old_Price;
//+--------- --------- --------- --------- --------- --------- --------- ---+
//| |
//+--------- --------- --------- --------- --------- --------- --------- ---+
int init()
{
int myDigits=MarketInfo(Symbol(),MODE_DIGITS);
if(myDigits==3) div=10;
if(myDigits==5) div=10;
return(0);
}
//+--------- --------- --------- --------- --------- --------- --------- ---+
//| |
//+--------- --------- --------- --------- --------- --------- --------- ---+
int deinit()
{
ObjectDelete("Market_Price_ Label2");
//----
return(0);
}
//+--------- --------- --------- --------- --------- --------- --------- ---+
//| |
//+--------- --------- --------- --------- --------- --------- --------- ---+
int start()
{
double spread = MarketInfo(Symbol( ), MODE_SPREAD) / div;
//Comment("Current spread: ",spread);
/* if (Bid_Ask_Colors= =True)
{
if (Bid > Old_Price) FontColor=LawnGreen ;
if (Bid < Old_Price) FontColor=Red;
Old_Price=Bid;
}
*/
//----
ObjectCreate("Market_Price_ Label2", OBJ_LABEL, 0,0,0);
ObjectSetText("Market_Price_ Label2", DoubleToStr(spread,1), FontSize, FontType, FontColor);
ObjectSet("Market_Price_ Label2", OBJPROP_CORNER, WhatCorner);
ObjectSet("Market_Price_ Label2", OBJPROP_XDISTANCE, 1);
ObjectSet("Market_Price_ Label2", OBJPROP_YDISTANCE, 1);
}
//+--------- --------- --------- --------- --------- --------- --------- ---+
不错不错,楼主您辛苦了。。。 :lol不错 我抢、我抢、我抢沙发~ LZ说的很不错 没看完~~~~~~ 先顶,好同志 LZ说的很不错 谢谢楼主分享 {:1_186:} 顶下
页:
[1]
2