求助
求助编程高手,帮编一个MT的指标程式:
确定两条移动平均线,一条是34日移动平均,一条是5日平均,用5日均
线减去34日均线的值,做柱状图,再做(5-34)移动平均柱状图的5日
平均线,做线图
这是公式管理的代码
MA5=MA(CLOSE,N1);
MA34=MA(CLOSE,N2);
PP: (MA5-MA34)[COLORSTICK];
BW: MA(PP,N3)
参数N1缺省5,最小5,最大30
参数N2缺省34,最小34,最大70
参数N3缺省5,最小5,最大30。
MT3.8的也可以,最好是MT4的~谢谢!!!:handshake:handshake:handshake
[ 本帖最后由 CSLyzh 于 2005-7-28 12:18 编辑 ]
发表于:2005-07-28 08:03只看该作者
2楼
mt4的公式
//+------------------------------------------------------------------+
//| CSLYZH.mq4 |
//| Copyright ?2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Silver
#property indicator_color2 Red
//---- indicator parameters
extern int N1=5;
extern int N2=34;
extern int N3=5;
double buffer1;
double buffer2;
double buffer3;
double buffer4;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(4);
SetIndexBuffer(0, buffer1);
SetIndexBuffer(1, buffer2);
SetIndexBuffer(2, buffer3);
SetIndexBuffer(3, buffer4);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexStyle(1,DRAW_LINE);
IndicatorShortName("CSLYZH("+N1+","+N2+","+N2+")");
SetIndexLabel(0,"PP");
SetIndexLabel(1,"BW");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i,limit;
//----
limit=Bars-counted_bars;
for(i=0;i
3楼
谢谢hawkie兄!:handshake:handshake
我先试一下
韬客外汇论坛TALKFOREX.COM
4楼
OK了~再次感谢:handshake:handshakezhibiao.gif
韬客外汇论坛TALKFOREX.COM