Show Spread

日期:2019-01-12
浏览:
509
//+--------- --------- --------- --------- --------- --------- --------- ---+
//| 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 color FontColor=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);
//----
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);
}
//+--------- --------- --------- --------- --------- --------- --------- ---+
复制代码
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!
特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。