커뮤니티
수정해주세요-----------------------------
2010-11-28 17:09:40
712
글번호 33935
항상감사합니다
INPUTS: R(12), S(5), U(5),매수전봉차(1.8),매도전봉차(2),손절치(28),익절치(50),연속봉(50);
VALUE1 = TSI(C, R, S, U);
if stime >= 93000 and stime < 145000 then{
if value1 >= value1[1]+매수전봉차 or countif(value1 > value1[1],연속봉) == 연속봉 Then
Buy();
if MarketPosition == 1 Then{
ExitLong("bx1",AtStop,EntryPrice-PriceScale*손절치);
ExitLong("bx2",AtStop,highest(H,BarsSinceEntry)-PriceScale*익절치);
}
if value1 <= value1[1]-매도전봉차 or countif(value1 < value1[1],연속봉) == 연속봉 Then
sell();
if MarketPosition == -1 Then{
ExitShort("sx1",AtStop,EntryPrice+PriceScale*손절치);
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*익절치);
}
}
위의두가지매수(매도)를 나누어서수식해주세요
전봉차 매수(매도)방법 은 buy1(sell1)
연속봉 매수(매도)방법 은 buy2(sell2)
로 해주시고요
연속봉에의해 진입한경우 진입후 5봉이내에 tsi방향이바뀌면서 전봉과차이가 0.5이상이면 청산해주세요
(혹시 틱데이타 구할수있는 방법좀알려주세요)
답변 1
예스스탁 예스스탁 답변
2010-11-29 16:24:28
안녕하세요
예스스탁입니다.
INPUTS: R(12), S(5), U(5),매수전봉차(1.8),매도전봉차(2),손절치(28),익절치(50),연속봉(50);
var : cnt(0),count(0);
VALUE1 = TSI(C, R, S, U);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if stime >= 93000 and stime < 145000 then{
if value1 >= value1[1]+매수전봉차 Then
buy("Buy1");
if (count == 0 and countif(value1 > value1[1],연속봉) == 연속봉) Or
(count > 0 and BarsSinceExit(1) >= 10 and countif(value1 > value1[1],연속봉) == 연속봉) Then
Buy("buy2");
if MarketPosition == 1 Then{
ExitLong("bx1",AtStop,EntryPrice-PriceScale*손절치);
ExitLong("bx2",AtStop,highest(H,BarsSinceEntry)-PriceScale*익절치);
if IsEntryName("buy2") == true and BarsSinceEntry < 5 and value1 <= value1[1]-0.5 Then
exitlong("bx3");
}
if value1 <= value1[1]-매도전봉차 Then
sell("sell1");
if (count == 0 and countif(value1 < value1[1],연속봉) == 연속봉) Or
(count > 0 and BarsSinceExit(1) >= 10 and countif(value1 < value1[1],연속봉) == 연속봉) Then
sell("sell2");
if MarketPosition == -1 Then{
ExitShort("sx1",AtStop,EntryPrice+PriceScale*손절치);
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*익절치);
if BarsSinceEntry < 5 and value1 >= value1[1]+0.5 Then
ExitShort("sx3");
}
}
즐거운 하루되세요
이전글