顺水外汇EA交易网MT4
标题:
求高手帮写一个收盘线(射线)指标,有图示
[打印本页]
作者:
一头牛
时间:
2018-1-11 11:53
标题:
求高手帮写一个收盘线(射线)指标,有图示
求哪位大大帮助写一个收盘线的代码,本人太笨,急用,万分感谢!!如图(这是我手绘的),20条以上,最好收盘线条数可调。
作者:
一头牛
时间:
2018-1-11 13:02
我有这个的(Zz-SR-TL-Indicator.mq4)代码,不会改,拿出来作参考:
//+------------------------------------------------------------------+
//| SUPRESMultiFrame.mq4 |
//| |
//| RD |
//+------------------------------------------------------------------+
#property copyright "RD"
#property link "marynarz15@wp.pl"
#property indicator_chart_window
#define MaxObject 1000
//---- indicator parameters
extern int TimeFrame=15;
extern int BarsMax=144;
extern int ExtDepth=12;
extern int ExtDeviation=1;
extern int ExtBackstep=5;
bool DeleteObjectsOnExit=true;
color LineColor1=Red;
color LineColor5=Red;
color LineColor15=Red;
color LineColor30=Red;
color LineColor60=Red;
color LineColor240=Orange;
color LineColor1440=Red;
color LineColor10080=Red;
//-----------------------
double ExtMapBuffer[];
double ExtMapBuffer2[];
int SUPRESCount=0;
int linewidth;
string NamePattern;
color LineColor;
//+------------------------------------------------------------------+
//| Delete objects |
//+------------------------------------------------------------------+
int DeleteSupRes()
{
int ObjectCount=ObjectsTotal();
string names[MaxObject];
for(int i=0; i=0; shift--)
{
val=iLow(NULL,TimeFrame,Lowest(NULL,TimeFrame,MODE_LOW,ExtDepth,shift));
if(val==lastlow) val=0.0;
else
{
lastlow=val;
if((iLow(NULL,TimeFrame,shift)-val)>(ExtDeviation*Point)) val=0.0;
else
{
for(back=1; backval)) ExtMapBuffer[shift+back]=0.0;
}
}
}
ExtMapBuffer[shift]=val;
//--- high
val=iHigh(NULL,TimeFrame,Highest(NULL,TimeFrame,MODE_HIGH,ExtDepth,shift));
if(val==lasthigh) val=0.0;
else
{
lasthigh=val;
if((val-iHigh(NULL,TimeFrame,shift))>(ExtDeviation*Point)) val=0.0;
else
{
for(back=1; back=0; shift--)
{
curlow=ExtMapBuffer[shift];
curhigh=ExtMapBuffer2[shift];
if((curlow==0)&&(curhigh==0)) continue;
//---
if(curhigh!=0)
{
if(lasthigh>0)
{
if(lasthigh0)
{
if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0;
else ExtMapBuffer[shift]=0;
}
//---
if((curlow=0; shift--)
{
if(shift>=iBars(NULL,TimeFrame)-ExtDepth) ExtMapBuffer[shift]=0.0;
else
{
res=ExtMapBuffer2[shift];
if(res!=0.0) ExtMapBuffer[shift]=res;
}
}
//----
int count=0;
double TempBufferPrice[MaxObject];
int TempBufferBar[MaxObject];
string ObjectNames[MaxObject];
//----
for(shift=BarsMax; shift>0; shift--)
if (ExtMapBuffer[shift]>0)
{
count++;
TempBufferPrice[count-1]=ExtMapBuffer[shift];
TempBufferBar[count-1]=shift;
}
for(int i=0; i<count; i++)
ObjectNames
=/*TimeFrame+"m S/R("+i+")"+DoubleToStr(TempBufferPrice
,Digits)+" "+*/
TimeToStr(iTime(NULL,TimeFrame,TempBufferBar
),TIME_DATE|TIME_MINUTES);
//----
int ObjectForDeleteCount=0;
string ObjectsForDelete[MaxObject];
for(i=0; i<ObjectsTotal(); i++)
{
objectname=ObjectName(i);
if (StringSubstr(objectname,0,StringLen(NamePattern))==NamePattern)
{
ObjectForDeleteCount++;
ObjectsForDelete[ObjectForDeleteCount-1]=objectname;
}
}
for(i=0; i<count-2; i++)
{
objectname=ObjectNames
;
for(int j=0; j<ObjectForDeleteCount; j++)
if(ObjectsForDelete[j]==objectname)
{
ObjectsForDelete[j]="";
break;
}
}
for(j=0; j<ObjectForDeleteCount; j++)
if (ObjectsForDelete[j]!="")
{
ObjectDelete(ObjectsForDelete[j]);
}
//----
for(i=0; i<count; i++)
{
if (ObjectFind(ObjectNames
)==-1)
{
ObjectCreate(ObjectNames
,OBJ_TREND,0,iTime(NULL,TimeFrame,TempBufferBar
),TempBufferPrice
,
iTime(NULL,TimeFrame,TempBufferBar
)+10080*60,TempBufferPrice
);
ObjectSet(ObjectNames
,OBJPROP_WIDTH,linewidth);
ObjectSet(ObjectNames
,OBJPROP_COLOR,LineColor);
ObjectSet(ObjectNames
,OBJPROP_RAY,True);
ObjectSetText(ObjectNames
,ObjectNames
/*+" "+DoubleToStr(TempBufferPrice
,Digits),8,"Courier",LightSteelBlue*/);
}
}
}
//+------------------------------------------------------------------+
作者:
一头牛
时间:
2018-1-11 14:35
求大神帮帮忙
作者:
cjx000
时间:
2018-1-11 14:57
非常牛逼
作者:
陈小佳
时间:
2018-1-11 15:47
666666666666666666666
作者:
diaryflyt
时间:
2018-1-11 17:03
666666666666666666666
作者:
winfyha
时间:
2018-1-11 17:49
感謝分享
作者:
15806593088
时间:
2018-1-11 18:41
谢谢楼主分享!!!
欢迎光临 顺水外汇EA交易网MT4 (http://waterforex.com/)
Powered by Discuz! X3.2