답변완료
문의드립니다.
아래의 트레이딩뷰 수식을 변환부탁드립니다.
=====================
/ Input parameters
lookback = input.int(5, "Pivot Lookback", minval=1, step=1) // Swing high/low lookback period for Liquidity Swings
stopLossBuffer = input.float(0.5, "Stop Loss Buffer %", minval=0.1, step=0.1) // Buffer for initial stop loss
// --- Liquidity Swings Indicator (Simulated with Pivot High/Low) ---
pivotHigh1h = ta.pivothigh(high, lookback, lookback)
pivotLow1h = ta.pivotlow(low, lookback, lookback)
// Store latest support/resistance levels
var float resistance1h = na
var float support1h = na
if not na(pivotHigh1h)
resistance1h := pivotHigh1h
if not na(pivotLow1h)
support1h := pivotLow1h
// --- Entry Signals (Strictly at 1h Support/Resistance) ---
// Long: Price crosses above support (swing low) and is below resistance
// Short: Price crosses below resistance (swing high) and is above support
buySignal = ta.crossover(low, support1h) and close < resistance1h
sellSignal = ta.crossunder(high, resistance1h) and close > support1h
// --- Stop Loss and Take Profit ---
// Initial stop loss: Below support (for long) or above resistance (for short) with buffer
slLong = support1h * (1 - stopLossBuffer / 100)
slShort = resistance1h * (1 + stopLossBuffer / 100)
// --- Take Profit Logic (1:2 Risk-Reward) ---
var float entryPrice = na
var float initialStopLoss = na
var float takeProfitPrice = na
// Track entry and stop loss
if buySignal
entryPrice := close
initialStopLoss := slLong
takeProfitPrice := entryPrice + 2 * (entryPrice - initialStopLoss)
if sellSignal
entryPrice := close
initialStopLoss := slShort
takeProfitPrice := entryPrice - 2 * (initialStopLoss - entryPrice)
// --- Stop Loss on Support/Resistance Breakout ---
// Breakout: Price closes below support (for long) or above resistance (for short)
stopLong = close < support1h
stopShort = close > resistance1h
// --- Strategy ---
if (buySignal)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", "Long", stop=stopLong ? support1h : slLong, limit=takeProfitPrice)
if (sellSignal)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", "Short", stop=stopShort ? resistance1h : slShort, limit=takeProfitPrice)
// --- Visualization ---
plot(resistance1h, "1h Resistance", color=color.red, linewidth=1, offset=-lookback)
plot(support1h, "1h Support", color=color.green, linewidth=1, offset=-lookback)
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
===================
생성되는 라인은 차트에 표시되게 또는 안되게 선택할수 있고, 삼각형신호가 확실하게 표현되었으면 합니다. 위 지표를 지표수식과 시스템수식으로 각각 부탁드립니다. 지표값은 변경가능하게 부탁드립니다.
항상 감사드립니다. 수고하세요!!!
2025-06-10
212
글번호 191574
지표
답변완료
키움 수식을 변환부탁
안녕 하세요 하기 키움 수식을 변환부탁 드려도 될까요? 매번 감사 드립니다.
S=sum(1);
M5=ma(C,기간1,지수);
상전5=M5>M5(1) && M5(1)<M5(2);
M2=ma(C,기간2);
DC=Valuewhen(1,Crossdown(M5,M2),S);
상1=Valuewhen(1,상전5,S);
상2=Valuewhen(2,상전5,S);
상3=Valuewhen(3,상전5,S);
GC=Valuewhen(1,CrossUp(M5,M2),S);
조건W=상3<DC && DC<상2 && 상2<상1 && 상1<GC;
조건W && !조건W(1)
2025-06-10
174
글번호 191572
종목검색
답변완료
수식수정
늘 감사합니다.
아래 수식을 수정해 주세요.
복합장의 차트 수식으로
영업일이 18시를 기준으로 변경이 되어
18시 이후(야간장시작)로 첫봉을 만들고, 다음날 주간장 끝나는 15시 45분 까지입니다.
var : v1(0,data1),v2(0,data1),v3(0,data1),v4(0,data1);
var : atmC(0,data1),atmO(0,data1);
v1 = data1(Floor(CloseD(1)/2.5)*2.5);
V2 = data1(CloseD(1)-v1);
if v2 > 2.5/2 Then
atmC = v1+2.5;
Else
atmC = v1;
v3 = data1(Floor(OpenD(0)/2.5)*2.5);
V4 = data1(OpenD(0)-v3);
if v4 > 2.5/2 Then
atmO = v3+2.5;
Else
atmO = v3;
Plot1(atmC,"종가atm");
Plot2(atmO,"시가atm");
input: 시간(180000);
Input : 이평1(20), 이평2(60), 이평3(200);
var11 = data1(ema(c,이평1));
var12 = data1(ema(C,이평2));
var13 = data1(ema(c,이평3));
Plot7(var11, "이평1");
Plot8(var12, "이평2");
Plot9(var13, "이평3");
value1 = TimeToMinutes(stime);
var : cnt(0);
Array : O1[30](0), H1[30](0),L1[30](0),C1[30](0);
if stime == 시간 Then{
O1[0] = data1(O);
H1[0] = data1(H);
L1[0] = data1(L);
for cnt = 1 to 29{
O1[cnt] = O1[cnt-1][1];
H1[cnt] = H1[cnt-1][1];
L1[cnt] = L1[cnt-1][1];
C1[cnt] = C1[cnt-1][1];
}
}
if data1(H) > H1[0] Then
H1[0] = data1(H);
if data1(L) < L1[0] Then
L1[0] = data1(L);
C1[0] = data1(C);
plot56(H1[0],"당일고가");
plot57(L1[0],"당일저가");
plot58(O1[0],"당일시가");
plot59(C1[0],"당일종가");
plot60(C1[1],"전일종가");
감사합니다.
2025-06-10
173
글번호 191571
지표