예스스탁
예스스탁 답변
2023-11-17 17:01:02
안녕하세요
예스스탁입니다.
횡보조건 100틱이내만으로는 식작성이 되지 않습니다.
N개봉 100틱 이내 횡보로 작성해 드립니다.
Inputs : Period(170), Sence(1.3), CC_DN(Yellow);
Vars:
VLineUp(0),
VLineDn(0),
HHighest(0),
LLowest(0),
JustChanged(FALSE),
VLine(0), DBN(0);
Array:
Highs[35](0),
Lows[35](0),
RRange[35](0),
UpWave[1](FALSE),
DnWave[1](FALSE);
If STime == 180000 Then
DBN = 0;
DBN = DBN + 1;
Var1 = Period;
Var2 = Var1 - 1;
Var3 = Var1 - 2;
Var5 = Sence;
Var6 = H-L;
JustChanged = FALSE;
if CurrentBar <= Var2 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
RRange[CurrentBar] = (H-L) /2;
end;
if CurrentBar == Var1 then begin
if Highs[Var2] >= Highs[Var3] then begin
UpWave[1] = TRUE;
HHighest = Highs[Var2];
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
#Plot1(VLineUp,"VLineUp");
end;
if Highs[Var2] < Highs[Var3] then begin
DnWave[1] = TRUE;
LLowest = Lows[Var2];
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
#Plot2(VLineDn,"VLineDn");
end;
end;
if CurrentBar > Var1 then begin
if DnWave[1] and Close > VLineDn then begin
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
HHighest = Close;
LLowest = 0;
end;
if UpWave[1] and Close < VLineUp and JustChanged == FALSE then begin
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
LLowest = Close;
HHighest = 0;
end;
if JustChanged == FALSE then begin
if Close > HHighest then
HHighest = Close;
else if Close < LLowest then
LLowest = Close;
end;
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
/*if UpWave[1] then Plot1(VLineUp,"VLineUp", Red);
else if DnWave[1] then Plot1(VLineDn,"VLineUp", Blue);
*/
end;
input : P(10),short(12),long(26),sig(9);
var : mav(0),macdo(0),T(0);
mav = ma(C,P);
MACDo = MACD_OSC(short,long,sig);
input : BBP(20),dv(2),N(10);
var : bbup(0),bbmd(0),bbdn(0);
bbup = BollBandUp(BBP,dv);
bbdn = BollBandDown(BBP,dv);
if T <= 0 and upwave[1] and c > mav and macdo > 0 and C > BBup and highest(BBup,N)[1] <= lowest(BBdn,N)[1]+PriceScale*100 Then
{
t =1;
Buy();
}
if T >= 0 and dnwave[1] and c < mav and macdo < 0 and C < BBdn and highest(BBup,N)[1] <= lowest(BBdn,N)[1]+PriceScale*100 Then
{
T = -1;
Sell();
}
즐거운 하루되세요
> 아트정 님이 쓴 글입니다.
> 제목 : 수식추가
> 안녕하세요
수식추가 부탁드림니다
아라식에서 볼밴 상.하단폭이 100틱이내에서 횡보후
상단으로 돌파시 매수
하단으로 돌파시 매도
Inputs : Period(170), Sence(1.3), CC_DN(Yellow);
Vars:
VLineUp(0),
VLineDn(0),
HHighest(0),
LLowest(0),
JustChanged(FALSE),
VLine(0), DBN(0);
Array:
Highs[35](0),
Lows[35](0),
RRange[35](0),
UpWave[1](FALSE),
DnWave[1](FALSE);
If STime == 180000 Then
DBN = 0;
DBN = DBN + 1;
Var1 = Period;
Var2 = Var1 - 1;
Var3 = Var1 - 2;
Var5 = Sence;
Var6 = H-L;
JustChanged = FALSE;
if CurrentBar <= Var2 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
RRange[CurrentBar] = (H-L) /2;
end;
if CurrentBar == Var1 then begin
if Highs[Var2] >= Highs[Var3] then begin
UpWave[1] = TRUE;
HHighest = Highs[Var2];
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
#Plot1(VLineUp,"VLineUp");
end;
if Highs[Var2] < Highs[Var3] then begin
DnWave[1] = TRUE;
LLowest = Lows[Var2];
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
#Plot2(VLineDn,"VLineDn");
end;
end;
if CurrentBar > Var1 then begin
if DnWave[1] and Close > VLineDn then begin
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
HHighest = Close;
LLowest = 0;
end;
if UpWave[1] and Close < VLineUp and JustChanged == FALSE then begin
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
LLowest = Close;
HHighest = 0;
end;
if JustChanged == FALSE then begin
if Close > HHighest then
HHighest = Close;
else if Close < LLowest then
LLowest = Close;
end;
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
/*if UpWave[1] then Plot1(VLineUp,"VLineUp", Red);
else if DnWave[1] then Plot1(VLineDn,"VLineUp", Blue);
*/
end;
input : P(10),short(12),long(26),sig(9);
var : mav(0),macdo(0),T(0);
mav = ma(C,P);
MACDo = MACD_OSC(short,long,sig);
if T <= 0 and upwave[1] and c > mav and macdo > 0 Then
{
t =1;
Buy();
}
if T >= 0 and dnwave[1] and c < mav and macdo < 0 Then
{
T = -1;
Sell();
}