커뮤니티
문의
2013-02-22 19:09:24
844
글번호 59871
solar wind 란 지표인데
예스에서 지원안하는것 같더라구요
#property copyright "Copyright ?2005, Yura Prokofiev"
#property link "Yura.prokofiev@gmail.com"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Black
#property indicator_color2 Blue
#property indicator_color3 Red
extern int period=10;
extern bool DoAlert = true;
double ExtBuffer0[];
double ExtBuffer1[];
double ExtBuffer2[];
int init()
{
SetIndexStyle(0,DRAW_NONE);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_HISTOGRAM);
IndicatorDigits(Digits+1);
SetIndexBuffer(0,ExtBuffer0);
SetIndexBuffer(1,ExtBuffer1);
SetIndexBuffer(2,ExtBuffer2);
IndicatorShortName("SOLAR WIND");
SetIndexLabel(1,NULL);
SetIndexLabel(2,NULL);
return(0);
}
int start()
{
//int period=10;
int limit;
int counted_bars=IndicatorCounted();
double prev,current,old;
double Value=0,Value1=0,Value2=0,Fish=0,Fish1=0,Fish2=0;
double price;
double MinL=0;
double MaxH=0;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; i<limit; i++)
{ MaxH = High[Highest(NULL,0,MODE_HIGH,period,i)];
MinL = Low[Lowest(NULL,0,MODE_LOW,period,i)];
price = (High[i]+Low[i])/2;
Value = 0.33*2*((price-MinL)/(MaxH-MinL)-0.5) + 0.67*Value1;
Value=MathMin(MathMax(Value,-0.999),0.999);
ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
Value1=Value;
Fish1=ExtBuffer0[i];
}
bool up=true;
static datetime cDT = 0;
if (cDT == 0) { cDT = iTime(NULL,0,0); } // Don't alert when start
for(i=limit-2; i>=0; i--)
{
current=ExtBuffer0[i];
prev=ExtBuffer0[i+1];
if (((current<0)&&(prev>0))||(current<0)) up= false;
if (((current>0)&&(prev<0))||(current>0)) up= true;
if(!up)
{
ExtBuffer2[i]=current;
ExtBuffer1[i]=0.0;
if (DoAlert && (cDT != iTime(NULL,0,0)) && (ExtBuffer2[i+1]==0))
{
cDT = iTime(NULL,0,0);
Print("** Solar wind crossed down");
PlaySound("Alert1.wav");
}
}
else
{
ExtBuffer1[i]=current;
ExtBuffer2[i]=0.0;
if (DoAlert && (cDT != iTime(NULL,0,0)) && (ExtBuffer1[i+1]==0))
{
cDT = iTime(NULL,0,0);
Print("** Solar wind crossed up");
PlaySound("Alert1.wav");
}
}
}
return(0);
}
위소스인데 예스에 적용하려면 어찌하는지요??
=====
//+------------------------------------------------------------------+
//| TrendEnvelopes_v1.mq4 |
//| Copyright ?2006, TrendLaboratory Ltd. |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//| E-mail: igorad2003@yahoo.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, TrendLaboratory Ltd."
#property link "http://finance.groups.yahoo.com/group/TrendLaboratory"
//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LightBlue
#property indicator_color2 Orange
#property indicator_width1 2
#property indicator_width2 2
#property indicator_color3 LightBlue
#property indicator_color4 Orange
#property indicator_width3 2
#property indicator_width4 2
//---- indicator parameters
extern int MA_Period =14;
extern int MA_Shift =0;
extern int MA_Method =3;
extern int Applied_Price=0;
extern double Deviation =0.2;
extern int UseSignal =0;
//---- indicator buffers
double UpBuffer[];
double DnBuffer[];
double UpSignal[];
double DnSignal[];
double smax[];
double smin[];
double trend[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
int draw_begin;
string short_name;
//---- drawing settings
IndicatorBuffers(7);
SetIndexStyle(0,DRAW_LINE);
SetIndexShift(0,MA_Shift);
SetIndexStyle(1,DRAW_LINE);
SetIndexShift(1,MA_Shift);
//
SetIndexStyle(2,DRAW_ARROW);
SetIndexShift(2,MA_Shift);
SetIndexArrow(2,233);
SetIndexStyle(3,DRAW_ARROW);
SetIndexShift(3,MA_Shift);
SetIndexArrow(3,234);
//
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
if(MA_Period<2) MA_Period=14;
draw_begin=MA_Period-1;
//---- indicator short name
IndicatorShortName("Env("+MA_Period+")");
SetIndexLabel(0,"UpTrendEnv");
SetIndexLabel(1,"DnTrendEnv");
SetIndexLabel(2,"UpSignal");
SetIndexLabel(3,"DnSignal");
SetIndexDrawBegin(0,draw_begin);
SetIndexDrawBegin(1,draw_begin);
SetIndexDrawBegin(2,draw_begin);
SetIndexDrawBegin(3,draw_begin);
//---- indicator buffers mapping
SetIndexBuffer(0,UpBuffer);
SetIndexBuffer(1,DnBuffer);
SetIndexBuffer(2,UpSignal);
SetIndexBuffer(3,DnSignal);
SetIndexBuffer(4,smax);
SetIndexBuffer(5,smin);
SetIndexBuffer(6,trend);
if(Deviation<0.1) Deviation=0.1;
if(Deviation>100.0) Deviation=100.0;
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
if(Bars<=MA_Period) return(0);
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
if (ExtCountedBars>0) ExtCountedBars--;
limit=Bars-ExtCountedBars;
//---- EnvelopesM counted in the buffers
for(int i=limit; i>=0; i--)
{
smax[i]=(1+Deviation/100)*iMA(NULL,0,MA_Period,0,MA_Method,Applied_Price,i);
smin[i]=(1-Deviation/100)*iMA(NULL,0,MA_Period,0,MA_Method,Applied_Price,i);
trend[i]=trend[i+1];
if (Close[i]>smax[i+1]) trend[i]=1;
if (Close[i]<smin[i+1]) trend[i]=-1;
if(trend[i]>0)
{
if (smin[i]<smin[i+1]) smin[i]=smin[i+1];
UpBuffer[i]=smin[i];
if (UseSignal>0)
if (trend[i+1]<0) UpSignal[i]=Low[i]-0.5*iATR(NULL,0,MA_Period,i);
DnBuffer[i]=EMPTY_VALUE;
}
else
{
if(smax[i]>smax[i+1]) smax[i]=smax[i+1];
DnBuffer[i]=smax[i];
if (UseSignal>0)
if (trend[i+1]>0) DnSignal[i]=High[i]+0.5*iATR(NULL,0,MA_Period,i);
UpBuffer[i]=EMPTY_VALUE;
}
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
위소스 총 2개 변환부탁드립니다
답변 1
예스스탁 예스스탁 답변
2013-02-25 08:37:44
안녕하세요
예스스탁입니다.
죄송합니다. 해당 랭귀지는 사용해본적이 없어
어떤 내용인지 정확히 모르겠습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> 디프론티어 님이 쓴 글입니다.
> 제목 : 문의
> solar wind 란 지표인데
예스에서 지원안하는것 같더라구요
#property copyright "Copyright ?2005, Yura Prokofiev"
#property link "Yura.prokofiev@gmail.com"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Black
#property indicator_color2 Blue
#property indicator_color3 Red
extern int period=10;
extern bool DoAlert = true;
double ExtBuffer0[];
double ExtBuffer1[];
double ExtBuffer2[];
int init()
{
SetIndexStyle(0,DRAW_NONE);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_HISTOGRAM);
IndicatorDigits(Digits+1);
SetIndexBuffer(0,ExtBuffer0);
SetIndexBuffer(1,ExtBuffer1);
SetIndexBuffer(2,ExtBuffer2);
IndicatorShortName("SOLAR WIND");
SetIndexLabel(1,NULL);
SetIndexLabel(2,NULL);
return(0);
}
int start()
{
//int period=10;
int limit;
int counted_bars=IndicatorCounted();
double prev,current,old;
double Value=0,Value1=0,Value2=0,Fish=0,Fish1=0,Fish2=0;
double price;
double MinL=0;
double MaxH=0;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; i<limit; i++)
{ MaxH = High[Highest(NULL,0,MODE_HIGH,period,i)];
MinL = Low[Lowest(NULL,0,MODE_LOW,period,i)];
price = (High[i]+Low[i])/2;
Value = 0.33*2*((price-MinL)/(MaxH-MinL)-0.5) + 0.67*Value1;
Value=MathMin(MathMax(Value,-0.999),0.999);
ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
Value1=Value;
Fish1=ExtBuffer0[i];
}
bool up=true;
static datetime cDT = 0;
if (cDT == 0) { cDT = iTime(NULL,0,0); } // Don't alert when start
for(i=limit-2; i>=0; i--)
{
current=ExtBuffer0[i];
prev=ExtBuffer0[i+1];
if (((current<0)&&(prev>0))||(current<0)) up= false;
if (((current>0)&&(prev<0))||(current>0)) up= true;
if(!up)
{
ExtBuffer2[i]=current;
ExtBuffer1[i]=0.0;
if (DoAlert && (cDT != iTime(NULL,0,0)) && (ExtBuffer2[i+1]==0))
{
cDT = iTime(NULL,0,0);
Print("** Solar wind crossed down");
PlaySound("Alert1.wav");
}
}
else
{
ExtBuffer1[i]=current;
ExtBuffer2[i]=0.0;
if (DoAlert && (cDT != iTime(NULL,0,0)) && (ExtBuffer1[i+1]==0))
{
cDT = iTime(NULL,0,0);
Print("** Solar wind crossed up");
PlaySound("Alert1.wav");
}
}
}
return(0);
}
위소스인데 예스에 적용하려면 어찌하는지요??
=====
//+------------------------------------------------------------------+
//| TrendEnvelopes_v1.mq4 |
//| Copyright ?2006, TrendLaboratory Ltd. |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//| E-mail: igorad2003@yahoo.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, TrendLaboratory Ltd."
#property link "http://finance.groups.yahoo.com/group/TrendLaboratory"
//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LightBlue
#property indicator_color2 Orange
#property indicator_width1 2
#property indicator_width2 2
#property indicator_color3 LightBlue
#property indicator_color4 Orange
#property indicator_width3 2
#property indicator_width4 2
//---- indicator parameters
extern int MA_Period =14;
extern int MA_Shift =0;
extern int MA_Method =3;
extern int Applied_Price=0;
extern double Deviation =0.2;
extern int UseSignal =0;
//---- indicator buffers
double UpBuffer[];
double DnBuffer[];
double UpSignal[];
double DnSignal[];
double smax[];
double smin[];
double trend[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
int draw_begin;
string short_name;
//---- drawing settings
IndicatorBuffers(7);
SetIndexStyle(0,DRAW_LINE);
SetIndexShift(0,MA_Shift);
SetIndexStyle(1,DRAW_LINE);
SetIndexShift(1,MA_Shift);
//
SetIndexStyle(2,DRAW_ARROW);
SetIndexShift(2,MA_Shift);
SetIndexArrow(2,233);
SetIndexStyle(3,DRAW_ARROW);
SetIndexShift(3,MA_Shift);
SetIndexArrow(3,234);
//
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
if(MA_Period<2) MA_Period=14;
draw_begin=MA_Period-1;
//---- indicator short name
IndicatorShortName("Env("+MA_Period+")");
SetIndexLabel(0,"UpTrendEnv");
SetIndexLabel(1,"DnTrendEnv");
SetIndexLabel(2,"UpSignal");
SetIndexLabel(3,"DnSignal");
SetIndexDrawBegin(0,draw_begin);
SetIndexDrawBegin(1,draw_begin);
SetIndexDrawBegin(2,draw_begin);
SetIndexDrawBegin(3,draw_begin);
//---- indicator buffers mapping
SetIndexBuffer(0,UpBuffer);
SetIndexBuffer(1,DnBuffer);
SetIndexBuffer(2,UpSignal);
SetIndexBuffer(3,DnSignal);
SetIndexBuffer(4,smax);
SetIndexBuffer(5,smin);
SetIndexBuffer(6,trend);
if(Deviation<0.1) Deviation=0.1;
if(Deviation>100.0) Deviation=100.0;
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
if(Bars<=MA_Period) return(0);
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
if (ExtCountedBars>0) ExtCountedBars--;
limit=Bars-ExtCountedBars;
//---- EnvelopesM counted in the buffers
for(int i=limit; i>=0; i--)
{
smax[i]=(1+Deviation/100)*iMA(NULL,0,MA_Period,0,MA_Method,Applied_Price,i);
smin[i]=(1-Deviation/100)*iMA(NULL,0,MA_Period,0,MA_Method,Applied_Price,i);
trend[i]=trend[i+1];
if (Close[i]>smax[i+1]) trend[i]=1;
if (Close[i]<smin[i+1]) trend[i]=-1;
if(trend[i]>0)
{
if (smin[i]<smin[i+1]) smin[i]=smin[i+1];
UpBuffer[i]=smin[i];
if (UseSignal>0)
if (trend[i+1]<0) UpSignal[i]=Low[i]-0.5*iATR(NULL,0,MA_Period,i);
DnBuffer[i]=EMPTY_VALUE;
}
else
{
if(smax[i]>smax[i+1]) smax[i]=smax[i+1];
DnBuffer[i]=smax[i];
if (UseSignal>0)
if (trend[i+1]>0) DnSignal[i]=High[i]+0.5*iATR(NULL,0,MA_Period,i);
UpBuffer[i]=EMPTY_VALUE;
}
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
위소스 총 2개 변환부탁드립니다