BollTrade

日期:2019-01-12
浏览:
959
//+-----------+
//| TwoPerBar |
//+-----------+
#property copyright Ron Thompson
#property link http://www.lightpatch.com/forex/
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Magenta
extern double BDistance = 14; // plus how much
extern int BPeriod = 15; // Bollinger period
extern int Deviation = 2; // Bollinger deviation
//---- buffers
double val1[];
double val2[];
//+----------------+
//| Custom DE-init |
//+----------------+
// Called onCE when EA is removed from chart
int deinit()
{
int i;
string o;
//remove the old objects
for(i=0; i Bars; i++)
{
o=DoubleToStr(i,0);
ObjectDelete( myx +o);
}
Print( DE-Init happened ,CurTime());
Comment(
}
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexBuffer(0,val1);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,234);
SetIndexBuffer(1,val2);
}
//+-----+
//| TPB |
//+-----+
int start()
{
int i;
int mybars=2000;
double bup=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_UPPER,0);
double bdn=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_LOWER,0);
for (i=mybars; i i--)
{
bup=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_UPPER,i);
bdn=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_LOWER,i);
if( High[i] =bup+(14*Point) )
{
val2[i]=bup+(15*Point);
//ObjectDelete ( myx +DoubleToStr(objtick,0));
//ObjectCreate ( myx +DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point));
//ObjectSetText( myx +DoubleToStr(objtick,0), X ,15, Arial ,Red);
//objtick++;
}
if( Low[i] =bdn-(14*Point) )
{
val1[i]=bdn-(15*Point);
//ObjectDelete ( myx +DoubleToStr(objtick,0));
//ObjectCreate ( myx +DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point));
//ObjectSetText( myx +DoubleToStr(objtick,0), X ,15, Arial ,Red);
//objtick++;
}
}//for
//Comment(DoubleToStr(mybars,0)+ bars with usable = +DoubleToStr(objtick,0)+ and unusable= +DoubleToStr(noobj,0)+ maxTR= +DoubleToStr(maxTR,4));
}//start
复制代码
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!
特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。