[原创]共享点东西 赚点积分
韬客就是强 不让上传附件
均线后面标注价格
贴源码:
//+------------------------------------------------------------------+
//| #多周期平均线.mq4 |
//| Copyright ?2008, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2008, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 5
#property indicator_color1 Red
#property indicator_color2 Orange
#property indicator_color3 Yellow
#property indicator_color4 MediumSpringGreen
#property indicator_color5 Aqua
extern int 时间周期=0;
extern int 均线周期=200;
extern int 置换位移=0;
extern int 均线类型=0;
extern int 价格类型=0;
extern int 均线周期1=60;
extern int 置换位移1=0;
extern int 均线类型1=0;
extern int 价格类型1=0;
extern int 均线周期2=20;
extern int 置换位移2=0;
extern int 均线类型2=0;
extern int 价格类型2=0;
extern int 均线周期3=10;
extern int 置换位移3=0;
extern int 均线类型3=0;
extern int 价格类型3=0;
extern int 均线周期4=5;
extern int 置换位移4=0;
extern int 均线类型4=0;
extern int 价格类型4=0;
extern bool BarsSelf=true;
extern int BarsLimit=1000;
extern bool 显示开关=true;
extern int 文字偏移量=20;
extern int 文字偏移量1=16;
extern int 文字偏移量2=12;
extern int 文字偏移量3=8;
extern int 文字偏移量4=4;
extern color 文字颜色=indicator_color1;
extern color 文字颜色1=indicator_color2;
extern color 文字颜色2=indicator_color3;
extern color 文字颜色3=indicator_color4;
extern color 文字颜色4=indicator_color5;
extern int 字体大小=10;
double iMABuffer;
double iMABuffer1;
double iMABuffer2;
double iMABuffer3;
double iMABuffer4;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(5);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,iMABuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,iMABuffer1);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,iMABuffer2);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,iMABuffer3);
SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,iMABuffer4);
switch(时间周期)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectDelete("均线价格"+时间周期+均线周期+置换位移+均线类型+价格类型);
ObjectDelete("均线价格1"+时间周期+均线周期1+置换位移1+均线类型1+价格类型1);
ObjectDelete("均线价格2"+时间周期+均线周期2+置换位移2+均线类型2+价格类型2);
ObjectDelete("均线价格3"+时间周期+均线周期3+置换位移3+均线类型3+价格类型3);
ObjectDelete("均线价格4"+时间周期+均线周期4+置换位移4+均线类型4+价格类型4);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray;
int i,shift,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined timeframe on to current timeframe
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),时间周期); //iMA
if(BarsSelf)
{
limit=BarsLimit;
}
else
{
limit=Bars-counted_bars;
}
for(i=0,y=0;i
发表于:2008-10-20 23:49只看该作者
2楼
这是什么啊楼主?
汇市如潮人如水,只叹此间几人回。
发表于:2008-10-20 23:53只看该作者
4楼
你可以把它发到图书馆的软件品评
汇市如潮人如水,只叹此间几人回。