답변완료
문의 드립니다
수고하십니다.
If IsEntryName("ds1") == True Then {
If BarsSinceEntry > 1 and BarsSinceEntry <= 7
and CountIF(CrossDown(sigma1456v,sigma5615),BarsSinceEntry)>=1
and (var179 >= var180
or Lowest(sigma1456v,20) < Lowest(sigma1456v,8)
or CountIF(CrossDown(sigma1456v,-2),BarsSinceEntry)>=2 )
then SetStopTrailing(0.2,0.4,PointStop); }
Else {SetStopTrailing(0,0);}
이런 수식으로 청산식을 만들었습니다.
여기서 BarsSinceEntry <= 7 는 진입후 7개 캔들 이내에서만
조건 완성시 청산으로 알고 있습니다.
그런데 7개를 훨씬 지난 12번째 캔들에서 청산신호가 나왔습니다.
왜 그런것인지 궁굼합니다.
참고로 진입후 7캔들내로 제한을 둔 것은 7캔들 내에서 조건이
충족이 되지 않을 때는 추세로 보고 길게 가지고 가려는 이유에서입니다.
이런 목적에 부합하는 더 적합한 수식이 있다면 부탁드립니다.
감사합니다. 좋은 주말 보내세요
2021-11-26
715
글번호 153944
시스템
답변완료
신호수식을 검색할수잇게 부탁드림니다
A5=disparity(5);
A10=disparity(10);
A15=disparity(15);
A20=disparity(20);
A25=disparity(25);
A30=disparity(30);
A35=disparity(35);
A40=disparity(40);
A45=disparity(45);
A50=disparity(50);
A55=disparity(55);
A60=disparity(60);
A65=disparity(65);
A70=disparity(70);
A75=disparity(75);
A80=disparity(80);
A85=disparity(85);
A90=disparity(90);
A95=disparity(95);
A100=disparity(100);
MAXA=max(A5, A10, A15, A20, A25, A30, A35, A40, A45, A50, A55, A60, A65, A70, A75, A80, A85, A90, A95, A100);
MINA=min(A5, A10, A15, A20, A25, A30, A35, A40, A45, A50, A55, A60, A65, A70, A75, A80, A85, A90, A95, A100);
AA=valuewhen(1, MAXA/MINA*100 <ratio, eavg(C, 50)*MAXA/100);
if(crossup(C, AA) and V>=eavg(V, 20)*Vratio, 1, 0)
수고맣으심니다
위에신호를 검색할수잇게 변환좀부탁드림니다
감사함니다
2021-11-26
951
글번호 153942
종목검색
답변완료
문의드립니다.
수고많으십니다.
아래 수식은 검증은 이상없다고 하는데, 데모 데이타가 전혀 안나옵니다.
어떤 문제가 있는 건가요?
input : n1(5), n(10);
input : StartTime(210000),EndTime(053000);
input : 익절틱수(80),손절틱수(0),거래횟수(10);
input : mm(50),m1(10);
var : Tcond(false), T(0), entry(0);
Array : H1[50](0),L1[50](0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
T = 0;
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if H > Highest(H,n1)[1] and C > O and entry < 거래횟수 Then
Buy("b");
if L < Lowest(L,N1)[1] and C < O and entry < 거래횟수 Then
Sell("s");
if MarketPosition == 1 Then
ExitLong("bx",AtStop,Lowest(L,n)[BarsSinceEntry]-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,Highest(H,n)[BarsSinceEntry]+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
{
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*mm Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*m1);
}
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*mm Then
ExitShort("str",AtStop,EntryPrice-PriceScale*m1);
}
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-11-25
1037
글번호 153941
시스템
답변완료
문의 드립니다.~~~~
감사하게 많이 배우고 있습니다~~
아래식을 실행해보면
ntime(100000)으로 정해진 10시 시간내에서만
진입과 청산이 이루어 집니다.
진입조건이 성립된다면 해외선물 거래 시간인
8시에서 다음날 6시까지 연속해서 거래가
되었으면 합니다.
어떻게 시간 설정을 해야 하나요?
input : ntime(100000),nn(10),mm(20),aa(10),bb(20);
input : 익절틱수(10),손절틱수(10);
var : OO(0),HH(0),LL(0),HL(0),LH(0);
if (sdate != sdate[1] and stime >= ntime) or
(sdate == sdate[1] and stime >= ntime and stime[1] < ntime) Then
{
OO = O;
HH = H;
HL = HH;
LL = L;
LH = LL;
Condition1 = False;
Condition1 = False;
}
Else
{
#거래횟수 증가(청산이 되서서 거래완료)
if TotalTrades > TotalTrades[1] Then
{
OO = O;
HH = H;
HL = HH;
LL = L;
LH = LL;
Condition1 = False;
Condition1 = False;
}
if HH > 0 and LL > 0 Then
{
if H > HH Then
{
HH = H;
HL = HH;
}
Else
{
if L < HL Then
HL = L;
}
if L < LL Then
{
LL = L;
LH = LL;
}
Else
{
if H > LH Then
LH = H;
}
if HL < HH-PriceScale*nn Then
Condition1 = true;
if LH > LL+PriceScale*aa Then
Condition2 = true;
if Condition1 == False and HH < LL+PriceScale*mm Then
Sell("s",AtLimit,LL+PriceScale*mm);
if Condition2 == False and LL < HH-PriceScale*bb Then
Buy("b",AtLimit,HH-PriceScale*bb);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2021-11-25
898
글번호 153940
시스템
답변완료
문의 드립니다.
친절한 도움에 감사드립니다.
수식에 IF Endtime > starttime Then
이 부분에 에러가 난다고 합니다.
다른 부분도 혹시 잘못된 부분 있으면 수정 부탁드립니다.
감사합니다.
input : n1(n),n(n);
input : StartTime(231000),EndTime(053000);
input : 익절틱수1(80),익절틱수2(100),손절틱수(50), 익절횟수(1);
input : mm(50),m1(10);
var : Tcond(false), T(0), Profit(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
T = 0;
Tcond = true;
Profit = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if TotalTrades > TotalTrades[1] and IsExitName("StopProfitTarget",1) == true Then
Profit = profit+1;
if Tcond == true Then
{
if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) and Profit < 익절횟수 Then
Buy("b1",AtStop,Highest(H,n1)+PriceScale*1);
if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) and Profit < 익절횟수 Then
Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1);
}
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
{
ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*익절틱수1,"",max(1,Floor(MaxContracts/2)),1);
ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*익절틱수2);
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*mm Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*m1);
}
if MarketPosition == -1 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절틱수1,"",max(1,Floor(MaxContracts/2)),1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절틱수2);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*mm Then
ExitShort("str",AtStop,EntryPrice-PriceScale*m1);
}
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-11-25
1249
글번호 153933
시스템