커뮤니티

수식 변환좀 부탁드립니다.

프로필 이미지
로꼬로꼬
2025-02-28 13:23:05
304
글번호 188663
답변완료
만들어 주신 강조 수식을 신호가 발생시 소리가 나올수 있게 시스템 수식으로 변환좀 요청드립니다. 매번 감사드립니다.^^ input : a(1); input : ATRP(10); input : ha(false); var : xATR(0),nLoss(0); var : xClose(0),xHigh(0),xLow(0),xOpen(0),src(0); var : xATRTrailingStop(0),ps(0),xcolor(0); xATR = atr(ATRP); nLoss = a * xATR; if index == 0 then { xClose = (O+H+L+C)/4; xOpen = open; xHigh = MaxList( high, xOpen, xClose); xLow = MinList( low, xOpen,xClose); } else { xClose = (O+H+L+C)/4; xOpen = (xOpen [1] + xClose [1])/2 ; xHigh = MaxList(High, xOpen, xClose) ; xLow = MinList(Low, xOpen, xClose) ; } if ha == False Then src = close; Else src = xClose; var1 = IFf(IsNan(xATRTrailingStop[1]) ==true,0,xATRTrailingStop[1]); xATRTrailingStop =iff(src > var1 and src[1] > var1, max(var1, src - nLoss), iff(src < var1 and src[1] < var1, min(var1, src + nLoss), iff(src > var1, src - nLoss, src + nLoss))); ps = iff(src[1] < var1 and src > var1, 1, iff(src[1] > var1 and src < var1, -1, IFf(IsNaN(ps[1])==true,0,ps[1]))); xcolor = iff(ps == -1 , red, IFf(ps == 1 , green , blue)); var : emv(0),above(False),below(False); var : b(False),s(False),barbuy(False),barsell(False),tx(0); emv = ema(src,1); above = CrossUp(emv, xATRTrailingStop); below = CrossUp(xATRTrailingStop, emv); b = src > xATRTrailingStop and above; s = src < xATRTrailingStop and below; barbuy = src > xATRTrailingStop; barsell = src < xATRTrailingStop ; if b == true Then { tx = Text_New(sDate,sTime,L,"▲"); Text_SetStyle(tx,2,0); Text_SetColor(tx,Green); } if s == true Then { tx = Text_New(sDate,sTime,H,"▼"); Text_SetStyle(tx,2,1); Text_SetColor(tx,Red); } if barbuy == true Then PlotPaintBar(H,L,"강조",Green); if barsell == true Then PlotPaintBar(H,L,"강조",Red);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-02-28 13:34:25

안녕하세요 예스스탁입니다. input : a(1); input : ATRP(10); input : ha(false); var : xATR(0),nLoss(0); var : xClose(0),xHigh(0),xLow(0),xOpen(0),src(0); var : xATRTrailingStop(0),ps(0),xcolor(0); xATR = atr(ATRP); nLoss = a * xATR; if index == 0 then { xClose = (O+H+L+C)/4; xOpen = open; xHigh = MaxList( high, xOpen, xClose); xLow = MinList( low, xOpen,xClose); } else { xClose = (O+H+L+C)/4; xOpen = (xOpen [1] + xClose [1])/2 ; xHigh = MaxList(High, xOpen, xClose) ; xLow = MinList(Low, xOpen, xClose) ; } if ha == False Then src = close; Else src = xClose; var1 = IFf(IsNan(xATRTrailingStop[1]) ==true,0,xATRTrailingStop[1]); xATRTrailingStop =iff(src > var1 and src[1] > var1, max(var1, src - nLoss), iff(src < var1 and src[1] < var1, min(var1, src + nLoss), iff(src > var1, src - nLoss, src + nLoss))); ps = iff(src[1] < var1 and src > var1, 1, iff(src[1] > var1 and src < var1, -1, IFf(IsNaN(ps[1])==true,0,ps[1]))); xcolor = iff(ps == -1 , red, IFf(ps == 1 , green , blue)); var : emv(0),above(False),below(False); var : b(False),s(False),barbuy(False),barsell(False),tx(0); emv = ema(src,1); above = CrossUp(emv, xATRTrailingStop); below = CrossUp(xATRTrailingStop, emv); b = src > xATRTrailingStop and above; s = src < xATRTrailingStop and below; barbuy = src > xATRTrailingStop; barsell = src < xATRTrailingStop ; if b == true Then { Buy("b"); } if s == true Then { Sell("s"); } 즐거운 하루되세요 > 로꼬로꼬 님이 쓴 글입니다. > 제목 : 수식 변환좀 부탁드립니다. > 만들어 주신 강조 수식을 신호가 발생시 소리가 나올수 있게 시스템 수식으로 변환좀 요청드립니다. 매번 감사드립니다.^^ input : a(1); input : ATRP(10); input : ha(false); var : xATR(0),nLoss(0); var : xClose(0),xHigh(0),xLow(0),xOpen(0),src(0); var : xATRTrailingStop(0),ps(0),xcolor(0); xATR = atr(ATRP); nLoss = a * xATR; if index == 0 then { xClose = (O+H+L+C)/4; xOpen = open; xHigh = MaxList( high, xOpen, xClose); xLow = MinList( low, xOpen,xClose); } else { xClose = (O+H+L+C)/4; xOpen = (xOpen [1] + xClose [1])/2 ; xHigh = MaxList(High, xOpen, xClose) ; xLow = MinList(Low, xOpen, xClose) ; } if ha == False Then src = close; Else src = xClose; var1 = IFf(IsNan(xATRTrailingStop[1]) ==true,0,xATRTrailingStop[1]); xATRTrailingStop =iff(src > var1 and src[1] > var1, max(var1, src - nLoss), iff(src < var1 and src[1] < var1, min(var1, src + nLoss), iff(src > var1, src - nLoss, src + nLoss))); ps = iff(src[1] < var1 and src > var1, 1, iff(src[1] > var1 and src < var1, -1, IFf(IsNaN(ps[1])==true,0,ps[1]))); xcolor = iff(ps == -1 , red, IFf(ps == 1 , green , blue)); var : emv(0),above(False),below(False); var : b(False),s(False),barbuy(False),barsell(False),tx(0); emv = ema(src,1); above = CrossUp(emv, xATRTrailingStop); below = CrossUp(xATRTrailingStop, emv); b = src > xATRTrailingStop and above; s = src < xATRTrailingStop and below; barbuy = src > xATRTrailingStop; barsell = src < xATRTrailingStop ; if b == true Then { tx = Text_New(sDate,sTime,L,"▲"); Text_SetStyle(tx,2,0); Text_SetColor(tx,Green); } if s == true Then { tx = Text_New(sDate,sTime,H,"▼"); Text_SetStyle(tx,2,1); Text_SetColor(tx,Red); } if barbuy == true Then PlotPaintBar(H,L,"강조",Green); if barsell == true Then PlotPaintBar(H,L,"강조",Red);