답변완료
수식 보완 요청드립니다.
안녕하세요.
시가와 전일중심가격 사이를 존으로 설정한 후 시가가 전일중심가격보다 높게 시작하면
현재가가 시가만든봉 바로 다음봉 시작에 매수진입하고 청산은 전일고가 또는 전일저가 또는 시가대비 피보나치비율 23.6 / 38.2 / 5 / 61.8 에서 청산
시가와 전일중심가격 사이를 존으로 설정한 후 시가가 전일중심가격보다 낮게 시작하면
현재가가 시가만든봉 바로 다음봉에 시작에 매도진입하고 청산은 전일고가 또는 전일저가 또는 시가대비 피보나치비율 23.6 / 38.2 / 5 / 61.8 에서 청산
아래 수식은 매매중간에는 진입신호가 나오나 시가만든봉 바로 다음봉에 진입이 안되고 전일고가 또는 전일저가에 청산도 되질 않습니다.
감사합니다.
Input: dix(1),stopper(1.2),진입횟수(10);
var : entry(0,Data1),idx(0,Data1),전일중심(0),zone(0);
var : Bcond(False,Data1),Scond(False,Data1);
setstoploss(stopper);
if Bdate != bdate[1] Then
{
entry = 0;
idx = 0;
}
Else
idx = idx+1;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
전일중심 = ((dayhigh(1)+daylow(1))/2);
zone = o+((dayhigh(1)+daylow(1))/2);
bcond = ((o > 전일중심 ) and crossup(c,o)) or ((o < 전일중심 ) and crossup(c,전일중심));
scond = ((o > 전일중심 ) and crossdown(c,전일중심)) or ((o < 전일중심 ) and CrossDown(c,o));
if idx >= dix and stime > 083000 then
{
if entry < 10 and Bcond == true Then
Buy();
if entry < 10 and Scond == true Then
{
Sell();
}
}
IF MarketPosition == 1 and crossup(c,dayhigh(1)) or crossup(c,daylow(1))
Then
ExitLong();
IF MarketPosition == -1 and CrossDown(c,dayhigh(1)) or crossDown(c,daylow(1))
Then
ExitShort();
2022-04-21
998
글번호 158207
시스템
답변완료
문의드립니다.
안녕하세요, 지표수식문의드립니다.
1분봉 차트의 가격에 표시하고 싶은데요,
[요청사항]
1.당일 최고가 부터 (당일 최저가 or 전일 종가)의 크기를 100%를 기준으로,
2. 해당 크기의 100%, 80%, 60%, 40^, 20%, 0%의 가격에 기준선이 계속 그어짐
3. 당일의 최고가, 최저가 등이 갱신이 되는 경우 그걸 반영하여 선이 계속 그어지는 형태
4. 첨부파일 보냅니다
2022-04-21
1169
글번호 158195
지표
답변완료
문의 드립니다
4시간 단위 평균값 구하기
var : Tcond(false),sumH(0),sumL(0),sumO(0),sumC(0),sumi(0),sumX(0);
var : Hma(0),lma(0),Oma(0),Cma(0);
if Bdate != Bdate[1] Then{
Tcond = true;
sumH = 0;
sumL = 0;
sumO = 0;
sumC = 0;
sumi = 0;
sumX = 0;
}
if Tcond == true then{
sumH = sumH+H;
sumL = sumL+L;
sumi = sumi+1;
Hma = sumH/sumi;
Lma = sumL/sumi;
sumO = sumO+O;
sumC = sumC+C;
sumX = sumX+1;
Oma = sumO/sumX;
Cma = sumC/sumX;
}
위 식은 하루 전체의 평균값(고저시종)을 나타낸 식으로 보입니다.
문의사항은 위 식을
4시간 단위로 평균값을 구하고 싶습니다.
즉 장 시작후 4시간이 지나면 새로운 평균값이 나타나도록...
그리고 지나간 시간의 평균값 연장선(일직선)은 나타나지 않토록 하고 싶습니다.
감사합니다.
2022-04-21
1162
글번호 158194
지표
답변완료
수식 부탁드립니다
VWAP = 거래량 가중 평균가 = ∑ (대표 가격 * 거래량 ) / ∑ 거래량
대표 가격 = 고가 + 저가 + 종가 / 3
입니다
// Initial inputs
Act_RSI_VWAP = input(true, " PRICE")
RSI_VWAP_length = input(17, "LENGTH")
RSI_VWAP_overSold = input(19, "OVERSOLD", type=input.float)
RSI_VWAP_overBought = input(80, "OVERBOUGHT", type=input.float)
// RSI with VWAP as source
RSI_VWAP = rsi(vwap(close), RSI_VWAP_length)
// Plotting, overlay=false
r=plot(RSI_VWAP, color = RSI_VWAP > RSI_VWAP_overBought ? color.red : RSI_VWAP < RSI_VWAP_overSold ? color.lime : color.blue, title="rsi", linewidth=2, style=plot.style_line)
h1=plot(RSI_VWAP_overBought, color = color.gray, style=plot.style_stepline)
h2=plot(RSI_VWAP_overSold, color = color.gray, style=plot.style_stepline)
fill(r,h1, color = RSI_VWAP > RSI_VWAP_overBought ? color.red : na, transp = 60)
fill(r,h2, color = RSI_VWAP < RSI_VWAP_overSold ? color.lime : na, transp = 60)
long=crossover(RSI_VWAP, RSI_VWAP_overSold)
long1=crossunder(RSI_VWAP, RSI_VWAP_overBought)
2022-04-20
1236
글번호 158193
지표