高低点折线图画法学习参考
日期:2019-01-12
浏览:
228
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int ReversPoint=80;
double RBuffer[];
int Trend=1,InTrend,ttime;
double Points,Last_High, Last_Low;
int init()
{
string short_name;
Points=MarketInfo (Symbol(), MODE_POINT);
SetIndexStyle(0,DRAW_SECTION,EMPTY,1,Red);
SetIndexBuffer(0,RBuffer);
SetIndexEmptyValue(0,0);
short_name= RPoint
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
SetIndexDrawBegin(0,100);
ArrayInitialize(RBuffer,0);
return(0);
}
int deinit()
{
return(0);
}
int start()
{
int counted_bars=IndicatorCounted(),i,shift;
i=(Bars-counted_bars)-1;
for(shift=i; shift shift--)
{
if (Time[shift]!=ttime) InTrend=InTrend+1;
ttime=Time[shift];
RBuffer[shift]=0;
if (High[shift+1] Last_High Trend==1) InTrend=1;
if (Low[shift+1] Last_Low Trend==0) InTrend=1;
if (High[shift+1] Last_High) Last_High=High[shift+1];
if (Low[shift+1] Last_Low) Last_Low=Low[shift+1];
if (Trend==1 Low[shift+1] Last_High-ReversPoint*Points InTrend 1)
{
Trend=0;
RBuffer[shift+InTrend]=High[shift+InTrend];
Last_High=Low[shift+1];
Last_Low=Low[shift+1];
InTrend=1;
}
if (Trend==0 High[shift+1] Last_Low+ReversPoint*Points InTrend 1)
{
Trend=1;
RBuffer[shift+InTrend]=Low[shift+InTrend];
Last_Low=High[shift+1];
Last_High=High[shift+1];
InTrend=1;
}
}
return(0);
}复制代码
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!
特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。