커뮤니티
한가지만 바꿔 주십시요.
2013-09-08 17:40:23
111
글번호 67323
청산, 한가지 바꿔 주세요...
*오늘 매수되었고, 14:40시에 매수가 대비 5% 이상 상승했다면 다음 첫봉에 청산.을
*오늘 매수되었고, 매수가 대비 주가가 6% 상승시 다음 첫봉에 청산. 으로 바꿔 주십시요.
감사합니다.
=================================================
input : P(5);
var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0);
if date != date[1] Then
Daycnt = daycnt+1;
sum = 0;
sum1 = 0;
for cnt = 0 to P-1{
sum = sum+DayClose(cnt);
sum1 = sum1+DayClose(cnt+1);
}
mav = sum/P;
mav1 = sum1/P;
dis = c/mav*100;
dis1 = DayClose(1)/mav1*100;
if date != date[1] Then
var1 = O/mav*100;
if ExitDate(1) != sdate and
MarketPosition == 0 and
var1 > 100 and
dayhigh <= DayClose(1)*1.10 and
dayopen <= DayClose(1)*1.06 and
dis1 >= 104 then{
if daylow <= DayClose(1)*0.99 and
daylow > DayClose(1)*0.96 and
dis >= 100 and dis <= 102.5 Then
buy("매수1");
if daylow <= DayClose(1)*0.96 and
daylow > DayClose(1)*0.93 and
dis >= 100 and dis <= 102.75 Then
buy("매수2");
if daylow <= DayClose(1)*0.93 and
daylow > DayClose(1)*0.90 and
dis >= 100 and dis <= 103 Then
buy("매수3");
if daylow <= DayClose(1)*0.90 and
daylow > DayClose(1)*0.87 and
dis >= 100 and dis <= 103.25 Then
buy("매수4");
if daylow <= DayClose(1)*0.87 and
dis >= 100 and dis <= 103.5 Then
buy("매수5");
}
if MarketPosition == 1 Then{
exitlong("Profit",Atlimit,EntryPrice*1.135);
exitlong("bx1",AtStop,EntryPrice*0.865,"매수1");
exitlong("bx2",AtStop,EntryPrice*0.87,"매수2");
exitlong("bx3",AtStop,EntryPrice*0.875,"매수3");
exitlong("bx4",AtStop,EntryPrice*0.88,"매수4");
exitlong("bx5",AtStop,EntryPrice*0.885,"매수5");
if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then
ExitLong("x");
}
답변 1
예스스탁 예스스탁 답변
2013-09-09 13:19:08
안녕하세요
예스스탁입니다.
올려주신 식에 말씀하신 청산식이 없습니다.
bx라는 이름으로 추가했습니다.
input : P(5);
var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0);
if date != date[1] Then
Daycnt = daycnt+1;
sum = 0;
sum1 = 0;
for cnt = 0 to P-1{
sum = sum+DayClose(cnt);
sum1 = sum1+DayClose(cnt+1);
}
mav = sum/P;
mav1 = sum1/P;
dis = c/mav*100;
dis1 = DayClose(1)/mav1*100;
if date != date[1] Then
var1 = O/mav*100;
if ExitDate(1) != sdate and
MarketPosition == 0 and
var1 > 100 and
dayhigh <= DayClose(1)*1.10 and
dayopen <= DayClose(1)*1.06 and
dis1 >= 104 then{
if daylow <= DayClose(1)*0.99 and
daylow > DayClose(1)*0.96 and
dis >= 100 and dis <= 102.5 Then
buy("매수1");
if daylow <= DayClose(1)*0.96 and
daylow > DayClose(1)*0.93 and
dis >= 100 and dis <= 102.75 Then
buy("매수2");
if daylow <= DayClose(1)*0.93 and
daylow > DayClose(1)*0.90 and
dis >= 100 and dis <= 103 Then
buy("매수3");
if daylow <= DayClose(1)*0.90 and
daylow > DayClose(1)*0.87 and
dis >= 100 and dis <= 103.25 Then
buy("매수4");
if daylow <= DayClose(1)*0.87 and
dis >= 100 and dis <= 103.5 Then
buy("매수5");
}
if MarketPosition == 1 Then{
exitlong("Profit",Atlimit,EntryPrice*1.135);
exitlong("bx1",AtStop,EntryPrice*0.865,"매수1");
exitlong("bx2",AtStop,EntryPrice*0.87,"매수2");
exitlong("bx3",AtStop,EntryPrice*0.875,"매수3");
exitlong("bx4",AtStop,EntryPrice*0.88,"매수4");
exitlong("bx5",AtStop,EntryPrice*0.885,"매수5");
if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then
ExitLong("x");
if sdate == EntryDate and stime == 144000 and C >= EntryPrice*1.06 Then
ExitLong("bx");
}
즐거운 하루되세요
> 쌀사비팔 님이 쓴 글입니다.
> 제목 : 한가지만 바꿔 주십시요.
>
청산, 한가지 바꿔 주세요...
*오늘 매수되었고, 14:40시에 매수가 대비 5% 이상 상승했다면 다음 첫봉에 청산.을
*오늘 매수되었고, 매수가 대비 주가가 6% 상승시 다음 첫봉에 청산. 으로 바꿔 주십시요.
감사합니다.
=================================================
input : P(5);
var : cnt(0),sum(0),sum1(0),mav(0),mav1(0),dis(0),dis1(0),daycnt(0);
if date != date[1] Then
Daycnt = daycnt+1;
sum = 0;
sum1 = 0;
for cnt = 0 to P-1{
sum = sum+DayClose(cnt);
sum1 = sum1+DayClose(cnt+1);
}
mav = sum/P;
mav1 = sum1/P;
dis = c/mav*100;
dis1 = DayClose(1)/mav1*100;
if date != date[1] Then
var1 = O/mav*100;
if ExitDate(1) != sdate and
MarketPosition == 0 and
var1 > 100 and
dayhigh <= DayClose(1)*1.10 and
dayopen <= DayClose(1)*1.06 and
dis1 >= 104 then{
if daylow <= DayClose(1)*0.99 and
daylow > DayClose(1)*0.96 and
dis >= 100 and dis <= 102.5 Then
buy("매수1");
if daylow <= DayClose(1)*0.96 and
daylow > DayClose(1)*0.93 and
dis >= 100 and dis <= 102.75 Then
buy("매수2");
if daylow <= DayClose(1)*0.93 and
daylow > DayClose(1)*0.90 and
dis >= 100 and dis <= 103 Then
buy("매수3");
if daylow <= DayClose(1)*0.90 and
daylow > DayClose(1)*0.87 and
dis >= 100 and dis <= 103.25 Then
buy("매수4");
if daylow <= DayClose(1)*0.87 and
dis >= 100 and dis <= 103.5 Then
buy("매수5");
}
if MarketPosition == 1 Then{
exitlong("Profit",Atlimit,EntryPrice*1.135);
exitlong("bx1",AtStop,EntryPrice*0.865,"매수1");
exitlong("bx2",AtStop,EntryPrice*0.87,"매수2");
exitlong("bx3",AtStop,EntryPrice*0.875,"매수3");
exitlong("bx4",AtStop,EntryPrice*0.88,"매수4");
exitlong("bx5",AtStop,EntryPrice*0.885,"매수5");
if daycnt >= daycnt[BarsSinceEntry]+3 and (stime == 140000 or (stime > 141000 and stime[1] < 141000)) Then
ExitLong("x");
}
다음글
이전글