답변완료
문의 드립니다
1.
input : StartTime(170000),EndTime(50000);
input : 익절틱수(0),손절틱수(30);
var : Tcond(False),entry(0);
Variables: Mom(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if Tcond == true Then
{
if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 8 Then
ExitShort();
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2.
input : StartTime(170000),EndTime(50000);
input : 익절틱수(0),손절틱수(30);
var : Tcond(False),entry(0);
Variables: Mom(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if Tcond == true Then
if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 8 Then
ExitLong();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
3.
input : StartTime(210000),EndTime(60000);
input : 익절틱수(0),손절틱수(40);
var : Tcond(False),entry(0);
Variables: Mom(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if Tcond == true Then
{
if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 8 Then
ExitShort();
}
if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 8 Then
ExitLong();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
1번 수식어 120선 위 매수신호만 진입
2번 수식어 120선 아래 매도신호만 진입
3번 수식어 1,2번의 합성으로
수정된 수식어 부탁 합니다.
미리 감사드립니다.
2023-10-03
641
글번호 172802
시스템
답변완료
문의드립니다.
var : factor(3), AtrPeriod(6);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), superTrend(C), direction(0),alpha(0),source(0);
if CurrentBar > 1 Then {
src = (H+L)/2;
alpha = 1 / AtrPeriod ;
source = max(high - low, abs(high - close[1]), abs(low - close[1]));
ATrV = alpha * source + (1 - alpha) * ATrV[1];
upperBand = src + factor * AtrV;
lowerBand = src - factor * AtrV;
prevLowerBand = lowerBand[1];
prevUpperBand = upperBand[1];
if lowerBand > prevLowerBand or close[1] < prevLowerBand Then
lowerBand = lowerBand;
Else
lowerBand = prevLowerBand;
if upperBand < prevUpperBand or close[1] > prevUpperBand Then
upperBand = upperBand;
Else
upperBand = prevUpperBand;
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
supertrend = lowerband;
Else
supertrend = upperband;
}
var : factor(5), AtrPeriod(10);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), superTrend(C), direction(0),alpha(0),source(0);
if CurrentBar > 1 Then {
src = (H+L)/2;
alpha = 1 / AtrPeriod ;
source = max(high - low, abs(high - close[1]), abs(low - close[1]));
ATrV = alpha * source + (1 - alpha) * ATrV[1];
upperBand = src + factor * AtrV;
lowerBand = src - factor * AtrV;
prevLowerBand = lowerBand[1];
prevUpperBand = upperBand[1];
if lowerBand > prevLowerBand or close[1] < prevLowerBand Then
lowerBand = lowerBand;
Else
lowerBand = prevLowerBand;
if upperBand < prevUpperBand or close[1] > prevUpperBand Then
upperBand = upperBand;
Else
upperBand = prevUpperBand;
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
supertrend = lowerband;
Else
supertrend = upperband;
}
2개 지표식은 맨위 변수만 다릅니다. 2개 지표식이 동시에 일치할 때만 매수, 매도가 나오는 시스템 매매식을 만들고 싶습니다.
미리 노고에 감사드립니다~
2023-09-27
916
글번호 172798
시스템
답변완료
부탁드립니다
키움서식으로는 요렇습니다.
A=ADX(11);
B=sum(v*((Pow((C-L),2) - Pow((H-C),2))/(H-L)));
BB=BBandsup(10,2);
En=Envelopeup(10,2);
S=(highest(high,26)+Lowest(low,26))/2;
대금=V*(H+O+L+C)/4;
X=sum(v);
Y=Valuewhen(1,date(1)!=date,X(1));
Z=X-Y;
전거래량=valuewhen(1,date(1)!=date,Z(1));
Highest(H,3,1)<=C and ma(c,5)>ma(c,20) and ma(c,20)>ma(c,60) and
BB>En and
C>BB and
C>En and
A>A(1) and
C>S and
B>=B(1) and
V>V(1)*P and
(대금>2000000000 or
sum(V)>전거래량)
지표변수
P ==> 1.5
종목검색 수식으로 부탁드립니다
2023-09-27
1300
글번호 172797
검색
답변완료
지표 수식 검토부탁드립니다..^^
어제 올려 주신 수식이 차트 적용시 아무런 인식을 못하네요...
다시 검토좀 부탁드립니다.
input : 진입시간(120000);
input : 수량1(1),pst1(-1);#1이면 매수진입, -1이면 매도진입
input : 수량2(1),pst2(1);#1이면 매수진입, -1이면 매도진입
input : 배수(1);
var : PL1(0,Data1),PL2(0,Data1),diff(0,data1),ii(-1,Data1);
var : sumDiff(0,Data1),sum3(0,Data1),mapl(0,Data1);
var : cnt(0,data1),SumSqrt(0,Data1),stdv(0,Data1),upv(0,Data1),dnv(0,data1);
#진입시점
if sDate == 20220921 and Data1((sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간)) Then
{
sumDiff = 0;
ii = 0;
}
Else
{
if ii >= 0 Then
{
#진입이후 봉갯수
ii = ii +1;
#종목1 손익
if pst1 == 1 Then
PL1 = Data1(C-C[1])*BigPointValue;
if pst1 == 2 Then
PL1 = Data1(C[1]-C)*BigPointValue;
#종목2 손익
if pst2 == 1 Then
PL2 = Data2(C-C[1])*BigPointValue;
if pst2 == -1 Then
PL2 = Data2(C[1]-C)*BigPointValue;
//손익차
diff = PL2-PL1;
//손익차 누적
sumDiff = sumDiff+diff;
//평균
maPL = sumDiff/ii;
//표준편차 계산
SumSqrt = 0;
For cnt = 0 To ii - 1
{
SumSqrt = SumSqrt + (sumDiff[cnt] - maPL)^2;
}
Stdv = SquareRoot(SumSqrt / ii);
//상단 = 누적합산손익+표준편차*배수
upv = maPL + stdv*배수;
//하단 = 누적합산손익-표준편차*배수
dnv = maPL - stdv*배수;
Plot1(sumdiff,"누적손익");
Plot2(maPL,"평균");
Plot3(upv,"+표준편차");
Plot4(dnv,"-표준편차");
}
}
2023-09-27
1385
글번호 172796
지표