답변완료
코드 구현이 잘 안되어서 질문올렸습니다.
아래와같이 코드를 받았는데 사진처럼 매매가 이상하게 되는 구간이 있네요
문제1. : 사진1. 종종 시초가에 진입하네요
문제2. : 사진2. 그리고 시초가에 진입하고 리버설도 하네요(원래 1일 1진입만 가능)
차트 가격 데이터가 잘못된건지 로직 오류인건지 모르겠네요
수정 부탁드릴게요(사진 첨부)
----------------------------------------------------------
안녕하세요
예스스탁입니다.
갭상승과 갭하락이 반대로 되어 있었습니다.
수정한 식입니다.
# 진입 #
# 매수 진입 #
if DayClose(1) < DayOpen and ExitDate(1) <> date then # 갭상승으로 장 시작하면, 첫 진입이라면
buy("매수", AtLimit, DayClose(1)); # 갭을 메우는 순간 전날 종가로 진입
# 매도 진입 #
if DayClose(1) > DayOpen and ExitDate(1) <> date then # 갭하락으로 장 시작하면, 첫 진입이라면
sell("매도", AtLimit, DayClose(1)); # 갭을 메우는 순간 전날 종가로 진입
SetStopEndofday(150000);
즐거운 하루되세요
2020-02-25
356
글번호 136296
시스템
답변완료
수정 부탁드립니다.
안녕하세요?
아래시스템에서 잘 안되는부분을 수정 부탁드립니다.
1. 외부변수에 봉길이 틱수를 집어넣으면 맞지가 않습니다.
2. 익절손절이 맞지가않습니다.
3. 진입횟수는 정확히 맞습니다
부탁드립니다. 감사합니다.
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
var : entry(0);
if bdate != bdate[1] Then
entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if entry < 진입횟수 and
MarketPosition >= 0 and
C[1] >= O[1]+매도양봉틱수*PriceScale and
C[0] <= O[0]+매도음봉틱수*PriceScale Then
sell("s");
if entry < 진입횟수 and
MarketPosition <= 0 and
C[1] <= O[1]+매수음봉틱수*PriceScale and
C[0] >= O[0]+매수양봉틱수*PriceScale Then
buy("b");
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2020-02-25
325
글번호 136287
시스템
답변완료
문의 드립니다.
study(title="SI", overlay = true)
width = input(14, minval=1)
triggerSell = iff(iff(close[1] < close,1,0) and (close[2] < close[1] or close[3] <close[1]),1,0)
triggerBuy = iff(iff(close[1] > close,1,0) and (close[2] > close[1] or close[3] > close[1]),1,0)
buySellSwitch = iff(triggerSell, 1, iff(triggerBuy, 0, nz(buySellSwitch[1])))
SBS = iff(triggerSell and buySellSwitch[1] == false, high, iff(triggerBuy and buySellSwitch[1], low, nz(SBS[1])))
clr_s = iff(triggerSell and buySellSwitch[1] == false, 1, iff(triggerBuy and buySellSwitch[1], 0, nz(clr_s[1])))
clr = iff(clr_s == 0 , red , green)
pos = iff(clr == green, 1,
iff(clr == red, -1, nz(pos[1], 0)))
barcolor(pos == -1 ? red: pos == 1 ? green : blue )
plot(SBS, color=clr, title="TTM", style = circles, linewidth = 2)
예스랭귀지로 변환 문의드립니다.
감사합니다.
2020-02-25
352
글번호 136285
지표