查看:1328回复:1
求教.救救小弟
能把图里面的指标箭头改小点吗.
望各位高手帮帮忙.谢谢
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Aqua
#property indicator_color4 Magenta
extern int MA1Period=52;
extern int MAPeriod=15;
extern int MAType=3;
double Uptrend;
double Dntrend;
double ExtMapBuffer;
double ExtMapBuffer1;
double ExtMapBuffer2;
int init()
{
IndicatorBuffers(5);
SetIndexBuffer(0,ExtMapBuffer2);
SetIndexBuffer(1,ExtMapBuffer1);
SetIndexBuffer(2, Uptrend);
SetIndexBuffer(3, Dntrend);
SetIndexBuffer(4, ExtMapBuffer);
ArraySetAsSeries(ExtMapBuffer, true);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3);
SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,1);
SetIndexArrow(2,233);
SetIndexStyle(3,DRAW_ARROW,STYLE_SOLID,1);
SetIndexArrow(3,234);
return(0);
}
double WMA(int x, int p)
{
return(iMA(NULL, 0, p, 0, MAType, PRICE_WEIGHTED, x));
}
int start()
{
double MA_Cur, MA_Prev;
int limit;
int counted_bars = IndicatorCounted();
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
limit = Bars - counted_bars;
int x = 0;
int p = MathSqrt(MAPeriod);
int e = Bars - counted_bars + MAPeriod + 1;
double vect, trend;
if(e > Bars) e = Bars;
ArrayResize(vect, e);
ArraySetAsSeries(vect, true);
ArrayResize(trend, e);
ArraySetAsSeries(trend, true);
for(x = 0; x < e; x++)
{
vect[x] = 2*WMA(x, MAPeriod/2) - WMA(x, MAPeriod);
}
for(x = 0; x < e-MAPeriod; x++)
ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, MAType, x);
for(x = e-MAPeriod; x >= 0; x--)
{
trend[x] = trend[x+1];
if (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1;
if (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1;
if (trend[x]>0)
{ Uptrend[x] = ExtMapBuffer[x];
if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1];
Dntrend[x] = EMPTY_VALUE;
}
else
if (trend[x]<0)
{
Dntrend[x] = ExtMapBuffer[x];
if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1];
Uptrend[x] = EMPTY_VALUE;
}
}
for(int i=limit; i>=0; i--)
{
MA_Cur = iMA(NULL,0,MA1Period,0,MODE_SMA,PRICE_CLOSE,i);
MA_Prev = iMA(NULL,0,MA1Period,0,MODE_SMA,PRICE_CLOSE,i+1);
ExtMapBuffer2 = MA_Cur;
ExtMapBuffer1 = MA_Cur;
if (MA_Prev > MA_Cur)
{
ExtMapBuffer2 = EMPTY_VALUE;
}
else if (MA_Prev < MA_Cur)
{
ExtMapBuffer1 = EMPTY_VALUE;
}
else
{
ExtMapBuffer1=EMPTY_VALUE;
ExtMapBuffer2=EMPTY_VALUE;
}
}
return(0);
}
[ 本帖最后由 yangkenboy 于 2008-12-31 19:11 编辑 ]QQ截图未命名.jpg
2楼
没人会改吗??:o