답변완료
수직선이 나타나지를 않습니다. 수정 좀 부탁드립니다.
//============밴드폭지표=====================//
Inputs: Period(18), D(2), 밴드폭이평선(50),변동성최저(0.6);
Variables: BBTop(0,data2), BBMid(0,data2), BBBot(0,data2),BBwidth(0,data2),T(o),TL1(0),비중(0);
BBTop = data2(BollBandUp(Period,D));
BBMid = data2(ma(C,Period));
BBBot = data2(BollBandDown(Period,D));
BBWidth = ((BBTop - BBBot)/ BBMid)*100;
Var1 = data2(ma(BBwidth,밴드폭이평선));
//Var2 = Data2(ma(BBWidth,5));
Var3 = Var1[0] - Var1[1]; // 오늘의 기울기
Var4 = Var1[1] - Var1[2]; // 어제의 기울기
If BBWidth < 변동성최저 and BBWidth[0] < BBWidth[1] Then {
T = -1;
}
If BBWidth < 변동성최저 and BBWidth[0] > BBWidth[1] Then {
T = 1;
}
If CrossUp(BBWidth, 변동성최저) Then {
T = 2;
}
//============ADX지표=================//
input :Length(14);
var : ADXv(0,Data2),DP(0,Data2),DM(0,Data2);
ADXv = Data2(ADX(Length));
DP = Data2(DiPlus(Length));
DM = Data2(DiMinus(Period));
//====================================//
Input : RSIP(14), Period1(40),dv(2.5);
var : RSIV(0,Data2),Mid(0,Data2),BBup(0,Data2),BBdn(0,Data2),RSIVBB(0,Data2),Sigma(0,Data2),S(0);
RSIV = Data2(RSI(RSIP));
Mid = Data2(ma(RSIV,Period1));
BBup = Mid+STD(RSIV,Period1)*dv;
BBdn = Mid-STD(RSIV,Period1)*dv;
RSIVBB = (RSIv - BBdn)/(BBup - BBdn);
If (T == 1 or T==2 ) and ADXv[0] < ADXv[1] Then { //밴드폭이 확장 & ADX 하락
S = 1;
}
If (T == 1 or T==2) and ADXv[0] > ADXv[1] Then { ////밴드폭이 확장 & ADX 상승
S = -1;
}
If S == 1 and CrossDown(RSIV,0.7) Then //밴드폭확장 & ADX하락 & RDI 고점 이탈
Plot1(999999,"눌림매도진입",Blue);
If S == 1 and CrossUp(RSIV,0.3) Then //밴드폭확장 & ADX하락 & RDI 저점 돌파
Plot2(999999,"눌림매수진입",Red);
2023-08-06
806
글번호 171253
지표
답변완료
추가 매수가 되지 않아요 수식 검토 부탁드리겠습니다.
아래수식으로 구현했는데 최초 1차 매수는 되는데.. 하락시 추가적인 매수가 진행되지 않습니다.
피라미딩도 모든 진입신호 허용 으로 했는데도 안되네요...
한번 체크 부탁드릴께요~~
적용조건은 다음과 같습니다.
예스트레이드(예스스탁)
삼성전자 60분봉
매수조건
600이평 아래시 최초 매수 10주
최초 매수금액에서 -5%하락시 20주 매수
최초 매수금액에서 -10%하락시 30주 매수
최초 매수금액에서 -15%하락시 40주 매수
최초 매수금액에서 -20%하락시 50주 매수
최초 매수금액에서 -25%하락시 60주 매수
그리고 평균매수가의 1% 수익시마다 분할매도되는 수식입니다.
input : p(600);
var : XV(0),Vol(0),cond(False);
var1 = ma(C,P);
if MarketPosition == 0 and CrossDown(C,var1) Then
{
Buy("b1",OnClose,Def,10);
Buy("b2.",AtLimit,C*0.95,20);
Buy("b3.",AtLimit,C*0.9,30);
Buy("b4.",AtLimit,C*0.85,40);
Buy("b5.",AtLimit,C*0.8,50);
Buy("b6.",AtLimit,C*0.75,60);
}
if MarketPosition == 1 Then
{
if lowest(L,BarsSinceEntry) > EntryPrice*0.95 Then
Buy("b2",AtLimit,C*0.95,20);
if lowest(L,BarsSinceEntry) > EntryPrice*0.9 Then
Buy("b3",AtLimit,C*0.9,30);
if lowest(L,BarsSinceEntry) > EntryPrice*0.85 Then
Buy("b4",AtLimit,C*0.85,40);
if lowest(L,BarsSinceEntry) > EntryPrice*0.8 Then
Buy("b5",AtLimit,C*0.8,50);
if lowest(L,BarsSinceEntry) > EntryPrice*0.75 Then
Buy("b6",AtLimit,C*0.75,60);
if CurrentContracts > CurrentContracts[1] Then
{
XV = CurrentContracts;
cond = False;
}
if C >= AvgEntryPrice*(1+1.01) and sTime == 110000 Then
{
if XV >= 100 Then
vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도
else if XV < 100 and XV >= 50 Then
vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도
else if XV < 50 and XV >= 20 Then
vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도
else if XV < 20 and XV >= 10 Then
vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도
Else
vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도
ExitLong("bx",OnClose,Def,"",vol,2);
}
}
Else
cond = False;
----------------------------------------------------------------------------
500이평선 하락시 하락퍼센트마다 진입 버전 2023.09.01
# 하락시 분할매수 전략 // 분할매도
input : 시작일(20230901);
input : p(500);
input : 수익퍼센트(10);
var : XV(0),Vol(0),cond(False);
var1 = ma(C,P);
if Data1(sDate) >= 시작일 Then
{
if MarketPosition == 0 and CrossDown(C,var1) Then
{
Buy("b1",OnClose,Def,10);
Buy("b2.",AtLimit,C*0.95,20);
Buy("b3.",AtLimit,C*0.9,30);
Buy("b4.",AtLimit,C*0.85,40);
Buy("b5.",AtLimit,C*0.8,50);
Buy("b6.",AtLimit,C*0.75,60);
}
if MarketPosition == 1 Then
{
if lowest(L,BarsSinceEntry) > EntryPrice*0.97 Then
Buy("b2",AtLimit,EntryPrice*0.97,15);
if lowest(L,BarsSinceEntry) > EntryPrice*0.94 Then
Buy("b3",AtLimit,EntryPrice*0.94,20);
if lowest(L,BarsSinceEntry) > EntryPrice*0.91 Then
Buy("b4",AtLimit,EntryPrice*0.91,25);
if lowest(L,BarsSinceEntry) > EntryPrice*0.88 Then
Buy("b5",AtLimit,EntryPrice*0.88,30);
if lowest(L,BarsSinceEntry) > EntryPrice*0.85 Then
Buy("b6",AtLimit,EntryPrice*0.85,35);
if lowest(L,BarsSinceEntry) > EntryPrice*0.82 Then
Buy("b7",AtLimit,EntryPrice*0.82,40);
if lowest(L,BarsSinceEntry) > EntryPrice*0.79 Then
Buy("b8",AtLimit,EntryPrice*0.79,45);
if lowest(L,BarsSinceEntry) > EntryPrice*0.76 Then
Buy("b9",AtLimit,EntryPrice*0.76,50);
if lowest(L,BarsSinceEntry) > EntryPrice*0.73 Then
Buy("b10",AtLimit,EntryPrice*0.73,55);
if lowest(L,BarsSinceEntry) > EntryPrice*0.7 Then
Buy("b11",AtLimit,EntryPrice*0.7,60);
if lowest(L,BarsSinceEntry) > EntryPrice*0.67 Then
Buy("b12",AtLimit,EntryPrice*0.67,65);
if lowest(L,BarsSinceEntry) > EntryPrice*0.64 Then
Buy("b13",AtLimit,EntryPrice*0.64,70);
if lowest(L,BarsSinceEntry) > EntryPrice*0.61 Then
Buy("b14",AtLimit,EntryPrice*0.61,75);
if lowest(L,BarsSinceEntry) > EntryPrice*0.58 Then
Buy("b15",AtLimit,EntryPrice*0.58,80);
if lowest(L,BarsSinceEntry) > EntryPrice*0.55 Then
Buy("b16",AtLimit,EntryPrice*0.55,85);
if lowest(L,BarsSinceEntry) > EntryPrice*0.50 Then
Buy("b17",AtLimit,EntryPrice*0.50,90);
if lowest(L,BarsSinceEntry) > EntryPrice*0.45 Then
Buy("b18",AtLimit,EntryPrice*0.45,100);
if lowest(L,BarsSinceEntry) > EntryPrice*0.4 Then
Buy("b19",AtLimit,EntryPrice*0.4,110);
if lowest(L,BarsSinceEntry) > EntryPrice*0.35 Then
Buy("b20",AtLimit,EntryPrice*0.35,120);
if lowest(L,BarsSinceEntry) > EntryPrice*0.3 Then
Buy("b21",AtLimit,EntryPrice*0.3,130);
if lowest(L,BarsSinceEntry) > EntryPrice*0.25 Then
Buy("b22",AtLimit,EntryPrice*0.25,140);
if lowest(L,BarsSinceEntry) > EntryPrice*0.2 Then
Buy("b23",AtLimit,EntryPrice*0.2,150);
if lowest(L,BarsSinceEntry) > EntryPrice*0.15 Then
Buy("b24",AtLimit,EntryPrice*0.15,160);
if lowest(L,BarsSinceEntry) > EntryPrice*0.1 Then
Buy("b25",AtLimit,EntryPrice*0.1,170);
if lowest(L,BarsSinceEntry) > EntryPrice*0.05 Then
Buy("b26",AtLimit,EntryPrice*0.05,180);
if CurrentContracts > CurrentContracts[1] Then
{
XV = CurrentContracts;
cond = False;
}
}
if C >= AvgEntryPrice*(1+수익퍼센트*0.01) and sTime == 110000 Then
{
if XV >= 100 Then
vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도
else if XV < 100 and XV >= 50 Then
vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도
else if XV < 50 and XV >= 20 Then
vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도
else if XV < 20 and XV >= 10 Then
vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도
Else
vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도
ExitLong("bx",OnClose,Def,"",vol,2);
}
}
Else
cond = False;
2023-09-24
870
글번호 171247
시스템