커뮤니티

수식 부탁드립니다

프로필 이미지
오이도인
2022-06-06 22:20:59
1209
글번호 159612
답변완료

첨부 이미지

수고하십니다. 아래 신호식에서 조건 완성되어 신호 발생 이후 첨부 그림처럼 3봉 경과 후에 신호 방향과 반대로 진행되는 경우에 반대 신호가 나오도록 신호식 추가 부탁 드립니다. 감사합니다. 수고하세요.. ############### 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); Buy(); } 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); Sell(); } Else { ShortLineMarker = Nan; #TL_SetEnd(TL2,sDate,sTime,V2); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-06-07 14:38:29

안녕하세요 예스스탁입니다. 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); Buy(); } 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); Sell(); } Else { ShortLineMarker = Nan; #TL_SetEnd(TL2,sDate,sTime,V2); } if MarketPosition == 1 and BarsSinceEntry >= 3 and C < L[BarsSinceEntry] Then Sell("bs"); if MarketPosition == -1 and BarsSinceEntry >= 3 and C > H[BarsSinceEntry] Then Buy("sb"); 즐거운 하루되세요 > 오이도인 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다 > 수고하십니다. 아래 신호식에서 조건 완성되어 신호 발생 이후 첨부 그림처럼 3봉 경과 후에 신호 방향과 반대로 진행되는 경우에 반대 신호가 나오도록 신호식 추가 부탁 드립니다. 감사합니다. 수고하세요.. ############### 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); Buy(); } 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); Sell(); } Else { ShortLineMarker = Nan; #TL_SetEnd(TL2,sDate,sTime,V2); }