답변완료
수식 부탁드립니다
수고 하십니다.
아래 식을 시스템 신호식으로 부탁드립니다.
감사합니다. 수고하세요..
###########
input : SFactor(6.138),SPd(10),lenColoured(36),lenSlow(178),hideSuperTrend(true);
var : src(0),len(0),ma_coloured(0),ma_slow(0),clrdirection(0);
var : TL1(0),TL2(0),v1(0),v2(0);
src = close;
len = lenColoured;
ma_coloured = wma(2 * wma(src, len / 3) - wma(src, len), round(sqrt(len),0));
ma_slow = Ema(src,lenslow);
if ma_coloured > ma_coloured[13] then
clrdirection = 1;
else if ma_coloured < ma_coloured[13] then
clrdirection = -1;
else
clrdirection = clrdirection;
var : hl2(0),ATRV(0),SUp(0),SDn(0),STrendUp(0),STrendDown(0);
var : STrend(0),stbuy(0),stsell(0),long(False),short(False);
var : LongLineMarker(0),ShortLineMarker(0),tx(0);
hl2 = (H+L)/2;
ATRV = ATR(SPd);
SUp = hl2-(SFactor*atrv);
SDn = hl2+(SFactor*atrv);
if C[1] > STrendUp[1] Then
STrendUp = max(SUp,iff(isnan(STrendUp[1])==False,STrendUp[1],0));
else
STrendUp = SUp;
if close[1] < STrendDown[1] then
STrendDown = min(SDn,iff(isnan(STrendDown[1]) == False,STrendDown[1],0));
else
STrendDown = SDn;
if close > IFf(IsNan(STrendDown[1]) == False, STrendDown[1],0) then
STrend = 1;
else if close< IFf(IsNan(STrendUp[1]) == False, STrendUp[1],0) then
STrend = -1;
else
STrend = IFf(IsNan(STrend[1]) == False, STrend[1],1);
if clrdirection == 1 and STrend==1 then
stbuy = stbuy +1;
else
stbuy = 0;
if clrdirection ==-1 and STrend==-1 then
stsell = stsell+1 ;
else
stsell = 0;
If stbuy == 1 then
long = true;
else
long = False;
if stSell == 1 then
short = true;
else
short = False ;
if long then
{
LongLineMarker = low;
tx = Text_New(sDate,sTime,LongLineMarker,"▲");
Text_SetColor(tx,Green);
Text_SetStyle(tx,2,0);
v1 = LongLineMarker;
#TL1 = TL_New(sDate,sTime,v1,NextBarSdate,NextBarStime,v1);
#TL_SetColor(TL1,Green);
}
Else
{
LongLineMarker = Nan;
#TL_SetEnd(TL1,sDate,sTime,v1);
}
if short then
{
ShortLineMarker = High;
tx = Text_New(sDate,sTime,ShortLineMarker,"▼");
Text_SetColor(tx,Red);
Text_SetStyle(tx,2,1);
v2 = ShortLineMarker;
#TL2 = TL_New(sDate,sTime,v2,NextBarSdate,NextBarStime,v2);
#TL_SetColor(TL2,Red);
}
Else
{
ShortLineMarker = Nan;
#TL_SetEnd(TL2,sDate,sTime,V2);
}
2022-05-19
836
글번호 159027
시스템