답변완료
수식 변경 부탁드립니다
안녕하세요
키움수식입니다
예스수식으로 변경 부탁드립니다
행복한 하루 되세요
감사합니다
지표명 - 기간 고가,저가,중심선 긋기
수식1 중심선
a=Highest(H, period);
b=Lowest(L, period);
(A+B)/2
수식2
a=Highest(H, period)
수식3
b=Lowest(L, period)
지표조건설정
period - 26
라인설정
중심선 - 올리브, 점선, 굵기-1
고가선 - 빨강, 점선, 굵기-1
저가선 - 파랑, 점선, 굵기-1
2023-05-10
1021
글번호 168842
지표
답변완료
자동 진입 및 청산 디버깅 가능할까요?
페어전략차트에서 시스템트레이딩으로 실행 즉시 자동 매도/매수 진입하고 수익조건이 되면 일괄청산하고 싶습니다.
모의ID로 아래 실행시 페어 종목의 현재가로 MarketPosition(0)=-1, MarketPosition(1) = 1로 변경은 되는데 미체결 내역에 나오지 않고 엉뚱한 진입가를 받아오는데 디버깅 도와주세요.
If Date == 매수하루전 && MarketPosition(0) == 0 Then {
Sell("매도",AtStop,D1현재가,D1_수량);
Buy("매수",AtStop,D2현재가,D2_수량);
D1진입가 = data1(EntryPrice);
D2진입가 = data2(EntryPrice);
}
맨 마지막 아래 부분도 디버깅 가능할까요?
If MarketPosition > 0 Then {
If 순수익 > 최소수익 Then {
If MarketPosition(0) == -1 Then {
ExitShort("모든매도청산",AtLimit,D1현재가); //매수
ExitLong("모든매수청산",AtLimit,D2현재가); //매도
}
} Else if 순수익 < -200 && 진입주문명에 "매도2"가 없으면 Then {
Sell("매도2",AtStop,D1현재가,D1_수량);
Buy("매수2",AtStop,D2현재가,D2_수량);
}
}
2023-05-10
1481
글번호 168835
시스템
답변완료
수식작성 부탁드립니다
트레이딩뷰 코드 수식입니다. 예스랭귀지는 생소하다보니 도움 부탁드리겠습니다
F로 시작하는 문은 사용자 정의 함수이고요,
중간에 보시면 함수를 중첩해서 사용하고 있습니다.
F_Dynamic_shift(value, len) =>
result = float(na)
if len >= 1
for i = 0 to len by 1
if na(result) or not na(value[i])
result := value[i]
result
result
F_X_MA(src, len, wei) =>
sum = 0.0
ma = 0.0
result = 0.0
sum := nz(sum[1]) - nz(src[len]) + src
ma := na(src[len]) ? na : sum / len
result := na(result[1]) ? ma : (src * wei + result[1] * (len - wei)) / len
result
BNK_len = input.int(defval=10, group=group_BNK, title='banker len')
BNK_threshold1 = input.int(defval=2, group=group_BNK, title='banker entry threshold')
BNK_threshold2 = input.int(defval=3, group=group_BNK, title='banker ready threshold')
F_Banker_Flow(len)=>
bankerflow = 2 * F_X_MA((close - ta.lowest(low, len)) / (ta.highest(high, len) - ta.lowest(low, len)) * 20, 2, 1)
- 5 * F_X_MA(F_X_MA((close - ta.lowest(low, len)) / (ta.highest(high, len) - ta.lowest(low, len)) * 20, 2, 1), 2, 1)
bankerflow
Banker_Flow = F_Banker_Flow(BNK_len)
F_Banker_LongAttack(len, threshold1, threshold2) =>
bankerflow = F_Banker_Flow(len)
long_attack = ta.crossover(bankerflow, threshold1)
long_entry = bankerflow <= threshold1
long_ready = bankerflow < threshold2
[long_attack, long_entry, long_ready]
[BNK_attack_long, BNK_entry_long, BNK_ready_long] = F_Banker_LongAttack(BNK_len, BNK_threshold1, BNK_threshold2)
p_long_attack = plot(BNK_attack_long ? 30 : 0, title='long-attack', color=BNK_attack_col, linewidth=1, style=plot.style_area) //model banker pump or dump start soon
2023-05-09
1962
글번호 168830
지표