金字塔的各位老大。希望能鼎力帮助一下菜鸟转换一个EasyLanguage语言的指标作为日后学习对照的模板,先叩谢了!
N(16);
{N must be an even number}
Vars: count(0),
N1(0),
N2(0),
N3(0),
HH(0),
LL(0),
Dimen(0),
alpha(0),
Filt(0);
N3 = (Highest(High, N) - Lowest(Low, N)) / N;
HH = High;
LL = Low;
For count = 0 to N / 2 - 1 begin
If High[count] > HH then HH = High[count];
If Low[count] < LL then LL = Low[count];
End;
N1 = (HH - LL) / (N / 2);
HH = High[N / 2];
LL = Low[N / 2];
For count = N/2 to N - 1 begin
If High[count] > HH then HH = High[count];
If Low[count] < LL then LL = Low[count];
End;
N2 = (HH - LL) / (N / 2);
If N1 > 0 and N2 > 0 and N3 > 0 then Dimen = (Log(N1 + N2) - Log(N3)) / Log(2);
alpha = ExpValue(-4.6*(Dimen - 1));
If alpha < 0.01 then alpha = 0.01;
If alpha > 1 then alpha = 1;
Filt = alpha*Price + (1 - alpha)*Filt[1];
If CurrentBar < N + 1 then Filt = Price;
Plot1(Filt);
再贴个简单的模型源码,请帮助转换。谢过了!
Inputs: Length(16),
PH( ( ( (H+L+C) / 3) * 2) - L),
PL( ( ( (H+L+C) / 3) * 2) - H);
{-------- Long Entry --------}
Buy Next Bar at Highest(PH,Length) + 1 Point Stop;
{-------- Short Entry --------}
Sell Next Bar at Lowest(PL,Length) - 1 Point Stop