论坛风格切换切换到宽版
  • 2555阅读
  • 1回复

请修改指标 [复制链接]

上一主题 下一主题
离线b8866
 
发帖
8
金钱
1
威望
33
贡献
44
交易币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-12-09
我想让30分时图上短期均线向上时,在分时图5上只显示向上箭头, +n|@'= ]  
30分时图上短期均线向下时,在分时图5上只显示向下箭头, lhF)$M  
我试编了不会显示,请老师版主修改: 2(Nf$?U @0  
//+------------------------------------------------------------------+ ,u.A[{@py  
//| MAcross.mq5 | $ Vsf? ID  
//|Copyright 2009, MetaQuotes Software Corp. | /J&_ZDNV~  
//| http://www.mql5.com | [iN\R+:  
//+------------------------------------------------------------------+ 4/&.N]  
#property copyright "2009, MetaQuotes Software Corp." VQ4rEO=t  
#property link "http://www.mql5.com" %){)/~e&  
#property version "1.00" =o4McV}  
#property indicator_chart_window ? UBE0C  
#property indicator_buffers 6 %r:Uff@  
#property indicator_plots 6 ZJ |&t  
//---- plot long ]hY4 MS  
1K{hj%  
#property indicator_label1 "up" "'U]4Z%q!  
#property indicator_type1 DRAW_ARROW ~G8haN4  
#property indicator_color1 Red A{\!nq_~N  
#property indicator_style1 STYLE_SOLID o1rH@D6/-  
#property indicator_width1 1 wZ~eE'zx+  
#property indicator_label2 "down" vA0f4W 8+  
#property indicator_type2 DRAW_ARROW cK1RmL"3  
#property indicator_color2 MediumBlue @s~*>k#"#  
#property indicator_style2 STYLE_SOLID hbTJXP~~?  
#property indicator_width2 1 G'6f6i|<I@  
ya/pn qS  
#property indicator_label3 "long" ,IQ%7*f;O_  
#property indicator_type1 DRAW_NONE ^uWj#  
#property indicator_label4 "small" =1% <  
#property indicator_type2 DRAW_NONE , @dhJ8/  
#property indicator_label5 "longh" zZ{(7K fz  
#property indicator_type1 DRAW_NONE 3Vb/Mn!k  
#property indicator_label6 "smallh" lhduK4u  
#property indicator_type2 DRAW_NONE F}=O Mo:.  
//---- plot down (c1Kg   
K8|>"c~  
EMMp4KKOx+  
8Hh= Sp^  
//--- input parameters  eAbp5}B  
input int MA1=10,MA2=20; udGZ%Mr_  
input int MAH1=20,MAH2=60; s!\G i5b  
//--- indicator buffers 5r(Y,m"?  
double ma1[],ma2[],mah1[],mah2[]; qBXIR }  
C9"yu&l  
double upBuffer[]; fGMuml?[ e  
double downBuffer[]; >J_%'%%f  
int m1,m2,mh1,mh2; 6SN$El 0|G  
%][6TZ}  
//+------------------------------------------------------------------+ &Y|AX2KUC  
//| Custom indicator initialization function | W"ldQ  
//+------------------------------------------------------------------+ s.9_/cFWB  
int OnInit() L(w?.)E  
{ w>uo-88  
//--- indicator buffers mapping h\PybSW4s  
 Jyo(Etp  
SetIndexBuffer(0,upBuffer,INDICATOR_DATA); 9Jj:d)E>o  
SetIndexBuffer(1,downBuffer,INDICATOR_DATA); L|A.;Gq  
PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_ARROW); N(= \S:  
PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_ARROW); }D7} %P]  
PlotIndexSetInteger(0,PLOT_ARROW,1001); ]aTF0 R  
PlotIndexSetInteger(1,PLOT_ARROW,1002); 66%4p%#b4  
QTT2P(Pz  
bA8RoC  
SetIndexBuffer(2,ma1,INDICATOR_DATA); Lc5I?}:;L  
SetIndexBuffer(3,ma2,INDICATOR_DATA); 5;_&C=[  
SetIndexBuffer(4,mah1,INDICATOR_DATA); 6h3TU,$r  
SetIndexBuffer(5,mah2,INDICATOR_DATA); p{S#>JTr  
m1=iMA(Symbol(),PERIOD_M5,MA1,0,MODE_SMA,PRICE_CLOSE); V/W{d[86G  
m2=iMA(Symbol(),PERIOD_M5,MA2,0,MODE_SMA,PRICE_CLOSE); E{W(5.kb;i  
mh1=iMA(Symbol(),PERIOD_M30,MAH1,0,MODE_SMA,PRICE_CLOSE); U Rb  
mh2=iMA(Symbol(),PERIOD_M30,MAH2,0,MODE_SMA,PRICE_CLOSE); 7zEpuw  
//--- 2X!!RS>qg  
return(0); 1G62Qu$O  
} V H2/  
//+------------------------------------------------------------------+ FErK r)  
//| Custom indicator iteration function | k*Vf2O3${  
//+------------------------------------------------------------------+ 9_I#{ ?  
int OnCalculate(const int rates_total, $mZpX:7/u8  
const int prev_calculated, hD! 9[Gb  
const datetime& time[], @#W$7Gwf0  
const double& open[], Sw^-@w=!U5  
const double& high[], U)y~{E~c34  
const double& low[], r]'Q5l4j6"  
const double& close[], Q]NGd 0J  
const long& tick_volume[], RFzMah?Q=j  
const long& volume[], WA&&*ae5`  
const int& spread[]) :U$U:e  
{ baL-~`(T  
int malong=CopyBuffer(m1,0,0,rates_total,ma1); O)i]K`jk  
int masmall=CopyBuffer(m2,0,0,rates_total,ma2); #m<<]L(o8W  
int malongh=CopyBuffer(mh1,0,0,rates_total,mah1); \r+8}8  
int masmallh=CopyBuffer(mh2,0,0,rates_total,mah2); byUz  
for(int i=10;i 3x{2Dhi  
{ ]A2l%V_7  
if((ma1[i-1]>ma2[i-1])&&(ma1&&mah1[1]>mah1[2])) zxr|:KC ?&  
{ ugI9rxT]Kv  
upBuffer=ma2; 3_]<H<w  
if(i==prev_calculated) 7~V,=WEe  
{Alert("up");} Q/ ,j v5  
} :z!N_]t  
if((ma1[i-1]>ma2&&mah1[1] 0` {6~p  
{ V~uH)IMkh7  
downBuffer=mah2; %;E/{gO  
if(i==prev_calculated) @L-3&~=  
{Alert("down");} R`F54?th  
} hZ0CnY8 '  
} DUk&`BSJ  
//--- p. eq N  
//--- return value of prev_calculated for next call 93-UA.+g  
return(rates_total); n4cM /unU  
} UvSvgDMl  
//+------------------------------------------------------------------+
 
离线xingjie1688
发帖
1
金钱
0
威望
11
贡献
49
交易币
0
只看该作者 沙发  发表于: 2010-01-06
我也很想知道呢
 

  • 在线咨询
  • 400-881-0680