커뮤니티

문의 드립니다.

프로필 이미지
푸른
2022-12-22 12:13:27
1362
글번호 164787
답변완료
1. input : StartTime(200000),EndTime(50000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.05),ATRperiod(5); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); if MarketPosition == 1 Then Sell("bs",AtStop,EntryPrice-PriceScale*0); if MarketPosition == -1 Then Buy("sb",AtStop,EntryPrice+PriceScale*0); 2. input:length(5),a틱(10),b틱(10),c틱(5); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0); Array:HH[10,2](0),LL[10,2](0); input : StartTime(150000),EndTime(60000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } process = 0; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If LL[1,1] > L Then process = -1; If HH[1,1] < H Then process = 1; } Else If Highest(H,length) == H and lastHiVal <> H Then process = 1; Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1; If process == 1 Then { T = 1; lastHiVal = H; If HH[1,2] < LL[1,2] Then { For j = 10 DownTo 2 { HH[j,1] = HH[j-1,1]; HH[j,2] = HH[j-1,2]; } } If HH[1,2] < LL[1,2] or HH[1,1] < H Then { HH[1,1] = H; HH[1,2] = Index; sBar = Index - LL[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if LL[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 1); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2)); Text_SetStyle(Text1, 2, 1); } Text_SetStyle(Text1, 2, 1); } if MarketPosition <= 0 and HH[2,1] >= LL[2,1]+PriceScale*a틱 and LL[1,1] <= HH[2,1]-PriceScale*b틱 and Tcond == true Then Buy("b",AtStop,HH[2,1]+PriceScale*c틱); } If process == -1 Then { T = -1; lastLoVal = L; If LL[1,2] < HH[1,2] Then { For j = 10 DownTo 2 { LL[j,1] = LL[j-1,1]; LL[j,2] = LL[j-1,2]; } } If LL[1,2] < HH[1,2] or LL[1,1] > L Then { LL[1,1] = L; LL[1,2] = Index; sBar = Index - HH[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if HH[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } } if MarketPosition >= 0 and LL[2,1] <= HH[2,1]-PriceScale*a틱 and HH[1,1] >= LL[2,1]+PriceScale*b틱 and Tcond == true Then Sell("s",AtStop,LL[2,1]-PriceScale*c틱); } 위 2가지 수식어의 진입후 20틱내 청산금지와 손절40틱의 수식어를 추가 하고자 합니다. --------------------------- 아래 수식어를 추가로 부탁드리며 봉 완성시 기준입니다. 3. 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 매수 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50 4. 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 매도 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50
시스템
답변 4
프로필 이미지

예스스탁 예스스탁 답변

2022-12-22 14:45:01

안녕하세요 예스스탁입니다. 3 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then ExitLong(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 4 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then Sell(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. input : StartTime(200000),EndTime(50000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.05),ATRperiod(5); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); if MarketPosition == 1 Then Sell("bs",AtStop,EntryPrice-PriceScale*0); if MarketPosition == -1 Then Buy("sb",AtStop,EntryPrice+PriceScale*0); 2. input:length(5),a틱(10),b틱(10),c틱(5); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0); Array:HH[10,2](0),LL[10,2](0); input : StartTime(150000),EndTime(60000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } process = 0; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If LL[1,1] > L Then process = -1; If HH[1,1] < H Then process = 1; } Else If Highest(H,length) == H and lastHiVal <> H Then process = 1; Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1; If process == 1 Then { T = 1; lastHiVal = H; If HH[1,2] < LL[1,2] Then { For j = 10 DownTo 2 { HH[j,1] = HH[j-1,1]; HH[j,2] = HH[j-1,2]; } } If HH[1,2] < LL[1,2] or HH[1,1] < H Then { HH[1,1] = H; HH[1,2] = Index; sBar = Index - LL[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if LL[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 1); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2)); Text_SetStyle(Text1, 2, 1); } Text_SetStyle(Text1, 2, 1); } if MarketPosition <= 0 and HH[2,1] >= LL[2,1]+PriceScale*a틱 and LL[1,1] <= HH[2,1]-PriceScale*b틱 and Tcond == true Then Buy("b",AtStop,HH[2,1]+PriceScale*c틱); } If process == -1 Then { T = -1; lastLoVal = L; If LL[1,2] < HH[1,2] Then { For j = 10 DownTo 2 { LL[j,1] = LL[j-1,1]; LL[j,2] = LL[j-1,2]; } } If LL[1,2] < HH[1,2] or LL[1,1] > L Then { LL[1,1] = L; LL[1,2] = Index; sBar = Index - HH[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if HH[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } } if MarketPosition >= 0 and LL[2,1] <= HH[2,1]-PriceScale*a틱 and HH[1,1] >= LL[2,1]+PriceScale*b틱 and Tcond == true Then Sell("s",AtStop,LL[2,1]-PriceScale*c틱); } 위 2가지 수식어의 진입후 20틱내 청산금지와 손절40틱의 수식어를 추가 하고자 합니다. --------------------------- 아래 수식어를 추가로 부탁드리며 봉 완성시 기준입니다. 3. 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 매수 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50 4. 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 매도 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50
프로필 이미지

푸른

2022-12-22 16:51:50

안녕하세요 예스스탁입니다. 절대값을 abs함수를 이용해 작성하시면 됩니다. abs(K-Y) K와 Y가 가중이평선이시면 var : K(0),Y(0); K = wma(c,5); Y = wma(C,20); plot1(abs(K-Y)); 즐거운 하루되세요 > 너무조아 님이 쓴 글입니다. > 제목 : 절대값의 수식 > 가중이평선(K) + - (Y)의 절대값을 구하는 수식을 작성해 주세요. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 3 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then ExitLong(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 4 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then Sell(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. input : StartTime(200000),EndTime(50000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.05),ATRperiod(5); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); if MarketPosition == 1 Then Sell("bs",AtStop,EntryPrice-PriceScale*0); if MarketPosition == -1 Then Buy("sb",AtStop,EntryPrice+PriceScale*0); 2. input:length(5),a틱(10),b틱(10),c틱(5); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0); Array:HH[10,2](0),LL[10,2](0); input : StartTime(150000),EndTime(60000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } process = 0; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If LL[1,1] > L Then process = -1; If HH[1,1] < H Then process = 1; } Else If Highest(H,length) == H and lastHiVal <> H Then process = 1; Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1; If process == 1 Then { T = 1; lastHiVal = H; If HH[1,2] < LL[1,2] Then { For j = 10 DownTo 2 { HH[j,1] = HH[j-1,1]; HH[j,2] = HH[j-1,2]; } } If HH[1,2] < LL[1,2] or HH[1,1] < H Then { HH[1,1] = H; HH[1,2] = Index; sBar = Index - LL[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if LL[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 1); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2)); Text_SetStyle(Text1, 2, 1); } Text_SetStyle(Text1, 2, 1); } if MarketPosition <= 0 and HH[2,1] >= LL[2,1]+PriceScale*a틱 and LL[1,1] <= HH[2,1]-PriceScale*b틱 and Tcond == true Then Buy("b",AtStop,HH[2,1]+PriceScale*c틱); } If process == -1 Then { T = -1; lastLoVal = L; If LL[1,2] < HH[1,2] Then { For j = 10 DownTo 2 { LL[j,1] = LL[j-1,1]; LL[j,2] = LL[j-1,2]; } } If LL[1,2] < HH[1,2] or LL[1,1] > L Then { LL[1,1] = L; LL[1,2] = Index; sBar = Index - HH[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if HH[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } } if MarketPosition >= 0 and LL[2,1] <= HH[2,1]-PriceScale*a틱 and HH[1,1] >= LL[2,1]+PriceScale*b틱 and Tcond == true Then Sell("s",AtStop,LL[2,1]-PriceScale*c틱); } 위 2가지 수식어의 진입후 20틱내 청산금지와 손절40틱의 수식어를 추가 하고자 합니다. --------------------------- 아래 수식어를 추가로 부탁드리며 봉 완성시 기준입니다. 3. 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 매수 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50 4. 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 매도 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50
프로필 이미지

푸른

2022-12-22 16:54:01

안녕하세요 예스스탁입니다. 특정값에 abs함수를 사용하면 절대값으로 리턴합니다. plot1(data2(abs(C))+data3(abs(c))); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : Re : Re : abs함수 > 안녕하세요 예스스탁입니다. 절대값을 abs함수를 이용해 작성하시면 됩니다. abs(K-Y) K와 Y가 가중이평선이시면 var : K(0),Y(0); K = wma(c,5); Y = wma(C,20); plot1(abs(K-Y)); 즐거운 하루되세요 > 너무조아 님이 쓴 글입니다. > 제목 : 절대값의 수식 > 가중이평선(K) + - (Y)의 절대값을 구하는 수식을 작성해 주세요. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 3 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then ExitLong(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 4 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then Sell(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. input : StartTime(200000),EndTime(50000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.05),ATRperiod(5); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); if MarketPosition == 1 Then Sell("bs",AtStop,EntryPrice-PriceScale*0); if MarketPosition == -1 Then Buy("sb",AtStop,EntryPrice+PriceScale*0); 2. input:length(5),a틱(10),b틱(10),c틱(5); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0); Array:HH[10,2](0),LL[10,2](0); input : StartTime(150000),EndTime(60000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } process = 0; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If LL[1,1] > L Then process = -1; If HH[1,1] < H Then process = 1; } Else If Highest(H,length) == H and lastHiVal <> H Then process = 1; Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1; If process == 1 Then { T = 1; lastHiVal = H; If HH[1,2] < LL[1,2] Then { For j = 10 DownTo 2 { HH[j,1] = HH[j-1,1]; HH[j,2] = HH[j-1,2]; } } If HH[1,2] < LL[1,2] or HH[1,1] < H Then { HH[1,1] = H; HH[1,2] = Index; sBar = Index - LL[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if LL[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 1); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2)); Text_SetStyle(Text1, 2, 1); } Text_SetStyle(Text1, 2, 1); } if MarketPosition <= 0 and HH[2,1] >= LL[2,1]+PriceScale*a틱 and LL[1,1] <= HH[2,1]-PriceScale*b틱 and Tcond == true Then Buy("b",AtStop,HH[2,1]+PriceScale*c틱); } If process == -1 Then { T = -1; lastLoVal = L; If LL[1,2] < HH[1,2] Then { For j = 10 DownTo 2 { LL[j,1] = LL[j-1,1]; LL[j,2] = LL[j-1,2]; } } If LL[1,2] < HH[1,2] or LL[1,1] > L Then { LL[1,1] = L; LL[1,2] = Index; sBar = Index - HH[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if HH[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } } if MarketPosition >= 0 and LL[2,1] <= HH[2,1]-PriceScale*a틱 and HH[1,1] >= LL[2,1]+PriceScale*b틱 and Tcond == true Then Sell("s",AtStop,LL[2,1]-PriceScale*c틱); } 위 2가지 수식어의 진입후 20틱내 청산금지와 손절40틱의 수식어를 추가 하고자 합니다. --------------------------- 아래 수식어를 추가로 부탁드리며 봉 완성시 기준입니다. 3. 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 매수 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50 4. 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 매도 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50
프로필 이미지

푸른

2022-12-25 08:01:54

나스닥 20분 0.16 input : StartTime(210000),EndTime(60000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.16),ATRperiod(50); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> 1 Then ExitShort ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then ExitShort ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); ----------------------------------------- input : StartTime(220000),EndTime(40000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.26),ATRperiod(10); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> 1 Then ExitShort ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then ExitShort ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); ------------------------ 일봉 input : 익절틱수(0),손절틱수(0); if NextBarSdate != sDate Then { if NextBarOpen > C Then { Buy("b",AtStop,NextBarOpen+PriceScale*10); Sell("s",AtStop,NextBarOpen-PriceScale*10); } if NextBarOpen < C Then { ExitLong("bx",AtStop,NextBarOpen-PriceScale*10); ExitShort("sx",AtStop,NextBarOpen+PriceScale*10); } } if MarketPosition > 1 Then Sell("ss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("ss1",AtStop,EntryPrice+10); if NextBarSdate != sDate Then { if NextBarOpen > C Then { Buy("b2",AtStop,NextBarOpen+PriceScale*10); Sell("s2",AtStop,NextBarOpen-PriceScale*10); } if NextBarOpen < C Then { ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10); ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10); } } if MarketPosition > 1 Then Sell("sss",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("sss1",AtStop,EntryPrice+10); if NextBarSdate != sDate Then { if NextBarOpen < C Then { Buy("b8",AtStop,NextBarOpen+PriceScale*10); Sell("s8",AtStop,NextBarOpen-PriceScale*10); } if NextBarOpen > C Then { ExitLong("bx8",AtStop,NextBarOpen-PriceScale*10); ExitShort("sx8",AtStop,NextBarOpen+PriceScale*10); } } if MarketPosition > 1 Then Sell("bb",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("bb1",AtStop,EntryPrice+10); if NextBarSdate != sDate Then { if NextBarOpen < C Then { Buy("b9",AtStop,NextBarOpen+PriceScale*10); Sell("s9",AtStop,NextBarOpen-PriceScale*10); } if NextBarOpen > C Then { ExitLong("bx9",AtStop,NextBarOpen-PriceScale*10); ExitShort("sx9",AtStop,NextBarOpen+PriceScale*10); } } if MarketPosition > 1 Then Sell("bbb",AtStop,EntryPrice-10); if MarketPosition < -1 Then Buy("bbb1",AtStop,EntryPrice+10); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ----- 이평선 120 30분봉 input : 익절틱수(200),손절틱수(40),P(120); var : DD(0),Year(0),V1(0),V2(0),V3(0),V4(0),summer(False); var : ST(0),ET(0),entry(0); var : mav(0); mav = ma(C,P); if NextBarSdate != sDate Then { DD = DayOfWeek(NextBarSdate); Year = Floor(NextBarSdate/10000); V1 = (10000 * Year) + (100 * 3) + 1; V2 = 15 - dayofweek(v1); v3 = (10000 * Year) + (100 * 11) + 1; v4 = 8 - dayofweek(v3); Summer = Sdate > (10000 * Year) + (100 * 3) + v2 and Sdate < (10000 * Year) + (100 * 11) + v4; if summer == true Then { ST = 90000; ET = 60000; } Else { ST = 90000; ET = 60000; } } Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true; Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true; if Year > 0 Then { IF ET > ST Then SetStopEndofday(ET); Else { if NextBarSdate != sDate Then SetStopEndofday(ET); } if ((NextBarSdate != sDate and NextBarStime >= ST) or (NextBarSdate == sDate and NextBarStime >= ST and sTime < ST)) Then { if ET < ST Then SetStopEndofday(0); if NextBarOpen != c Then { if c > mav and Condition1 == False Then Buy("b",AtStop,NextBarOpen+PriceScale*10); if c < mav and Condition2 == False Then Sell("s",AtStop,NextBarOpen-PriceScale*10); } } Else { if h < DayOpen+PriceScale*10 and c > mav and Condition1 == False Then Buy("b1",AtStop,DayOpen+PriceScale*10); if l > DayOpen-PriceScale*10 and c < mav and Condition2 == False Then Sell("s1",AtStop,DayOpen-PriceScale*10); } } if NextBarOpen != c Then { if c > mav and Condition1 == False Then Buy("bb",AtStop,NextBarOpen+PriceScale*10); if c < mav and Condition2 == False Then Sell("ss",AtStop,NextBarOpen-PriceScale*10); } Else { if h < DayOpen+PriceScale*10 and c > mav and Condition1 == False Then Buy("b11",AtStop,DayOpen+PriceScale*10); if l > DayOpen-PriceScale*10 and c > mav and Condition2 == False Then Sell("s11",AtStop,DayOpen-PriceScale*10); } if NextBarOpen != c Then { if c > mav and Condition1 == False Then Buy("bbb",AtStop,NextBarOpen+PriceScale*10); if c < mav and Condition2 == False Then Sell("sbb",AtStop,NextBarOpen-PriceScale*10); } Else { if h < DayOpen+PriceScale*10 and c > mav and Condition1 == False Then Buy("b111",AtStop,DayOpen+PriceScale*10); if l > DayOpen-PriceScale*10 and c < mav and Condition2 == False Then Sell("s111",AtStop,DayOpen-PriceScale*10); } if NextBarOpen != c Then { if c > mav and Condition1 == False Then Buy("bbbb",AtStop,NextBarOpen+PriceScale*10); if c < mav and Condition2 == False Then Sell("bbbs",AtStop,NextBarOpen-PriceScale*10); } Else { if h < DayOpen+PriceScale*10 and c > mav and Condition1 == False Then Buy("b1111",AtStop,DayOpen+PriceScale*10); if l > DayOpen-PriceScale*10 and c < mav and Condition2 == False Then Sell("s1111",AtStop,DayOpen-PriceScale*10); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ----- 바이셀 0.7 90분봉 input : StartTime(140000),EndTime(50000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.50),ATRperiod(50); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then ExitLong ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> 1 Then ExitShort ("Vty_LE2", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE2)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then ExitShort ("Vty_LE3", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE3)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); --------------------------- > 푸른 님이 쓴 글입니다. > 제목 : Re : Re : Re : abs함수 > 안녕하세요 예스스탁입니다. 특정값에 abs함수를 사용하면 절대값으로 리턴합니다. plot1(data2(abs(C))+data3(abs(c))); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : Re : Re : abs함수 > 안녕하세요 예스스탁입니다. 절대값을 abs함수를 이용해 작성하시면 됩니다. abs(K-Y) K와 Y가 가중이평선이시면 var : K(0),Y(0); K = wma(c,5); Y = wma(C,20); plot1(abs(K-Y)); 즐거운 하루되세요 > 너무조아 님이 쓴 글입니다. > 제목 : 절대값의 수식 > 가중이평선(K) + - (Y)의 절대값을 구하는 수식을 작성해 주세요. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 3 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then ExitLong(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 4 input : StartTime(10000),EndTime(60000); input : 익절틱수(100),손절틱수(50); Var : Body(0),HighBody(0),Lowbody(0),Long(False),Midbody(0),T(0),S(0),mav(0); var : 샛별형(False),관통형(False),상승장악형(False); var : 석별형(False),흑운형(False),하락장악형(False); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Body = Abs(C-O); HighBody = Max(C,O); LowBody = Min(C,O); Midbody = (Open+Close)/2; If Abs(Open-Close) > Average(Abs(Open-Close),10)*2 Then Long = True; Else Long = False; mav = ma(C,10); 샛별형 = C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and C > O and C > C[2]; 관통형 = C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]; 상승장악형 = C[1] < Ma(c,10)[1] and C[1] < O[1] and C > O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; 석별형 = C[2] >= Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] > O[2] and Body[1] < Ma(Body,10)[1]*0.5 and LowBody[1]>HighBody[2]; 흑운형 = C[1] > Ma(C,10)[1] and C[1] > O[1] and Body[1] > Ma(Body,10)[1]*2 and C < O and Body > Ma(Body,10)*2 and O > H[1] and C <= MidBody[1]; 하락장악형 = C[1] >= Ma(C,10)[1] and C[1] > O[1] and C < O and Body > Ma(Body,10)*2 and Highbody > Highbody[1] and Lowbody < Lowbody[1]; if C < mav and (샛별형 or 관통형 or 상승장악형) Then { T = 1; S = 0; } if C > mav and (석별형 or 흑운형 or 하락장악형) Then { T = 1; S = 0; } if T == 1 Then { if CrossUp(C,mav) Then { S = S+1; if S == 2 and T == true Then Buy(); } } if T == -1 Then { if CrossDown(C,mav) Then { S = S+1; if S == 2 and T == true Then Sell(); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 1. input : StartTime(200000),EndTime(50000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } Inputs: VtyPercent(0.05),ATRperiod(5); If MarketPosition() <> 1 Then Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() <> -1 Then Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); If MarketPosition() == 1 Then Buy ("Vty_LE1", AtStop, Close + (VtyPercent * ATR(ATRperiod))); If MarketPosition() == -1 Then Sell ("Vty_SE1)", AtStop, Close - (VtyPercent * ATR(ATRperiod))); if MarketPosition == 1 Then Sell("bs",AtStop,EntryPrice-PriceScale*0); if MarketPosition == -1 Then Buy("sb",AtStop,EntryPrice+PriceScale*0); 2. input:length(5),a틱(10),b틱(10),c틱(5); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0); Array:HH[10,2](0),LL[10,2](0); input : StartTime(150000),EndTime(60000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } process = 0; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If LL[1,1] > L Then process = -1; If HH[1,1] < H Then process = 1; } Else If Highest(H,length) == H and lastHiVal <> H Then process = 1; Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1; If process == 1 Then { T = 1; lastHiVal = H; If HH[1,2] < LL[1,2] Then { For j = 10 DownTo 2 { HH[j,1] = HH[j-1,1]; HH[j,2] = HH[j-1,2]; } } If HH[1,2] < LL[1,2] or HH[1,1] < H Then { HH[1,1] = H; HH[1,2] = Index; sBar = Index - LL[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if LL[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 1); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2)); Text_SetStyle(Text1, 2, 1); } Text_SetStyle(Text1, 2, 1); } if MarketPosition <= 0 and HH[2,1] >= LL[2,1]+PriceScale*a틱 and LL[1,1] <= HH[2,1]-PriceScale*b틱 and Tcond == true Then Buy("b",AtStop,HH[2,1]+PriceScale*c틱); } If process == -1 Then { T = -1; lastLoVal = L; If LL[1,2] < HH[1,2] Then { For j = 10 DownTo 2 { LL[j,1] = LL[j-1,1]; LL[j,2] = LL[j-1,2]; } } If LL[1,2] < HH[1,2] or LL[1,1] > L Then { LL[1,1] = L; LL[1,2] = Index; sBar = Index - HH[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if HH[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } } if MarketPosition >= 0 and LL[2,1] <= HH[2,1]-PriceScale*a틱 and HH[1,1] >= LL[2,1]+PriceScale*b틱 and Tcond == true Then Sell("s",AtStop,LL[2,1]-PriceScale*c틱); } 위 2가지 수식어의 진입후 20틱내 청산금지와 손절40틱의 수식어를 추가 하고자 합니다. --------------------------- 아래 수식어를 추가로 부탁드리며 봉 완성시 기준입니다. 3. 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 매수 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50 4. 10분선 위에서 저녁별형, 흑운형, 약세장악형의 봉패턴중 하나 일때 1분 10분선 데드크로스 2회에서 매도 10분선 아래에서 샛별형, 관통형, 강세장악형의 봉패턴중 하나 일때 1분 10분선 골든크로스 2회에서 청산 매매시간은 해외선물 10 :00 ~ 익일 06 :00 , 익절 100 , 손절50