답변완료
안녕하세요 수식 문의 드립니다.
일전에 주신 수식 잘활요하고 있습니다. 항셍, 골드, 나스닥 한가지씩 추가 문의 드립니다.
항셍입니다. 항셍 수식입니다.
1. 매수 / 매도 신호시에 바로 진입으로 되있나요?
2. 바로 진입으로 되어있으면 바로진입이 아니라, 매수 매도 신호 발생하고,
10틱 눌림시에 매수매도 신호 발생시점에서 진입하는 것으로 변경 부탁드립니다.
기존수식 입니다.
input : StartTime(101200),EndTime(114000);
input : Length(20), D1(2),n(10);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(2);
var : Tcond(false),profit(0),loss(0),T(0),S(0),Y(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
T = 0;
Tcond = true;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp1.",1) or IsExitName("bp2.",21) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp1.",1) or IsExitName("sp2.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl1.",1) or IsExitName("bl2.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl1.",1) or IsExitName("sl2.",1) or IsExitName("sl1",1) or IsExitName("sl2",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and (c > o or (C==O and C >= C[1])) then
{
T = 1;
S = C;
Y = S;
}
If CrossDown(L,Var2) and (C < O or (C==O and C < C[1])) then
{
T = -1;
S = C;
}
if T == 1 and C < Y Then
Y = C;
if T == -1 and C > Y Then
Y = C;
If T == 1 and Y <= S-PriceScale*n and CrossUP(c,S) then
{
T = 2;
if profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl1.",AtStop,C-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2.",AtLimit,C+PriceScale*익절2,"",1,1);
ExitLong("bl2.",AtStop,C-PriceScale*손절2,"",1,1);
}
}
}
If T == -1 and Y >= S+PriceScale*n and crossdown(C,S) then
{
T = -2;
if profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl1.",AtStop,C+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2.",AtLimit,C-PriceScale*익절2,"",1,1);
ExitShort("sl2.",AtStop,C+PriceScale*손절2,"",1,1);
}
}
}
}
if MarketPosition == 1 Then
{
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*익절1,"",1,1);
ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*익절2,"",1,1);
ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2,"",1,1);
}
}
if MarketPosition == -1 Then
{
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절1,"",1,1);
ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절2,"",1,1);
ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2,"",1,1);
}
}
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
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-12-20
647
글번호 154651
시스템
답변완료
부탁드려요
input : P(3),p1(5),p2(1);
var : cnt(0),sum1(0),sum2(0),cnt1(0),sum3(0),sum4(0),T2(0),LL2(0),LL22(0),mav2(0),cnt2(0),sum5(0),sum6(0);
Array : DM[100](0),DM1[100](0),DM2[100](0);
if Bdate != Bdate[1] Then
{
DM[0] = 0;
For cnt = 1 to 99
{
DM[cnt] = DM[cnt-1][1];
}
}
DM[0] = DM[0] + M;
if DM[P-1] > 0 Then
{
sum1 = 0;
sum2 = 0;
For cnt = 0 to P-1
{
sum1 = sum1 + DM[cnt];
sum2 = sum2 + DayVolume(cnt);
}
var1 = sum1/sum2;
}
if Bdate != Bdate[1] Then
{
DM1[0] = 0;
For cnt1 = 1 to 99
{
DM1[cnt1] = DM1[cnt1-1][1];
}
}
DM1[0] = DM1[0] + M;
if DM1[P1-1] > 0 Then
{
sum3 = 0;
sum4 = 0;
For cnt1 = 0 to P1-1
{
sum3 = sum3 + DM1[cnt1];
sum4 = sum4 + DayVolume(cnt1);
}
var2 = sum3/sum4;
}
if Bdate != Bdate[1] Then
{
DM2[0] = 0;
For cnt2 = 1 to 99
{
DM2[cnt2] = DM2[cnt2-1][1];
}
}
DM2[0] = DM2[0] + M;
if DM2[P2-1] > 0 Then
{
sum5 = 0;
sum6 = 0;
For cnt2 = 0 to P2-1
{
sum5 = sum5 + DM2[cnt2];
sum6 = sum6 + DayVolume(cnt2);
}
var3 = sum5/sum6;
}
if Var2>Var2[1] and c>o Then
begin
PlotPaintBar(High, Low, "거래량 상승",lgreen);
end
else
NoPlot( 1 ) ;
이 수식으로 강조는 잘나오는데 시스템식으로 하면 안나와요
input : P(3),p1(5),p2(1);
var : cnt(0),sum1(0),sum2(0),cnt1(0),sum3(0),sum4(0),T2(0),LL2(0),LL22(0),mav2(0),cnt2(0),sum5(0),sum6(0);
Array : DM[100](0),DM1[100](0),DM2[100](0);
if Bdate != Bdate[1] Then
{
DM[0] = 0;
For cnt = 1 to 99
{
DM[cnt] = DM[cnt-1][1];
}
}
DM[0] = DM[0] + M;
if DM[P-1] > 0 Then
{
sum1 = 0;
sum2 = 0;
For cnt = 0 to P-1
{
sum1 = sum1 + DM[cnt];
sum2 = sum2 + DayVolume(cnt);
}
var1 = sum1/sum2;
}
if Bdate != Bdate[1] Then
{
DM1[0] = 0;
For cnt1 = 1 to 99
{
DM1[cnt1] = DM1[cnt1-1][1];
}
}
DM1[0] = DM1[0] + M;
if DM1[P1-1] > 0 Then
{
sum3 = 0;
sum4 = 0;
For cnt1 = 0 to P1-1
{
sum3 = sum3 + DM1[cnt1];
sum4 = sum4 + DayVolume(cnt1);
}
var2 = sum3/sum4;
}
if Bdate != Bdate[1] Then
{
DM2[0] = 0;
For cnt2 = 1 to 99
{
DM2[cnt2] = DM2[cnt2-1][1];
}
}
DM2[0] = DM2[0] + M;
if DM2[P2-1] > 0 Then
{
sum5 = 0;
sum6 = 0;
For cnt2 = 0 to P2-1
{
sum5 = sum5 + DM2[cnt2];
sum6 = sum6 + DayVolume(cnt2);
}
var3 = sum5/sum6;
if Var2>Var2[1] and c>o Then
Buy("평균값"); 여기서는 제대로 안 나옵니다
2021-12-20
546
글번호 154642
시스템
답변완료
수식변경 부탁드립니다.
아래는 지난번에 만들어 주신 당일 피보나치 수식입니다.
이수식에
1.추가로선추가(6개)
고점과 23.6%선 사이에 14.5%선추가
고점선부터 위로23.6%선추가
고점선부터 위로38.2%선추가 (첨부파일에 보이는 분홍색선)
저점과 76.4%선 사이에 85.5%선추가
저점선부터 아래로23.6%선추가
저점선부터 아래로38.2%선추가 (첨부파일에 보이는 파랑색선)
부탁드립니다.
2.표시순서 변경
첨부파일에 보면 위에서 부터 고=23.6%=38.2%=50.0%=61.8%=76.4%로 표시되는데
고=85.5%=76.4%=61.8%=50.0%=38.2%=23.6%=14.5%순으로 표시되게 수정 부탁드립니다.
감사합니다.
input : Per1(23.6),Per2(38.2),Per3(50.0),Per4(61.8),Per5(76.4);
var : HH(0),LL(0),tx1(0),tx2(0),tx3(0),tx4(0),tx5(0),tx6(0),tx7(0);
HH = dayhigh;
LL = daylow;
if HH > 0 and LL > 0 then{
var1 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per1/100));
var2 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per2/100));
var3 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per3/100));
var4 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per4/100));
var5 = 10^(LOG10(HH)-(LOG10(HH)-LOG10(LL))*(Per5/100));
plot1(HH,"최고",BLACK);
plot2(LL,"최저",BLACK);
plot3(var1,"Per1%",BLACK);
plot4(var2,"Per2%",BLACK);
plot5(var3,"Per3%",BLACK);
plot6(var4,"Per4%",BLACK);
plot7(var5,"Per5%",BLACK);
Text_Delete(tx1);
Text_Delete(tx2);
Text_Delete(tx3);
Text_Delete(tx4);
Text_Delete(tx5);
Text_Delete(tx6);
Text_Delete(tx7);
tx1 = Text_New(sdate,stime,HH," 고");
tx2 = Text_New(sdate,stime,LL," 저");
tx3 = Text_New(sdate,stime,var1,NumToStr(Per1,1)+"%");
tx4 = Text_New(sdate,stime,var2,NumToStr(Per2,1)+"%");
tx5 = Text_New(sdate,stime,var3,NumToStr(Per3,1)+"%");
tx6 = Text_New(sdate,stime,var4,NumToStr(Per4,1)+"%");
tx7 = Text_New(sdate,stime,var5,NumToStr(Per5,1)+"%");
}
2021-12-20
662
글번호 154640
지표