jiasououk 发表于 2011-11-30 02:47:19

求版主帮忙修改个代码

#property copyright "Copyright ?2007, 520FX Corp."
#property link "http://www.520fx.com"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Yellow
double Ma[];
extern int N=20;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Ma);
//----
Del();
return(0);
}

int start()
{
int i;
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars0) counted_bars--;
limit=Bars-counted_bars;
for (i=limit-1;i>=0;i--)
{
Ma<i>=iMA(NULL,0,N,0,MODE_SMA,PRICE_CLOSE,i);
}
Write();
return(0);
}

void Write()
{
writetext("均线价格",DoubleToStr(Ma,Digits),10,15,Yellow,12);
}
void Del()
{
ObjectDelete("均线价格");
}
void writetext(string Labelname,string data,int x,int y,color ColorValue,int FontSize)//通过Object写文字
{
ObjectDelete(Labelname);
ObjectCreate(Labelname, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Labelname, data, FontSize, "Arial", ColorValue);
ObjectSet(Labelname, OBJPROP_CORNER, 0);
ObjectSet(Labelname, OBJPROP_XDISTANCE, x);
ObjectSet(Labelname, OBJPROP_YDISTANCE, y);
}

帮我把里面的代码改下,改成这个图这样 价格显示在均线末端的?file:///C:Documents and SettingsAdministratorApplication DataTencentUsers23692983QQWinTempRichOle}(3A7Z_R$C6@O%2DWH)@685.jpg               2012-10-11 22:07 上传
下载附件 (55.19 KB)

外汇EA手 发表于 2012-11-22 00:28:10

支持一下吧

秀色可餐 发表于 2012-11-22 00:28:10

回帖是种美德.

情人日记 发表于 2012-11-22 00:28:10

晕不信啊

妖怪 发表于 2012-11-22 00:28:10

楼主good

tat12345 发表于 2012-11-22 00:28:10

不错的东西持续关注

天鹰 发表于 2012-11-22 00:28:10

慢慢来,呵呵

小嘉 发表于 2012-11-22 00:28:10

刚刚接触EA ,楼主请发份给我…

云之端 发表于 2012-11-22 00:28:10

现在越做月亏啊

笑看风云 发表于 2012-11-22 01:12:18

呵呵 高高实在是高~~~~~
页: [1] 2
查看完整版本: 求版主帮忙修改个代码