커뮤니티

문의 드립니다

프로필 이미지
푸른
2025-01-13 09:29:39
609
글번호 187117
답변완료
input:length(2),a틱(30),b틱(30),c틱(2); 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(100000),EndTime(53000); 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틱); } if MarketPosition == 1 and IsEntryName("b") == true Then Sell("bs",AtStop,EntryPrice-PriceScale*50); if MarketPosition == -1 and IsEntryName("s") == true Then Buy("sb",AtStop,EntryPrice+PriceScale*50); 위 수식어에 당일 매매중 70틱 수익에 매매정지를 포함해 주시면 감사하겠습니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-01-13 13:05:29

안녕하세요 예스스탁입니다. input:length(2),a틱(30),b틱(30),c틱(2); Input : 당일수익틱수(70); 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(100000),EndTime(53000); var : Tcond(false),당일수익(0),Xcond(False),N1(0),daypl(0); 당일수익 = PriceScale*당일수익틱수; 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 { IF Endtime <= starttime Then { SetStopEndofday(0); } Tcond = true; Xcond = false; N1 = NetProfit; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true ) then Xcond = true; } 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 Xcond == False 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 Xcond == False 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틱); } if MarketPosition == 1 and IsEntryName("b") == true and Xcond == False Then Sell("bs",AtStop,EntryPrice-PriceScale*50); if MarketPosition == -1 and IsEntryName("s") == true and Xcond == False Then Buy("sb",AtStop,EntryPrice+PriceScale*50); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다 > input:length(2),a틱(30),b틱(30),c틱(2); 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(100000),EndTime(53000); 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틱); } if MarketPosition == 1 and IsEntryName("b") == true Then Sell("bs",AtStop,EntryPrice-PriceScale*50); if MarketPosition == -1 and IsEntryName("s") == true Then Buy("sb",AtStop,EntryPrice+PriceScale*50); 위 수식어에 당일 매매중 70틱 수익에 매매정지를 포함해 주시면 감사하겠습니다.