답변완료
부탁드립니다.
StudyName = "CI"
ShortStudyName = "I"
study(StudyName, shorttitle=ShortStudyName, overlay=true, precision=6)
source = input(close)
cci_period = input(28, "CCI Period")
cci = cci(source, cci_period)
//UL = input(80, "Upper level")
//LL = input(20, "Lower Level")
ML = input(0, "CCI Mid Line pivot")
Factor=input(3,title="[ST] Factor", minval=1,maxval = 100, type=input.float)
Pd=input(3, title="[ST] PD", minval=1,maxval = 100)
f_supertrend(Factor, Pd) =>
Up=hl2-(Factor*atr(Pd))
Dn=hl2+(Factor*atr(Pd))
TrendUp = 0.0
TrendUp := cci[1] > ML ? max(Up,TrendUp[1]) : Up
TrendDown = 0.0
TrendDown := cci[1]< ML ? min(Dn,TrendDown[1]) : Dn
Trend = 0.0
Trend := cci > ML ? 1: cci < ML ? -1: nz(Trend[1],1)
Tsl = Trend==1? TrendUp: TrendDown
Tsl
st_tsl = f_supertrend(Factor, Pd)
// Plot the ST
linecolor = close >= st_tsl ? color.green : color.red
plot(st_tsl, color = linecolor , linewidth = 4,title = "SuperTrend", transp=0)
//hline(UL, title="Upper Line", linestyle=hline.style_solid, linewidth=1, color=color.red)
//hline(LL, title="Lower Line", linestyle=hline.style_solid, linewidth=1, color=color.lime)
//hline(ML, title="Mid Line", linestyle=hline.style_solid, linewidth=2, color=color.gray)
감사합니다.
2020-02-27
379
글번호 136422
지표
답변완료
수식 작성 부탁 드립니다
2개의 매수 진입 조건을 같이 사용 할수 있도록 부탁 드립니다
매수 진입 수식에 {input : period(20);} 이 상승 할때{CurrentBar > 20 and ma(haClose,period) > ma(haOpen,period) } 진입 허용 하도록 설정 되어 있습니다
아래 수식에서 input : period2(10);이 상승 할때 조건을 첨부 원합니다
input : period(20);
var : haClose(0), haOpen(0), haHigh(0), haLow(0);
if CurrentBar > 1 then {
haClose = (Open+High+Low+Close)/4;
haOpen = (haOpen[1] + haClose[1])/2 ;
haHigh = Max(High, haOpen, haClose);
haLow = Min(Low, haOpen, haClose) ;
var1 = ma(haOpen,period);
}
}
if CurrentBar > 20 then {
if ma(haClose,period) > ma(haOpen,period) Then{
var2 =ma(haClose,period);
}
input : period2(10);
var : haClose(0), haOpen(0), haHigh(0), haLow(0);
if CurrentBar > 1 then {
haClose = (Open+High+Low+Close)/4;
haOpen = (haOpen[1] + haClose[1])/2 ;
haHigh = Max(High, haOpen, haClose);
haLow = Min(Low, haOpen, haClose) ;
var3 = ma(haOpen,period2);
}
}
if CurrentBar > 20 then {
if ma(haClose,period2) > ma(haOpen,period2) Then{
var4 =ma(haClose,period2);
}
if CurrentBar > 20 and ma(haClose,period) > ma(haOpen,period)
and 매수진입 조건 then buy("B");
2020-02-27
338
글번호 136418
시스템
답변완료
수정 부탁드립니다.
안녕하세요? 답변해주신 아래의 내용에서 수정할 부분이 있어 도움요청드립다.
1. #포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가 이 부분을 삭제하고 싶습니다.
2. 교차매매없이 정해진 익절손절에만 청산후, 새로운신호에 진입하고 싶습니다.
1씩증가 저부분을 삭제도 해보았지만 잘 안되네요.
수정부탁드립니다.
감사합니다.
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
var : entry(0);
#영업일 변경
if bdate != bdate[1] Then
entry = 0;
#포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition >= 0 and #매수나 무포지션 상태
C[1] >= O[1]+매도양봉틱수*PriceScale and #1봉전종가가 1봉전시가+매도양봉틱수 이상
C[0] <= O[0]-매도음봉틱수*PriceScale Then #현재봉 종가가 1봉전시가-매도음봉틱수 이하
sell("s");
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition <= 0 and #매도나 무포지션 상태
C[1] <= O[1]-매수음봉틱수*PriceScale and #1봉전종가가 1봉전시가-매수음봉틱수 이하
C[0] >= O[0]+매수양봉틱수*PriceScale Then #현재봉 종가가 1봉전시가+매수양봉틱수 이상
buy("b");
#목표수익 설정
SetStopProfittarget(PriceScale*익절틱수,PointStop);
#손절매 설정
SetStopLoss(PriceScale*손절틱수,PointStop);
2020-02-27
353
글번호 136417
시스템
답변완료
강조
힝 매주 목요일 금요일아니고
3월 6월 9월 12월
두쨰주 목요일
셋쨰주 금요일 안되냐용1
1
var : count(0);
var : month(0);
month = int(date/100)-int(date/10000)*100;
if month != month[1] Then
{
count = 0;
if month%3 == 0 Then
Condition1 = true;
Else
Condition1 = false;
}
if bdate != bdate[1] and DayOfWeek(bdate) == 4 Then
{
count = count+1;
PlotPaintBar(H,L,"강조",MAGENTA);
}
2
var : count(0);
var : month(0);
month = int(date/100)-int(date/10000)*100;
if month != month[1] Then
{
count = 0;
if month%3 == 0 Then
Condition1 = true;
Else
Condition1 = false;
}
if bdate != bdate[1] and DayOfWeek(bdate) == 5 Then
{
count = count+1;
PlotPaintBar(H,L,"강조",MAGENTA);
}
2020-02-27
436
글번호 136402
강조
답변완료
안녕하세요
//Variable:
//cp = 2 (default)
if high[cp] >= highest[2*cp+1](high) then
LH = 1
else
LH=0
endif
if low[cp] <= lowest[2*cp+1](low) then
LL= -1
else
LL=0
endif
if LH=1 then
hil = high[cp]
endif
if LL = -1 then
LOL=low[cp]
endif
return lol coloured(255,0,0) as "LF",hil coloured(0,255,0) as "HF"
수식 변환 문의드립니다. 감사합니다
2020-02-27
453
글번호 136398
지표