커뮤니티
참조 데이터
2018-10-23 11:14:24
250
글번호 122928
제가 뭔가 참조 데이터 쓰는 법을 잘 모르나 봅니다.
다음 수식 수정 부탁드립니다 (작동을 제대로 안 합니다)
이용하는 차트 = 1분봉
참조1 (data2) = 일봉
1. 갭 메우기
오늘 시가가 어제 저가보다 낮으면 090000 매수해서 어제 저가 또는 151900 에 청산
if stime==090000 and data2(O[0]) < data2(L[1]) then buy ("B",atmarket);
if marketposition == 1 and c >= data2(L[1]) then exitlong ("Ex",atmarket);
if marketposition == 1 and stime==151900 then exitlong ("Ex1",atmarket);
2. 가격이 (오늘 시가 + 어제 고가, 저가의 평균값) 에 도달할 경우 그 시점에 매수, 151900에 청산
var : higher(0);
higher = data2(O[0]) + (data2(H[1])+data2(L[1]))/2 ;
if marketposition == 0 and c=higher then buy ("B", atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
3.
오늘 110000 가격이 오늘 시가보다 높고 AND 130000 가격이 그때까지 오늘 고가,저가의 평균값보다 높으면 130000에 매수, 151900에 청산
if MarketPosition ==0 and (C>DayOpen and stime==110000) and (stime==130000 and C>(H+L)/2 ) then buy ("B",atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
4. 151900 가격이 일봉 5MA 위면 매수, 090001 청산
if marketposition == 0 and stime ==151900 and data2(C[0]) > data2(MA(C[0],5)) then buy ("B", atmarket);
if marketpostion == 1 and stime ==090001 then exitlong ("Ex", atmarket);
한수 가르침 부탁드립니다^^
답변 2
예스스탁 예스스탁 답변
2018-10-23 12:59:25
안녕하세요
예스스탁입니다.
1
차트의 데이터는 모두 완성봉의 데이터만 사용이 가능합니다.
그러므로 차트의 일봉 데이터 중 오늘봉은 미완성이므로
값을 이용할수 없습니다.
수식에서 일봉데이터는 별도로 참조로 사용하지 않으셔도 됩니다.
함수중에 dayopen,dayhigh,daylow,dayclose함수로 일간데이터가
내부적으로 제공되므로 기본차트와 같은 종목이면
일봉데이터를 참조데이터로 추가할 필요가 없습니다.
if stime==090000 and dayopen(0) < daylow(1) then buy ("B",atmarket);
if marketposition == 1 and c >= DayLow(1) then exitlong ("Ex",atmarket);
if marketposition == 1 and stime==151900 then exitlong ("Ex1",atmarket);
2
var : higher(0);
higher = DayOpen(0) + (DayHigh(1)-daylow(1))/2 ;
if marketposition == 0 and c>=higher then buy ("B", atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
3
#11시에 값을 저장
if stime == 110000 Then
var1 = C;
#현재 13시이고 11시종가가 시초가보다 크고 현재봉 종가는 당일 평균값보다 큼
if MarketPosition ==0 and stime == 130000 and var1 > DayOpen and C >(DayHigh(0)+DayLow(0))/2 then buy ("B",atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
4
input : P(5);
var : cnt(0),sum(0),mav(0);
#일봉이평 자체계산
sum = 0;
for cnt = 0 to P
{
sum = sum + DayClose(cnt);
}
mav = sum/P;
if marketposition == 0 and stime ==151900 and C > mav then buy ("B", atmarket);
if marketpostion == 1 and stime ==090001 then exitlong ("Ex", atmarket);
즐거운 하루되세요
> lch05 님이 쓴 글입니다.
> 제목 : 참조 데이터
> 제가 뭔가 참조 데이터 쓰는 법을 잘 모르나 봅니다.
다음 수식 수정 부탁드립니다 (작동을 제대로 안 합니다)
이용하는 차트 = 1분봉
참조1 (data2) = 일봉
1. 갭 메우기
오늘 시가가 어제 저가보다 낮으면 090000 매수해서 어제 저가 또는 151900 에 청산
if stime==090000 and data2(O[0]) < data2(L[1]) then buy ("B",atmarket);
if marketposition == 1 and c >= data2(L[1]) then exitlong ("Ex",atmarket);
if marketposition == 1 and stime==151900 then exitlong ("Ex1",atmarket);
2. 가격이 (오늘 시가 + 어제 고가, 저가의 평균값) 에 도달할 경우 그 시점에 매수, 151900에 청산
var : higher(0);
higher = data2(O[0]) + (data2(H[1])+data2(L[1]))/2 ;
if marketposition == 0 and c=higher then buy ("B", atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
3.
오늘 110000 가격이 오늘 시가보다 높고 AND 130000 가격이 그때까지 오늘 고가,저가의 평균값보다 높으면 130000에 매수, 151900에 청산
if MarketPosition ==0 and (C>DayOpen and stime==110000) and (stime==130000 and C>(H+L)/2 ) then buy ("B",atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
4. 151900 가격이 일봉 5MA 위면 매수, 090001 청산
if marketposition == 0 and stime ==151900 and data2(C[0]) > data2(MA(C[0],5)) then buy ("B", atmarket);
if marketpostion == 1 and stime ==090001 then exitlong ("Ex", atmarket);
한수 가르침 부탁드립니다^^
lch05
2018-10-23 13:22:43
고맙습니다!!
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 참조 데이터
> 안녕하세요
예스스탁입니다.
1
차트의 데이터는 모두 완성봉의 데이터만 사용이 가능합니다.
그러므로 차트의 일봉 데이터 중 오늘봉은 미완성이므로
값을 이용할수 없습니다.
수식에서 일봉데이터는 별도로 참조로 사용하지 않으셔도 됩니다.
함수중에 dayopen,dayhigh,daylow,dayclose함수로 일간데이터가
내부적으로 제공되므로 기본차트와 같은 종목이면
일봉데이터를 참조데이터로 추가할 필요가 없습니다.
if stime==090000 and dayopen(0) < daylow(1) then buy ("B",atmarket);
if marketposition == 1 and c >= DayLow(1) then exitlong ("Ex",atmarket);
if marketposition == 1 and stime==151900 then exitlong ("Ex1",atmarket);
2
var : higher(0);
higher = DayOpen(0) + (DayHigh(1)-daylow(1))/2 ;
if marketposition == 0 and c>=higher then buy ("B", atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
3
#11시에 값을 저장
if stime == 110000 Then
var1 = C;
#현재 13시이고 11시종가가 시초가보다 크고 현재봉 종가는 당일 평균값보다 큼
if MarketPosition ==0 and stime == 130000 and var1 > DayOpen and C >(DayHigh(0)+DayLow(0))/2 then buy ("B",atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
4
input : P(5);
var : cnt(0),sum(0),mav(0);
#일봉이평 자체계산
sum = 0;
for cnt = 0 to P
{
sum = sum + DayClose(cnt);
}
mav = sum/P;
if marketposition == 0 and stime ==151900 and C > mav then buy ("B", atmarket);
if marketpostion == 1 and stime ==090001 then exitlong ("Ex", atmarket);
즐거운 하루되세요
> lch05 님이 쓴 글입니다.
> 제목 : 참조 데이터
> 제가 뭔가 참조 데이터 쓰는 법을 잘 모르나 봅니다.
다음 수식 수정 부탁드립니다 (작동을 제대로 안 합니다)
이용하는 차트 = 1분봉
참조1 (data2) = 일봉
1. 갭 메우기
오늘 시가가 어제 저가보다 낮으면 090000 매수해서 어제 저가 또는 151900 에 청산
if stime==090000 and data2(O[0]) < data2(L[1]) then buy ("B",atmarket);
if marketposition == 1 and c >= data2(L[1]) then exitlong ("Ex",atmarket);
if marketposition == 1 and stime==151900 then exitlong ("Ex1",atmarket);
2. 가격이 (오늘 시가 + 어제 고가, 저가의 평균값) 에 도달할 경우 그 시점에 매수, 151900에 청산
var : higher(0);
higher = data2(O[0]) + (data2(H[1])+data2(L[1]))/2 ;
if marketposition == 0 and c=higher then buy ("B", atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
3.
오늘 110000 가격이 오늘 시가보다 높고 AND 130000 가격이 그때까지 오늘 고가,저가의 평균값보다 높으면 130000에 매수, 151900에 청산
if MarketPosition ==0 and (C>DayOpen and stime==110000) and (stime==130000 and C>(H+L)/2 ) then buy ("B",atmarket);
if marketposition == 1 and stime == 151900 then exitlong ("Ex", atmarket);
4. 151900 가격이 일봉 5MA 위면 매수, 090001 청산
if marketposition == 0 and stime ==151900 and data2(C[0]) > data2(MA(C[0],5)) then buy ("B", atmarket);
if marketpostion == 1 and stime ==090001 then exitlong ("Ex", atmarket);
한수 가르침 부탁드립니다^^