커뮤니티

문의2

프로필 이미지
좌오비우오비
2020-09-16 15:00:31
947
글번호 142430
답변완료
아래수식은 주차트에 사용하는 sell 수식입니다. 1. 보조차트2와 보조차트3을 이용해서 양합을 구합니다. var : sum(0,Data1); sum = Data2(c)+data3(c); 2. 구한 양합을 아래 수식에 따라 진입과 청산에 사용하고 싶습니다. ********************************************************************************** input : d1(28),d2(28),X1(28),X2(28),ER(8),EF(8),CR(8),CF(8),거래횟수(20),시작시간(090000); var : T1(0),entry(0),HH(0),LL(0),EH(0),EL(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0); if (sdate != sdate[1] and stime >= 시작시간) or (sdate == sdate[1] and stime >= 시작시간 and stime[1] < 시작시간) Then{ T1 = TotalTrades; E1 = 0; HH = H; } if stime >= 시작시간 then{ if H > HH Then HH = H; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then{ if E1 == 0 and C <= HH-PriceScale*d1 and C[1] < HH-PriceScale*d1 Then{ E1 = 1; L1 = L; i1 = index; V1 = HH; //시작점 종가 } if E1 == 1 and index > i1 then{ if L < L1 Then L1 = L; #고가가 시작봉종가보다 작을 때만 눌림체크 if H <= V1 and H >= L1+PriceScale*ER Then{ E1 = 2; i1 = index; S1 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E1 >= 1 and H > V1 Then{ E1 = 0; HH = H; } if E1 == 2 and index > i1 and C <= S1-PriceScale*EF Then{ sell("s1"); } } if TotalTrades > TotalTrades[1] Then{ E1 = 0; HH = H; } if H > HH Then HH = H; if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{ if E1 == 0 and C <= HH-PriceScale*d2 and C[1] < HH-PriceScale*d2 Then{ E1 = 1; L1 = L; i1 = index; } if E1 == 1 and index > i1 then{ if L < L1 Then L1 = L; if H >= L1+PriceScale*ER Then{ E1 = 2; i1 = index; S1 = L1; } } if E1 == 2 and index > i1 and C <= S1-PriceScale*EF Then{ sell("s2"); E1 = 0; } } if MarketPosition == -1 Then{ if entry >= 1 then{ if CurrentContracts > CurrentContracts[1] Then{ EL = L; E1 = 0; } if L < EL Then{ EL = L; E1 = 0; } if E1 == 0 and C >= EL+PriceScale*X1 Then{ E1 = 1; H1 = H; i1 = index; } if E1 == 1 and index > i1 Then{ if H > H1 Then H1 = H; if L <= H1-PriceScale*CR Then{ E1 = 2; I1 = index; S1 = H1; } } if E1 == 2 and index > i1 and C >= S1+PriceScale*CF Then{ ExitShort("sx1"); E1 = 0; } } } if MarketPosition == -1 Then{ if entry >= 1 then{ if CurrentContracts > CurrentContracts[1] Then{ EL = L; E1 = 0; } if L < EL Then{ EL = L; E1 = 0; } if E1 == 0 and C >= EL+PriceScale*X2 Then{ E1 = 1; H1 = H; i1 = index; } if E1 == 1 and index > i1 Then{ if H > H1 Then H1 = H; if L <= H1-PriceScale*CR Then{ E1 = 2; I1 = index; S1 = H1; } } if E1 == 2 and index > i1 and C >= S1+PriceScale*CF Then{ ExitShort("sx2"); E1 = 0; } } } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-09-17 13:12:33

안녕하세요 예스스탁입니다. input : d1(28),d2(28),X1(28),X2(28),ER(8),EF(8),CR(8),CF(8),거래횟수(20),시작시간(090000); var : T1(0,Data1),entry(0,Data1),HH(0,Data1),LL(0,Data1),EH(0,Data1),EL(0,Data1),E1(0,Data1),H1(0,Data1),i1(0,Data1),S1(0,Data1),L1(0,Data1),V1(0,Data1); var : sum(0,Data1); sum = Data2(c)+data3(c); if Data2((sdate != sdate[1] and stime >= 시작시간) or (sdate == sdate[1] and stime >= 시작시간 and stime[1] < 시작시간)) Then{ T1 = TotalTrades; E1 = 0; HH = sum; } if data2(stime >= 시작시간) then{ if sum > HH Then HH = sum; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then{ if E1 == 0 and sum <= HH-data2(PriceScale)*d1 and sum[1] < HH-data2(PriceScale)*d1 Then{ E1 = 1; L1 = sum; i1 = data2(index); V1 = HH; //시작점 종가 } if E1 == 1 and index > i1 then{ if sum < L1 Then L1 = sum; #고가가 시작봉종가보다 작을 때만 눌림체크 if sum <= V1 and sum >= L1+data2(PriceScale)*ER Then{ E1 = 2; i1 = data2(index); S1 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E1 >= 1 and sum > V1 Then{ E1 = 0; HH = sum; } if E1 == 2 and data2(index) > i1 and sum <= S1-data2(PriceScale)*EF Then{ sell("s1"); } } if TotalTrades > TotalTrades[1] Then{ E1 = 0; HH = sum; } if sum > HH Then HH = sum; if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{ if E1 == 0 and sum <= HH-data2(PriceScale)*d2 and sum[1] < HH-data2(PriceScale)*d2 Then{ E1 = 1; L1 = sum; i1 = data2(index); } if E1 == 1 and data2(index) > i1 then{ if sum < L1 Then L1 = sum; if sum >= L1+data2(PriceScale)*ER Then{ E1 = 2; i1 = data2(index); S1 = L1; } } if E1 == 2 and data2(index) > i1 and sum <= S1-data2(PriceScale)*EF Then{ sell("s2"); E1 = 0; } } if MarketPosition == -1 Then{ if entry >= 1 then{ if CurrentContracts > CurrentContracts[1] Then{ EL = sum; E1 = 0; } if sum < EL Then{ EL = sum; E1 = 0; } if E1 == 0 and sum >= EL+data2(PriceScale)*X1 Then{ E1 = 1; H1 = sum; i1 = data2(index); } if E1 == 1 and data2(index) > i1 Then{ if sum > H1 Then H1 = sum; if L <= H1-data2(PriceScale)*CR Then{ E1 = 2; I1 = data2(index); S1 = H1; } } if E1 == 2 and data2(index) > i1 and sum >= S1+data2(PriceScale)*CF Then{ ExitShort("sx1"); E1 = 0; } } } if MarketPosition == -1 Then{ if entry >= 1 then{ if CurrentContracts > CurrentContracts[1] Then{ EL = sum; E1 = 0; } if sum < EL Then{ EL = sum; E1 = 0; } if E1 == 0 and sum >= EL+data2(PriceScale)*X2 Then{ E1 = 1; H1 = sum; i1 = data2(index); } if E1 == 1 and index > i1 Then{ if sum > H1 Then H1 = sum; if sum <= H1-data2(PriceScale)*CR Then{ E1 = 2; I1 = data2(index); S1 = H1; } } if E1 == 2 and data2(index) > i1 and sum >= S1+data2(PriceScale)*CF Then{ ExitShort("sx2"); E1 = 0; } } } } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 문의2 > 아래수식은 주차트에 사용하는 sell 수식입니다. 1. 보조차트2와 보조차트3을 이용해서 양합을 구합니다. var : sum(0,Data1); sum = Data2(c)+data3(c); 2. 구한 양합을 아래 수식에 따라 진입과 청산에 사용하고 싶습니다. ********************************************************************************** input : d1(28),d2(28),X1(28),X2(28),ER(8),EF(8),CR(8),CF(8),거래횟수(20),시작시간(090000); var : T1(0),entry(0),HH(0),LL(0),EH(0),EL(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0); if (sdate != sdate[1] and stime >= 시작시간) or (sdate == sdate[1] and stime >= 시작시간 and stime[1] < 시작시간) Then{ T1 = TotalTrades; E1 = 0; HH = H; } if stime >= 시작시간 then{ if H > HH Then HH = H; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then{ if E1 == 0 and C <= HH-PriceScale*d1 and C[1] < HH-PriceScale*d1 Then{ E1 = 1; L1 = L; i1 = index; V1 = HH; //시작점 종가 } if E1 == 1 and index > i1 then{ if L < L1 Then L1 = L; #고가가 시작봉종가보다 작을 때만 눌림체크 if H <= V1 and H >= L1+PriceScale*ER Then{ E1 = 2; i1 = index; S1 = L1; } } //시작점 종가보다 높은 가격이 발생하면 초기화 if E1 >= 1 and H > V1 Then{ E1 = 0; HH = H; } if E1 == 2 and index > i1 and C <= S1-PriceScale*EF Then{ sell("s1"); } } if TotalTrades > TotalTrades[1] Then{ E1 = 0; HH = H; } if H > HH Then HH = H; if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{ if E1 == 0 and C <= HH-PriceScale*d2 and C[1] < HH-PriceScale*d2 Then{ E1 = 1; L1 = L; i1 = index; } if E1 == 1 and index > i1 then{ if L < L1 Then L1 = L; if H >= L1+PriceScale*ER Then{ E1 = 2; i1 = index; S1 = L1; } } if E1 == 2 and index > i1 and C <= S1-PriceScale*EF Then{ sell("s2"); E1 = 0; } } if MarketPosition == -1 Then{ if entry >= 1 then{ if CurrentContracts > CurrentContracts[1] Then{ EL = L; E1 = 0; } if L < EL Then{ EL = L; E1 = 0; } if E1 == 0 and C >= EL+PriceScale*X1 Then{ E1 = 1; H1 = H; i1 = index; } if E1 == 1 and index > i1 Then{ if H > H1 Then H1 = H; if L <= H1-PriceScale*CR Then{ E1 = 2; I1 = index; S1 = H1; } } if E1 == 2 and index > i1 and C >= S1+PriceScale*CF Then{ ExitShort("sx1"); E1 = 0; } } } if MarketPosition == -1 Then{ if entry >= 1 then{ if CurrentContracts > CurrentContracts[1] Then{ EL = L; E1 = 0; } if L < EL Then{ EL = L; E1 = 0; } if E1 == 0 and C >= EL+PriceScale*X2 Then{ E1 = 1; H1 = H; i1 = index; } if E1 == 1 and index > i1 Then{ if H > H1 Then H1 = H; if L <= H1-PriceScale*CR Then{ E1 = 2; I1 = index; S1 = H1; } } if E1 == 2 and index > i1 and C >= S1+PriceScale*CF Then{ ExitShort("sx2"); E1 = 0; } } } }