답변완료
문의 드립니다.
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
지표
답변완료
수식 도와주세요
input : X(1.5);
input : 만기청산시간(151500), 만기외청산시간(153000);
var : month(0),nday(0),week(0);
month = int(date/100)-int(date/10000)*100;
nday = date - int(date/100)*100;
Week = DayOfWeek(date);
if MarketPosition == 0 and NextBarOpen == sdate then
{
buy("b",AtStop,dayopen+x);
sell("s",AtStop,dayopen-x);
}
if MarketPosition == 1 Then
ExitLong("bx",AtStop,dayopen);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,dayopen);
if (nday >= 8 and nday <= 14 and week == 4) then
SetStopEndofday(만기청산시간);
Else
SetStopEndofday(만기외청산시간);
1. 이 전략의 진입 조건을
전일의 (고가-저가)*0.5 돌파 시 매수 매도 진입으로 바꿔보고 싶습니다.
2. 그리고 당일 청산이 아니라 다음날 시가 청산으로 바꾼다면 어떻게 바꿀 수 있을까요?
2020-02-25
423
글번호 136282
시스템