예스스탁
예스스탁 답변
2022-11-29 14:21:51
안녕하세요
예스스탁입니다.
1
input : Factor(7),Pd(10),highPd(1),lowPd(1);
input : 쌍봉상(5),쌍봉하(5),쌍바닥상(5),쌍바닥하(5);
var : sp(0),th(0),ll(0),myh(0),myl(0),up(0),dn(0),ii(0),Trendup(0),trenddown(0),Trend(0);
var : Tsl(0),linecolor(0),tx(0),tl(0),tx1(0),tx2(0);
sp = (H+L+c)/3;
th = high;
for ii = 1 to Pd*highPd
{
if th < high[ii] Then
th = high[ii];
}
ll = low;
for ii=1 to Pd*lowPd
{
if ll > low[ii] Then
ll = low[ii];
}
myh = ma(high,Pd)*0.4+th*0.6;
myl = (ma(sp,Pd)*0.5+ll*0.5);
Up = myl-(Factor*atr(Pd)*0.8 );
Dn = (myh+(Factor*atr(Pd) ));
TrendUp = iff(sp[1]>TrendUp[1], max(Up,TrendUp[1]) , Up);
TrendDown = iff(sp[1]<TrendDown[1], min(Dn,TrendDown[1]) , Dn);
Trend = iff(sp > TrendDown[1] , 1, iff(sp< TrendUp[1] , -1, Trend[1]));
Tsl = IFF(Trend==1, TrendUp, TrendDown);
linecolor = IFF(Trend == 1 , Red , Blue);
plot1(Tsl,"SuperTrend",linecolor);
if Trend != Trend[1] Then
{
if Trend == 1 Then
{
var1 = Tsl[1];
var2 = var1[1];
tx = Text_New(sDate,sTime, Tsl-PriceScale*0,"●");
Text_SetColor(tx,Green);
Text_SetSize(tx,18);
Text_SetStyle(tx,2,2);
if Var2 > 0 and var1 <= Var2+PriceScale*쌍바닥상 and var1 >= Var2-PriceScale*쌍바닥하 Then
{
TL_New(sDate,sTime,0,sDate,stime,99999999);
tx1 = Text_New(sDate,sTime, Tsl-PriceScale*2,"●");
Text_SetColor(tx1,Blue);
Text_SetSize(tx1,18);
Text_SetStyle(tx1,2,0);
}
}
Else
{
Var3 = Tsl[1];
Var4 = Var3[1];
tx = Text_New(sDate,sTime, Tsl+PriceScale*0,"●");
Text_SetColor(tx,Magenta);
Text_SetSize(tx,15);
Text_SetStyle(tx,2,2);
if Var4 > 0 and var3 <= Var4+PriceScale*쌍봉상 and var3 >= Var4-PriceScale*쌍봉하 Then
{
tx2 = Text_New(sDate,sTime, Tsl+PriceScale*2,"●");
Text_SetColor(tx2,Red);
Text_SetSize(tx2,15);
Text_SetStyle(tx2,2,1);
}
}
}
2
input : Factor(7),Pd(10),highPd(1),lowPd(1);
input : 쌍봉상(5),쌍봉하(5),쌍바닥상(5),쌍바닥하(5);
var : sp(0),th(0),ll(0),myh(0),myl(0),up(0),dn(0),ii(0),Trendup(0),trenddown(0),Trend(0);
var : Tsl(0),linecolor(0),tx(0),tl(0),tx1(0),tx2(0);
sp = (H+L+c)/3;
th = high;
for ii = 1 to Pd*highPd
{
if th < high[ii] Then
th = high[ii];
}
ll = low;
for ii=1 to Pd*lowPd
{
if ll > low[ii] Then
ll = low[ii];
}
myh = ma(high,Pd)*0.4+th*0.6;
myl = (ma(sp,Pd)*0.5+ll*0.5);
Up = myl-(Factor*atr(Pd)*0.8 );
Dn = (myh+(Factor*atr(Pd) ));
TrendUp = iff(sp[1]>TrendUp[1], max(Up,TrendUp[1]) , Up);
TrendDown = iff(sp[1]<TrendDown[1], min(Dn,TrendDown[1]) , Dn);
Trend = iff(sp > TrendDown[1] , 1, iff(sp< TrendUp[1] , -1, Trend[1]));
Tsl = IFF(Trend==1, TrendUp, TrendDown);
linecolor = IFF(Trend == 1 , Red , Blue);
if Trend != Trend[1] Then
{
if Trend == 1 Then
{
var1 = Tsl[1];
var2 = var1[1];
tx = Text_New(sDate,sTime, Tsl-PriceScale*0,"●");
Text_SetColor(tx,Green);
Text_SetSize(tx,18);
Text_SetStyle(tx,2,2);
if Var2 > 0 and var1 <= Var2+PriceScale*쌍바닥상 and var1 >= Var2-PriceScale*쌍바닥하 Then
{
TL_New(sDate,sTime,0,sDate,stime,99999999);
tx1 = Text_New(sDate,sTime, Tsl-PriceScale*2,"●");
Text_SetColor(tx1,Blue);
Text_SetSize(tx1,18);
Text_SetStyle(tx1,2,0);
Buy();
}
}
Else
{
Var3 = Tsl[1];
Var4 = Var3[1];
tx = Text_New(sDate,sTime, Tsl+PriceScale*0,"●");
Text_SetColor(tx,Magenta);
Text_SetSize(tx,15);
Text_SetStyle(tx,2,2);
if Var4 > 0 and var3 <= Var4+PriceScale*쌍봉상 and var3 >= Var4-PriceScale*쌍봉하 Then
{
tx2 = Text_New(sDate,sTime, Tsl+PriceScale*2,"●");
Text_SetColor(tx2,Red);
Text_SetSize(tx2,15);
Text_SetStyle(tx2,2,1);
Sell();
}
}
}
즐거운 하루되세요
> 고성 님이 쓴 글입니다.
> 제목 : 슈퍼트렌드 쌍바닥 쌍봉
> input : Factor(7),Pd(10),highPd(1),lowPd(5);
var : sp(0),th(0),ll(0),myh(0),myl(0),up(0),dn(0),ii(0),Trendup(0),trenddown(0),Trend(0);
var : Tsl(0),linecolor(0),tx(0),tl(0);
sp = (H+L+c)/3;
th = high;
for ii = 1 to Pd*highPd
{
if th < high[ii] Then
th = high[ii];
}
ll = low;
for ii=1 to Pd*lowPd
{
if ll > low[ii] Then
ll = low[ii];
}
myh = ma(high,Pd)*0.4+th*0.6;
myl = (ma(sp,Pd)*0.5+ll*0.5);
Up = myl-(Factor*atr(Pd)*0.8 );
Dn = (myh+(Factor*atr(Pd) ));
TrendUp = iff(sp[1]>TrendUp[1], max(Up,TrendUp[1]) , Up);
TrendDown = iff(sp[1]<TrendDown[1], min(Dn,TrendDown[1]) , Dn);
Trend = iff(sp > TrendDown[1] , 1, iff(sp< TrendUp[1] , -1, Trend[1]));
Tsl = IFF(Trend==1, TrendUp, TrendDown);
linecolor = IFF(Trend == 1 , Red , Blue);
plot1(Tsl,"SuperTrend",linecolor);
if Trend != Trend[1] Then
{
if Trend == 1 Then
{
tx = Text_New(sDate,sTime, Tsl-PriceScale*0,"●");
Text_SetColor(tx,Green);
Text_SetSize(tx,18);
Text_SetStyle(tx,2,2);
}
Else
{
tx = Text_New(sDate,sTime, Tsl+PriceScale*1,"●");
Text_SetColor(tx,Magenta);
Text_SetSize(tx,15);
Text_SetStyle(tx,2,2);
}
}
1.지표식: 변수 분리해서 쌍바닥,쌍봉에 동그라미 추가. 변수 상하로도 또 분리.
2.시스템: 쌍바닥 매수,다음 봉에 매수청산. 쌍봉에 매도,다음 봉에 매도청산. 감사합니다.