답변완료
수식 가격선 위아래로 추세선 수식 부탁드립니다
아래 수식(var5,"가격선")에 대하여 가격선을 기준으로 위아래로 추세선 수식
부탁드립니다
if Bdate != Bdate[1] Then
{
var1 = 0;
var2 = 0;
}
var1 = var1+ma(upVol,5);
var2 = var2+ma(downVol,5);
Var3 = var1-Var2;
var4 = var3-ema(var3,9);
if CrossUp(0,Var4) Then
var5 = C;
Plot7(var5,"가격선");
답변완료
문의드립니다.
아래의 트레이딩뷰 수식을 변환부탁드립니다.
입력값은 수정가능하게 부탁드립니다.
항상 감사드립니다. 수고하세요!!!
===============================
//@version=5
indicator("ATR Trailing Stop Strategy (Sylvain Vervoort)", overlay = true)
// 입력값
nATRPeriod = input.int(5, "ATR Period")
nATRMultip = input.float(1.5, "ATR Multiplier")
// ATR 계산
atrValue = ta.atr(nATRPeriod)
nLoss = nATRMultip * atrValue
// Trailing Stop 변수 선언
var float xATRTrailingStop = na
// 로직
if (close > nz(xATRTrailingStop[1], 0) and close[1] > nz(xATRTrailingStop[1], 0))
xATRTrailingStop := math.max(nz(xATRTrailingStop[1]), close - nLoss)
else if (close < nz(xATRTrailingStop[1], 0) and close[1] < nz(xATRTrailingStop[1], 0))
xATRTrailingStop := math.min(nz(xATRTrailingStop[1]), close + nLoss)
else if (close > nz(xATRTrailingStop[1], 0))
xATRTrailingStop := close - nLoss
else
xATRTrailingStop := close + nLoss
// 현재 방향
longCondition = close > xATRTrailingStop
shortCondition = close < xATRTrailingStop
// 시그널
longSignal = longCondition and not longCondition[1] // 롱 전환
shortSignal = shortCondition and not shortCondition[1] // 숏 전환
// 차트 표시
plot(xATRTrailingStop[1], color=color.blue, title="ATR Trailing Stop", linewidth=2)
// 시그널 마커
plotshape(longSignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.large, text="BUY")
plotshape(shortSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.large, text="SELL")
=======================================================
답변완료
부탁드립니다.
아래 수식을 강세약세로 만들어 주세요
Plot2(ATR_당일캔들_추세밴드_상단,"ATR_당일캔들_추세밴드_상단",
ifF(ATR_당일캔들_추세밴드_변환 > 0, rgb(242, 192, 192), rgb(149, 224, 249)), Def,
iFF(ATR_당일캔들_추세밴드_수평 > 0,2,4) );
Plot3(ATR_당일캔들_추세밴드_하단,"ATR_당일캔들_추세밴드_하단",
ifF(ATR_당일캔들_추세밴드_변환 > 0,rgb(242, 192, 192), rgb(149, 224, 249)), Def,
iFF(DayIndex < 30 && ATR_당일캔들_추세밴드_변환 > 0 && Abs(H - DayOpen)/PriceScale < 3, 10,
iFF(ATR_당일캔들_추세밴드_수평 > 0, 2,
IFF(ATR_당일캔들_추세밴드_Cnt < 0 && ATR_당일캔들_추세밴드_Cnt > -6,2, 4)) ));
답변완료
부틱드립니다
수고하십니다
아래수식 Plot1,Plot2,Plot3을 아닌 캔들 저가에 각각"▲"표시
화면rsi에도 각각 "▲" 표시 수식부탁드립니다
input : 기간(14);
var : S(0),R(0),u40(0),u30(0),순번조건(False);
var : cs(Nan),조건1(False),조건2(False),조건3(False);
S=Accum(1);
R=Rsi(기간);//14
if CrossDown(R,40) Then
u40 = S;
if CrossDown(R,30) Then
u30 = S;
순번조건=U40<u30 ;
if 순번조건 && 순번조건[1] == False Then
cs = 0;
if Crossup(R,30) Then
cs = cs+1;
조건1 = cs==1;
조건2 = cs==2;
조건3 = cs==3;
if 조건1 and 조건1[1] ==False Then
var1 = L;
if 조건2 and 조건2[1] ==False Then
var2 = L;
if 조건3 and 조건3[1] ==False Then
var3 = L;
Plot1(Var1);
Plot2(Var2);
Plot3(Var3);