커뮤니티
몇퍼이상에서
2017-03-13 15:52:05
117
글번호 107707
매수진입 금지하는 수식이 있을까요?
예를들면 20퍼이상 주식은 매수를 금지 한다.
그리고 현재 MACD로 매수매도 하는데, MACD오실리케이터로 바꾸고.
MACD오실리케이터의 막대가 파랑으로 변할경우 잔량 완전매도하는 내용을 추가하고 싶습니다..
input : short(12),long(26),VP(20),P1(5),P2(24);
var : MACDV(0),Vma(0),Cma1(0),Cma2(0);
MACDV = MACD(Short,long);
Vma = ma(v,VP);
Cma1 = ma(C,P1);
Cma2 = ma(C,P2);
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0),T1(0),T2(0);
TCHAN = HIGHEST(HIGH, LENGTH)[1];
BCHAN = LOWEST(LOW, LENGTH)[1];
var3 = Upvol/DownVol*100;
var4 = ma(var3,20);
if C >=dayclose(1) and MACDV > 0 and C > O and V >= Vma*1.5 and Cma1 >Cma2 and var3 >= 120 and var3 >= var4[1]+30 Then
buy("매수",atlimit,TCHAN); #체결강도가 120이상이거나 전봉기준 20개봉 평균보다 30이상 큼
var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false);
var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false);
if MarketPosition == 1 then{
HH = highest(H,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then
Bxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then
Bxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then
Bxcond3 = true;
if Bxcond1 == false and HH >= EntryPrice*1.02 and HH < EntryPrice*1.03 Then
ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(1/5)),1);
if Bxcond2 == false and HH >= EntryPrice*1.03 and HH < EntryPrice*1.05 Then
ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(2/5)),1);
if Bxcond3 == false and HH >= EntryPrice*1.07 Then
ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.1);
}
Else{
Bxcond1 = false;
Bxcond2 = false;
Bxcond3 = false;
}
if MarketPosition == -1 then{
LL = Lowest(L,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx1" Then
Sxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx2" Then
Sxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx3" Then
Sxcond3 = true;
if Sxcond1 == false and LL <= EntryPrice*0.97 and LL < EntryPrice*0.95 Then
ExitShort("Sx1",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1);
if Sxcond2 == false and LL <= EntryPrice*0.95 and LL < EntryPrice*0.93 Then
ExitShort("Sx2",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1);
if Sxcond3 == false and LL <= EntryPrice*0.90 Then
ExitShort("Sx3",AtStop,LL+(EntryPrice-LL)*0.3);
}
Else{
Sxcond1 = false;
Sxcond2 = false;
Sxcond3 = false;
}
답변 1
예스스탁 예스스탁 답변
2017-03-13 18:02:14
안녕하세요
예스스탁입니다.
20%이상 주식이 어떤의미인지 정확치 않습니다.
전일종가대비 20%이상 상승한 종목은 매수되지 않게 추가했습니다.
매수 후 MACD오실레이터가 0을 하향하면 청산하게 추가했습니다.
input : short(12),long(26),sig(9),VP(20),P1(5),P2(24);
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0),T1(0),T2(0);
var : MACDV(0),MACDS(0),MACDO(0),Vma(0),Cma1(0),Cma2(0);
var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false);
var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false);
MACDV = MACD(Short,long);
MACDS = ema(MACDV,sig);
MACDO = MACDV-MACDS;
Vma = ma(v,VP);
Cma1 = ma(C,P1);
Cma2 = ma(C,P2);
TCHAN = HIGHEST(HIGH, LENGTH)[1];
BCHAN = LOWEST(LOW, LENGTH)[1];
var3 = Upvol/DownVol*100;
var4 = ma(var3,20);
if C >=dayclose(1) and MACDV > 0 and C > O and V >= Vma*1.5 and Cma1 >Cma2 and
var3 >= 120 and var3 >= var4[1]+30 and dayhigh < DayClose(1)*1.20 Then
buy("매수",atlimit,TCHAN); #체결강도가 120이상이거나 전봉기준 20개봉 평균보다 30이상 큼
if MarketPosition == 1 then{
HH = highest(H,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then
Bxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then
Bxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then
Bxcond3 = true;
if Bxcond1 == false and HH >= EntryPrice*1.02 and HH < EntryPrice*1.03 Then
ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(1/5)),1);
if Bxcond2 == false and HH >= EntryPrice*1.03 and HH < EntryPrice*1.05 Then
ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(2/5)),1);
if Bxcond3 == false and HH >= EntryPrice*1.07 Then
ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.1);
if CrossDown(MACDO,0) Then
exitlong("bx4");
}
Else{
Bxcond1 = false;
Bxcond2 = false;
Bxcond3 = false;
}
if MarketPosition == -1 then{
LL = Lowest(L,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx1" Then
Sxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx2" Then
Sxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx3" Then
Sxcond3 = true;
if Sxcond1 == false and LL <= EntryPrice*0.97 and LL < EntryPrice*0.95 Then
ExitShort("Sx1",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1);
if Sxcond2 == false and LL <= EntryPrice*0.95 and LL < EntryPrice*0.93 Then
ExitShort("Sx2",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1);
if Sxcond3 == false and LL <= EntryPrice*0.90 Then
ExitShort("Sx3",AtStop,LL+(EntryPrice-LL)*0.3);
if CrossUp(MACDO,0) Then
ExitShort("sx4");
}
Else{
Sxcond1 = false;
Sxcond2 = false;
Sxcond3 = false;
}
즐거운 하루되세요
> 바나 님이 쓴 글입니다.
> 제목 : 몇퍼이상에서
> 매수진입 금지하는 수식이 있을까요?
예를들면 20퍼이상 주식은 매수를 금지 한다.
그리고 현재 MACD로 매수매도 하는데, MACD오실리케이터로 바꾸고.
MACD오실리케이터의 막대가 파랑으로 변할경우 잔량 완전매도하는 내용을 추가하고 싶습니다..
input : short(12),long(26),VP(20),P1(5),P2(24);
var : MACDV(0),Vma(0),Cma1(0),Cma2(0);
MACDV = MACD(Short,long);
Vma = ma(v,VP);
Cma1 = ma(C,P1);
Cma2 = ma(C,P2);
INPUT : LENGTH(10);
VAR : TCHAN(0), BCHAN(0),T1(0),T2(0);
TCHAN = HIGHEST(HIGH, LENGTH)[1];
BCHAN = LOWEST(LOW, LENGTH)[1];
var3 = Upvol/DownVol*100;
var4 = ma(var3,20);
if C >=dayclose(1) and MACDV > 0 and C > O and V >= Vma*1.5 and Cma1 >Cma2 and var3 >= 120 and var3 >= var4[1]+30 Then
buy("매수",atlimit,TCHAN); #체결강도가 120이상이거나 전봉기준 20개봉 평균보다 30이상 큼
var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false);
var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false);
if MarketPosition == 1 then{
HH = highest(H,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then
Bxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then
Bxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then
Bxcond3 = true;
if Bxcond1 == false and HH >= EntryPrice*1.02 and HH < EntryPrice*1.03 Then
ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(1/5)),1);
if Bxcond2 == false and HH >= EntryPrice*1.03 and HH < EntryPrice*1.05 Then
ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(2/5)),1);
if Bxcond3 == false and HH >= EntryPrice*1.07 Then
ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.1);
}
Else{
Bxcond1 = false;
Bxcond2 = false;
Bxcond3 = false;
}
if MarketPosition == -1 then{
LL = Lowest(L,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx1" Then
Sxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx2" Then
Sxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx3" Then
Sxcond3 = true;
if Sxcond1 == false and LL <= EntryPrice*0.97 and LL < EntryPrice*0.95 Then
ExitShort("Sx1",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1);
if Sxcond2 == false and LL <= EntryPrice*0.95 and LL < EntryPrice*0.93 Then
ExitShort("Sx2",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1);
if Sxcond3 == false and LL <= EntryPrice*0.90 Then
ExitShort("Sx3",AtStop,LL+(EntryPrice-LL)*0.3);
}
Else{
Sxcond1 = false;
Sxcond2 = false;
Sxcond3 = false;
}
다음글
이전글