iCustom调用的使用问题
//+------------------------------------------------------------------+//| Bands.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_chart_window
#property indicator_buffers 3
#property indicator_color1 White
#property indicator_color2 White
#property indicator_color3 White
//---- indicator parameters
extern int BandsPeriod=20;
extern int BandsShift=0;
extern double BandsDeviations=2.0;
//---- buffers
double MovingBuffer[];
double UpperBuffer[];
double LowerBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,1);
SetIndexBuffer(0,MovingBuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,UpperBuffer);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,LowerBuffer);
//----
SetIndexDrawBegin(0,BandsPeriod+BandsShift);
SetIndexDrawBegin(1,BandsPeriod+BandsShift);
SetIndexDrawBegin(2,BandsPeriod+BandsShift);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Bollinger Bands |
//+------------------------------------------------------------------+
int start()
{
int i,k,counted_bars=IndicatorCounted();
double deviation;
double sum,oldval,newres;
//----
if(Bars=i)
{
newres=Close-oldval;
sum+=newres*newres;
k--;
}
deviation=BandsDeviations*MathSqrt(sum/BandsPeriod);
UpperBuffer=oldval+deviation;
LowerBuffer=oldval-deviation;
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
我想在EA中计算穿越上轨和下轨的次数~~学了半天只能调用第一根柱子的
不知道怎么调用第二第三...那些柱子的值~~~~
各位老大帮帮忙
小的谢谢了 谢谢分享 楼上的话等于没说~~~ 自己知道了 牛牛牛牛 就为赚分嘛 小心大家盯上你哦 做一个,做好了,请看 刚加进这个论坛不久,热衷于EA交易 看看吧,谢谢分享
页:
[1]
2