커뮤니티
수정부탁드립니다------------
2012-02-03 09:30:15
463
글번호 47306
var:TEMA71(0),TEMA81(0),Ep(0),T1(0),T2(0),T3(0),TEMA82(0);
Input:이평(4),시작봉(3),허용치(10),변동폭(13),length1(200),높이조절(0.2);
input : N(10);
Input:추2(1),추4(1.01),추10(0.8),추20(0.5),추26(0.23),추30(0.2),추35(0.2),추45(0.2),추55(0.2),추65(0.2),추75(0.2),추90(0.2);
Var:단기봉기간(5),장기봉기간(7);
Var:당일손익(200000);
var : PLR(0),XCommission(0),XSlippage(0),OpenPL(0),dayPL(0),count(0);
#당일누적손익계산 시작
XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정
XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정
PLR = 0;
count = 0;
for var1 = 1 to 20{
if sdate == EntryDate(var1) Then{
count = count+1;
PLR = PLR+PositionProfit(var1);
}
}
if MarketPosition() == 0 Then{
OpenPL = 0;
dayPL = PLR;
}
Else{
OpenPL = (PositionProfit-(XCommission+XSlippage));
dayPL = PLR+OpenPL;
}
//당일누적손익계산 끝
//최고저테마값 시작*********************************************
if dayindex+1 < 단기봉기간 Then{
var71 = DayHigh;
var72 = DayLow;
}
Else{
var71 = highest(H,단기봉기간);
var72 = Lowest(L,단기봉기간);
}
value71 = (var71 - var72)/2+var72;
if dayindex+1 < 장기봉기간 Then{
var81 = DayHigh;
var82 = DayLow;
}
Else{
var81 = highest(H,장기봉기간);
var82 = Lowest(L,장기봉기간);
}
value81 = (var81 - var82)/2+var82;
TEMA71 = (3 * Ema(value71,LENGTH1)) - (3 * Ema(Ema(value71,LENGTH1),LENGTH1)) +
(Ema(Ema(Ema(value71,LENGTH1),LENGTH1),LENGTH1));
Ep = 2/(LENGTH1+1);
if dayindex == 0 Then
T1 = value81;
Else
T1 = value81*EP + T1[1] * (1-EP);
if dayindex <= 1 Then
T2 = T1;
Else
T2 = T1*EP + T2[1] * (1-EP);
if dayindex <= 2 Then
T3 = T2;
Else
T3 = T2*EP + T3[1] * (1-EP);
TEMA82 = (3 * T1) - (3 * T2) + (T3);
//최고저테마값 끝*********************************************
if date != date[1] Then
Condition1 = false;
//진입라인설정시작---------------------------------------------------
if DayIndex+1== 시작봉+1 Then{
if C > dayopen Then
var65 = o-PriceScale*허용치;
if C < dayopen Then
var65 = o+PriceScale*허용치;
}
if dayindex+1 == 시작봉+1 Then
var66 = O;
if highest(H,N)-lowest(L,N) <= C*(n*35/100/100) Then{
Condition1 = true;
var1 = highest(H,N);
var2 = lowest(L,N);
}
if Condition1 == False Then{
value1 = max(var65,var66);
value2 = min(var65,var66);
}
if Condition1 == true Then{
value1 = var1;
value2 = var2;
}
//진입라인설정시작---------------------------------------------------
value3 = ma(c,이평);
//value3 = TEMA82;
value6 = (당일손익/BigPointValue);
//---------진입식--------------------------------
if dayindex+1 >= 시작봉+1 and dayPL < value6 and stime < 150000 and count<1 Then{
if c <= value1 and value3[1] < value3-0.02 Then
buy("초b",AtStop,Value1-0.01);
if c >= value2 and value3[1] > value3+0.02 Then
sell("초s",AtStop,Value2+0.01);
}
if dayindex+1 >= 시작봉+1 and dayPL < value6 and stime < 150000 and count<1 Then{
if c <= value1 and value3[1] < value3 Then
buy("초b1",AtStop,Value1);
if c >= value2 and value3[1] > value3 Then
sell("초s1",AtStop,Value2);
}
if dayindex+1 >= 시작봉+1 and dayPL < value6 and count>0 and stime < 150000 Then{
if c <= value1 and value3[1] < value3+0.000 Then
buy("매수",AtStop,Value1);
if c >= value2 and value3[1] > value3-0.000 Then
sell("매도",AtStop,Value2);
}
//---------진입식끝--------------------------------
SetStopLoss(PriceScale*10,PointStop);
if MarketPosition == 1 Then{
value4 = highest(H,BarsSinceEntry);
if value4 >= EntryPrice+PriceScale*2 and value4 < EntryPrice+PriceScale*5 Then
exitlong("b추2",AtStop,value4-(value4-EntryPrice)*추2);
if value4 >= EntryPrice+PriceScale*4 and value4 < EntryPrice+PriceScale*10 Then
exitlong("b추4",AtStop,value4-(value4-EntryPrice)*추4);
if value4 >= EntryPrice+PriceScale*10 and value4 < EntryPrice+PriceScale*20 Then
exitlong("b추10",AtStop,value4-(value4-EntryPrice)*추10);
if value4 >= EntryPrice+PriceScale*20 and value4 < EntryPrice+PriceScale*26 Then
exitlong("b추20",AtStop,value4-(value4-EntryPrice)*추20);
if value4 >= EntryPrice+PriceScale*26 and value4 < EntryPrice+PriceScale*31 Then
exitlong("b추26",AtStop,value4-(value4-EntryPrice)*추26);
if value4 >= EntryPrice+PriceScale*30 and value4 < EntryPrice+PriceScale*36 Then
exitlong("b추30",AtStop,value4-(value4-EntryPrice)*추30);
if value4 >= EntryPrice+PriceScale*35 and value4 < EntryPrice+PriceScale*46 Then
exitlong("b추35",AtStop,value4-(value4-EntryPrice)*추35);
if value4 >= EntryPrice+PriceScale*45 and value4 < EntryPrice+PriceScale*56 Then
exitlong("b추45",AtStop,value4-(value4-EntryPrice)*추45);
if value4 >= EntryPrice+PriceScale*55 and value4 < EntryPrice+PriceScale*66 Then
exitlong("b추55",AtStop,value4-(value4-EntryPrice)*추55);
if value4 >= EntryPrice+PriceScale*65 and value4 < EntryPrice+PriceScale*76 Then
exitlong("b추65",AtStop,value4-(value4-EntryPrice)*추65);
if value4 >= EntryPrice+PriceScale*75 and value4 < EntryPrice+PriceScale*91 Then
exitlong("b추75",AtStop,value4-(value4-EntryPrice)*추75);
if value4 >= EntryPrice+PriceScale*90 Then
exitlong("b추90",AtStop,value4-(value4-EntryPrice)*추90);
}
if MarketPosition == -1 Then{
value5 = Lowest(L,BarsSinceEntry);
if value5 <= EntryPrice-PriceScale*2 and value5 > EntryPrice-PriceScale*5 Then
ExitShort("s추2",AtStop,value5+(entryprice-value5)*추2);
if value5 <= EntryPrice-PriceScale*4 and value5 > EntryPrice-PriceScale*10 Then
ExitShort("s추4",AtStop,value5+(entryprice-value5)*추4);
if value5 <= EntryPrice-PriceScale*10 and value5 > EntryPrice-PriceScale*20 Then
ExitShort("s추10",AtStop,value5+(entryprice-value5)*추10);
if value5 <= EntryPrice-PriceScale*20 and value5 > EntryPrice-PriceScale*27 Then
ExitShort("s추20",AtStop,value5+(entryprice-value5)*추20);
if value5 <= EntryPrice-PriceScale*26 and value5 > EntryPrice-PriceScale*31 Then
ExitShort("s추26",AtStop,value5+(entryprice-value5)*추26);
if value5 <= EntryPrice-PriceScale*30 and value5 > EntryPrice-PriceScale*36 Then
ExitShort("s추30",AtStop,value5+(entryprice-value5)*추30);
if value5 <= EntryPrice-PriceScale*35 and value5 > EntryPrice-PriceScale*46 Then
ExitShort("s추35",AtStop,value5+(entryprice-value5)*추35);
if value5 <= EntryPrice-PriceScale*45 and value5 > EntryPrice-PriceScale*56 Then
ExitShort("s추45",AtStop,value5+(entryprice-value5)*추45);
if value5 <= EntryPrice-PriceScale*55 and value5 > EntryPrice-PriceScale*66 Then
ExitShort("s추55",AtStop,value5+(entryprice-value5)*추55);
if value5 <= EntryPrice-PriceScale*65 and value5 > EntryPrice-PriceScale*76 Then
ExitShort("s추65",AtStop,value5+(entryprice-value5)*추65);
if value5 <= EntryPrice-PriceScale*75 and value5 > EntryPrice-PriceScale*91 Then
ExitShort("s추75",AtStop,value5+(entryprice-value5)*추75);
if value5 <= EntryPrice-PriceScale*90 Then
ExitShort("s추90",AtStop,value5+(entryprice-value5)*추90);
}
if MarketPosition == 1 Then{
ExitLong("bxx",AtStop,EntryPrice+(-(value6)-(PLR)));
}
if MarketPosition == -1 Then{
ExitShort("sxx",AtStop,EntryPrice+((value6)+(PLR)));
}
//시간청산------------------------------------------------------------
var91 = int(date/100)-int(date/10000)*100; //월
var92 = date - int(date/100)*100; //일
var93 = DayOfWeek(date); //요일
if var91%3 == 0 and var92 >= 8 and var92 <= 14 and var93 == 4 then {
SetStopEndofday(144800);
}
else {
SetStopEndofday(150100);
}
-------------------------------------------------------------
수고하십니다
2가지부탁드립니다
1)장중진입라인 생성시까지 진입금지
2)아래 지표식의 높이조절대로 위시스템식에 적용해주세요
---------------높이조절 지표식---------------------
Input:단기봉기간(5),장기봉기간(7),높이조절(0.2);
var:TEMA71(0),TEMA81(0),Ep(0),T1(0),T2(0),T3(0),TEMA82(0);
Input:시작봉(3),허용치(10),변동폭(13),length1(200);
input : N(10);
//최고저테마값 시작*********************************************
if dayindex+1 < 단기봉기간 Then{
var71 = DayHigh;
var72 = DayLow;
}
Else{
var71 = highest(H,단기봉기간);
var72 = Lowest(L,단기봉기간);
}
value71 = (var71 - var72)/2+var72;
if dayindex+1 < 장기봉기간 Then{
var81 = DayHigh;
var82 = DayLow;
}
Else{
var81 = highest(H,장기봉기간);
var82 = Lowest(L,장기봉기간);
}
value81 = (var81 - var82)/2+var82;
TEMA71 = (3 * Ema(value71,LENGTH1)) - (3 * Ema(Ema(value71,LENGTH1),LENGTH1)) +
(Ema(Ema(Ema(value71,LENGTH1),LENGTH1),LENGTH1));
Ep = 2/(LENGTH1+1);
if dayindex == 0 Then
T1 = value81;
Else
T1 = value81*EP + T1[1] * (1-EP);
if dayindex <= 1 Then
T2 = T1;
Else
T2 = T1*EP + T2[1] * (1-EP);
if dayindex <= 2 Then
T3 = T2;
Else
T3 = T2*EP + T3[1] * (1-EP);
TEMA82 = (3 * T1) - (3 * T2) + (T3);
plot3(TEMA82);
//최고저테마값 끝*********************************************
if date != date[1] Then
Condition1 = false;
//아침진입라인 끝
//장중진입라인 시작
if highest(H,N)-lowest(L,N) <= C*(변동폭/10000) Then{
Condition1 = true;
var1 = highest(H,N);
var2 = lowest(L,N);
}
//--------높이조절------------
if Condition1 == true Then{
if TEMA82 > TEMA82[1] Then{
plot1(var1-높이조절);
plot2(var2-높이조절);
}
Else{
plot1(var1+높이조절);
plot2(var2+높이조절);
}
}
- 1. 47656_장중진입수정1.xls (0.18 MB)
답변 1
예스스탁 예스스탁 답변
2012-02-03 11:18:15
안녕하세요? 예스스탁입니다.
먼저 답변드린 담당자가 휴가중이라 내용을 정확히 알지 못해서 답변드리기 어려울 것 같습니다. 월요일에 다시한번 올려주시면 답변드리도록 하겠습니다.
감사합니다.
> leekss1 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다------------
> var:TEMA71(0),TEMA81(0),Ep(0),T1(0),T2(0),T3(0),TEMA82(0);
Input:이평(4),시작봉(3),허용치(10),변동폭(13),length1(200),높이조절(0.2);
input : N(10);
Input:추2(1),추4(1.01),추10(0.8),추20(0.5),추26(0.23),추30(0.2),추35(0.2),추45(0.2),추55(0.2),추65(0.2),추75(0.2),추90(0.2);
Var:단기봉기간(5),장기봉기간(7);
Var:당일손익(200000);
var : PLR(0),XCommission(0),XSlippage(0),OpenPL(0),dayPL(0),count(0);
#당일누적손익계산 시작
XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정
XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정
PLR = 0;
count = 0;
for var1 = 1 to 20{
if sdate == EntryDate(var1) Then{
count = count+1;
PLR = PLR+PositionProfit(var1);
}
}
if MarketPosition() == 0 Then{
OpenPL = 0;
dayPL = PLR;
}
Else{
OpenPL = (PositionProfit-(XCommission+XSlippage));
dayPL = PLR+OpenPL;
}
//당일누적손익계산 끝
//최고저테마값 시작*********************************************
if dayindex+1 < 단기봉기간 Then{
var71 = DayHigh;
var72 = DayLow;
}
Else{
var71 = highest(H,단기봉기간);
var72 = Lowest(L,단기봉기간);
}
value71 = (var71 - var72)/2+var72;
if dayindex+1 < 장기봉기간 Then{
var81 = DayHigh;
var82 = DayLow;
}
Else{
var81 = highest(H,장기봉기간);
var82 = Lowest(L,장기봉기간);
}
value81 = (var81 - var82)/2+var82;
TEMA71 = (3 * Ema(value71,LENGTH1)) - (3 * Ema(Ema(value71,LENGTH1),LENGTH1)) +
(Ema(Ema(Ema(value71,LENGTH1),LENGTH1),LENGTH1));
Ep = 2/(LENGTH1+1);
if dayindex == 0 Then
T1 = value81;
Else
T1 = value81*EP + T1[1] * (1-EP);
if dayindex <= 1 Then
T2 = T1;
Else
T2 = T1*EP + T2[1] * (1-EP);
if dayindex <= 2 Then
T3 = T2;
Else
T3 = T2*EP + T3[1] * (1-EP);
TEMA82 = (3 * T1) - (3 * T2) + (T3);
//최고저테마값 끝*********************************************
if date != date[1] Then
Condition1 = false;
//진입라인설정시작---------------------------------------------------
if DayIndex+1== 시작봉+1 Then{
if C > dayopen Then
var65 = o-PriceScale*허용치;
if C < dayopen Then
var65 = o+PriceScale*허용치;
}
if dayindex+1 == 시작봉+1 Then
var66 = O;
if highest(H,N)-lowest(L,N) <= C*(n*35/100/100) Then{
Condition1 = true;
var1 = highest(H,N);
var2 = lowest(L,N);
}
if Condition1 == False Then{
value1 = max(var65,var66);
value2 = min(var65,var66);
}
if Condition1 == true Then{
value1 = var1;
value2 = var2;
}
//진입라인설정시작---------------------------------------------------
value3 = ma(c,이평);
//value3 = TEMA82;
value6 = (당일손익/BigPointValue);
//---------진입식--------------------------------
if dayindex+1 >= 시작봉+1 and dayPL < value6 and stime < 150000 and count<1 Then{
if c <= value1 and value3[1] < value3-0.02 Then
buy("초b",AtStop,Value1-0.01);
if c >= value2 and value3[1] > value3+0.02 Then
sell("초s",AtStop,Value2+0.01);
}
if dayindex+1 >= 시작봉+1 and dayPL < value6 and stime < 150000 and count<1 Then{
if c <= value1 and value3[1] < value3 Then
buy("초b1",AtStop,Value1);
if c >= value2 and value3[1] > value3 Then
sell("초s1",AtStop,Value2);
}
if dayindex+1 >= 시작봉+1 and dayPL < value6 and count>0 and stime < 150000 Then{
if c <= value1 and value3[1] < value3+0.000 Then
buy("매수",AtStop,Value1);
if c >= value2 and value3[1] > value3-0.000 Then
sell("매도",AtStop,Value2);
}
//---------진입식끝--------------------------------
SetStopLoss(PriceScale*10,PointStop);
if MarketPosition == 1 Then{
value4 = highest(H,BarsSinceEntry);
if value4 >= EntryPrice+PriceScale*2 and value4 < EntryPrice+PriceScale*5 Then
exitlong("b추2",AtStop,value4-(value4-EntryPrice)*추2);
if value4 >= EntryPrice+PriceScale*4 and value4 < EntryPrice+PriceScale*10 Then
exitlong("b추4",AtStop,value4-(value4-EntryPrice)*추4);
if value4 >= EntryPrice+PriceScale*10 and value4 < EntryPrice+PriceScale*20 Then
exitlong("b추10",AtStop,value4-(value4-EntryPrice)*추10);
if value4 >= EntryPrice+PriceScale*20 and value4 < EntryPrice+PriceScale*26 Then
exitlong("b추20",AtStop,value4-(value4-EntryPrice)*추20);
if value4 >= EntryPrice+PriceScale*26 and value4 < EntryPrice+PriceScale*31 Then
exitlong("b추26",AtStop,value4-(value4-EntryPrice)*추26);
if value4 >= EntryPrice+PriceScale*30 and value4 < EntryPrice+PriceScale*36 Then
exitlong("b추30",AtStop,value4-(value4-EntryPrice)*추30);
if value4 >= EntryPrice+PriceScale*35 and value4 < EntryPrice+PriceScale*46 Then
exitlong("b추35",AtStop,value4-(value4-EntryPrice)*추35);
if value4 >= EntryPrice+PriceScale*45 and value4 < EntryPrice+PriceScale*56 Then
exitlong("b추45",AtStop,value4-(value4-EntryPrice)*추45);
if value4 >= EntryPrice+PriceScale*55 and value4 < EntryPrice+PriceScale*66 Then
exitlong("b추55",AtStop,value4-(value4-EntryPrice)*추55);
if value4 >= EntryPrice+PriceScale*65 and value4 < EntryPrice+PriceScale*76 Then
exitlong("b추65",AtStop,value4-(value4-EntryPrice)*추65);
if value4 >= EntryPrice+PriceScale*75 and value4 < EntryPrice+PriceScale*91 Then
exitlong("b추75",AtStop,value4-(value4-EntryPrice)*추75);
if value4 >= EntryPrice+PriceScale*90 Then
exitlong("b추90",AtStop,value4-(value4-EntryPrice)*추90);
}
if MarketPosition == -1 Then{
value5 = Lowest(L,BarsSinceEntry);
if value5 <= EntryPrice-PriceScale*2 and value5 > EntryPrice-PriceScale*5 Then
ExitShort("s추2",AtStop,value5+(entryprice-value5)*추2);
if value5 <= EntryPrice-PriceScale*4 and value5 > EntryPrice-PriceScale*10 Then
ExitShort("s추4",AtStop,value5+(entryprice-value5)*추4);
if value5 <= EntryPrice-PriceScale*10 and value5 > EntryPrice-PriceScale*20 Then
ExitShort("s추10",AtStop,value5+(entryprice-value5)*추10);
if value5 <= EntryPrice-PriceScale*20 and value5 > EntryPrice-PriceScale*27 Then
ExitShort("s추20",AtStop,value5+(entryprice-value5)*추20);
if value5 <= EntryPrice-PriceScale*26 and value5 > EntryPrice-PriceScale*31 Then
ExitShort("s추26",AtStop,value5+(entryprice-value5)*추26);
if value5 <= EntryPrice-PriceScale*30 and value5 > EntryPrice-PriceScale*36 Then
ExitShort("s추30",AtStop,value5+(entryprice-value5)*추30);
if value5 <= EntryPrice-PriceScale*35 and value5 > EntryPrice-PriceScale*46 Then
ExitShort("s추35",AtStop,value5+(entryprice-value5)*추35);
if value5 <= EntryPrice-PriceScale*45 and value5 > EntryPrice-PriceScale*56 Then
ExitShort("s추45",AtStop,value5+(entryprice-value5)*추45);
if value5 <= EntryPrice-PriceScale*55 and value5 > EntryPrice-PriceScale*66 Then
ExitShort("s추55",AtStop,value5+(entryprice-value5)*추55);
if value5 <= EntryPrice-PriceScale*65 and value5 > EntryPrice-PriceScale*76 Then
ExitShort("s추65",AtStop,value5+(entryprice-value5)*추65);
if value5 <= EntryPrice-PriceScale*75 and value5 > EntryPrice-PriceScale*91 Then
ExitShort("s추75",AtStop,value5+(entryprice-value5)*추75);
if value5 <= EntryPrice-PriceScale*90 Then
ExitShort("s추90",AtStop,value5+(entryprice-value5)*추90);
}
if MarketPosition == 1 Then{
ExitLong("bxx",AtStop,EntryPrice+(-(value6)-(PLR)));
}
if MarketPosition == -1 Then{
ExitShort("sxx",AtStop,EntryPrice+((value6)+(PLR)));
}
//시간청산------------------------------------------------------------
var91 = int(date/100)-int(date/10000)*100; //월
var92 = date - int(date/100)*100; //일
var93 = DayOfWeek(date); //요일
if var91%3 == 0 and var92 >= 8 and var92 <= 14 and var93 == 4 then {
SetStopEndofday(144800);
}
else {
SetStopEndofday(150100);
}
-------------------------------------------------------------
수고하십니다
2가지부탁드립니다
1)장중진입라인 생성시까지 진입금지
2)아래 지표식의 높이조절대로 위시스템식에 적용해주세요
---------------높이조절 지표식---------------------
Input:단기봉기간(5),장기봉기간(7),높이조절(0.2);
var:TEMA71(0),TEMA81(0),Ep(0),T1(0),T2(0),T3(0),TEMA82(0);
Input:시작봉(3),허용치(10),변동폭(13),length1(200);
input : N(10);
//최고저테마값 시작*********************************************
if dayindex+1 < 단기봉기간 Then{
var71 = DayHigh;
var72 = DayLow;
}
Else{
var71 = highest(H,단기봉기간);
var72 = Lowest(L,단기봉기간);
}
value71 = (var71 - var72)/2+var72;
if dayindex+1 < 장기봉기간 Then{
var81 = DayHigh;
var82 = DayLow;
}
Else{
var81 = highest(H,장기봉기간);
var82 = Lowest(L,장기봉기간);
}
value81 = (var81 - var82)/2+var82;
TEMA71 = (3 * Ema(value71,LENGTH1)) - (3 * Ema(Ema(value71,LENGTH1),LENGTH1)) +
(Ema(Ema(Ema(value71,LENGTH1),LENGTH1),LENGTH1));
Ep = 2/(LENGTH1+1);
if dayindex == 0 Then
T1 = value81;
Else
T1 = value81*EP + T1[1] * (1-EP);
if dayindex <= 1 Then
T2 = T1;
Else
T2 = T1*EP + T2[1] * (1-EP);
if dayindex <= 2 Then
T3 = T2;
Else
T3 = T2*EP + T3[1] * (1-EP);
TEMA82 = (3 * T1) - (3 * T2) + (T3);
plot3(TEMA82);
//최고저테마값 끝*********************************************
if date != date[1] Then
Condition1 = false;
//아침진입라인 끝
//장중진입라인 시작
if highest(H,N)-lowest(L,N) <= C*(변동폭/10000) Then{
Condition1 = true;
var1 = highest(H,N);
var2 = lowest(L,N);
}
//--------높이조절------------
if Condition1 == true Then{
if TEMA82 > TEMA82[1] Then{
plot1(var1-높이조절);
plot2(var2-높이조절);
}
Else{
plot1(var1+높이조절);
plot2(var2+높이조절);
}
}