답변완료
시가 혹은 종가 돌파 검색식 부탁 드립니다. (조금 길어서 죄송합니다)
a=valuewhen(1,date!=date(1),dayclose());
b=valuewhen(1,date!=date(1),dayopen());
가=valuewhen(1,date!=date(1)&&a<b,dayhigh());
나=valuewhen(2,date!=date(1)&&a<b,dayhigh());
다=valuewhen(3,date!=date(1)&&a<b,dayhigh());
확3고=max(가,나,다);
갑=valuewhen(1,crossup(C,확3고),H);
을=valuewhen(1,crossup(C,확3고),L);
가1=valuewhen(1,date!=date(1)&&a>b,daylow());
나1=valuewhen(2,date!=date(1)&&a>b,daylow());
다1=valuewhen(3,date!=date(1)&&a>b,daylow());
확3저=min(가1,나1,다1);
갑1=valuewhen(1,crossup(C,확3저),H);
을1=valuewhen(1,crossup(C,확3저),L);
aa=valuewhen(1,(갑-을)/갑<=0.04,갑+(갑-을));
bb=valuewhen(1,(갑1-을1)/갑1<=0.04,갑1+(갑1-을1));
cc=(aa+bb)/2;
min(aa,bb)
2024-07-23
762
글번호 181769
종목검색
답변완료
88230번 관련
88230번의 2번 관련입니다.
================================================================
RSI(20)>64가 되는 봉이
RSI가 64를 상향돌파한 봉을 의미하시면
condition1의 조건을 crossup(R,64)로 변경하시면 됩니다.
input : P(20);
var : A1(0),A2(0),A3(0),A4(0),R(0);
A1=MACD(12,26);
A2=Ema(A1,9);
if CrossUp(A1,0) Then
A3 = C;
if CrossUp(A1,A2) Then
A4=C;
R = RSI(P);
#최근 70봉안에 종가가 A3,A4를 동시돌파한 봉이 있고 현재봉 RSI > 64이면
#Condition1은 true, 아니면 false
Condition1 = CountIf(crossup(C,A3) && Crossup(C,A4),70) >= 1 and R > 64 ; #CrossUp(R,64)
#1봉전에 Condition1이 true인 종목 검색
if Condition1[1] == true Then
Find(1);
=====================================================================
위 내용으로 검색해보니 RSI(20)>64 에서 발생한 봉도 나오는데
이를 제외하고 RSI가 <63.9이하에서 발생하는 봉만
잡아내려 합니다.
방법 수정이 가능할까요?
2024-07-23
533
글번호 181767
종목검색
답변완료
수식작성 부탁드립니다.
저번처럼 이번에도 매수조건 만족 시 바로 진입하지 않고 실제 진입을 -20틱 밀릴때까지 기다렸다가 아래에서 보수적으로 진입하고, 매도조건 만족 시 바로 진입하지 않고 실제 진입을 +20틱 밀릴때까지 기다렸다가 위에서 매도진입 되도록 하여 주시면 감사하겠습니다.
input : TradingTime(1),StartTime(160000),EndTime(045000);
input : ProfitTickCount1(20),ProfitTickCount2(40),ProfitTickCount3(60),LossTickCount(20);
input : P1(7),P2(14),P3(21);
input : ADXP(14),value(20);
input : af(0.02),maxaf(0.2);
input : Period(50);
input : CumulativeLossTicks(100);
var : R1(0),R2(0),R3(0),AA(0),MM(0),MS(0),SS(0),EE(0), HH(0), LL(0);
var : Xcond(false),N1(0),daypl(0),CumulativeLoss(0);
var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0);
R1 = RSI(P1);
R2 = RSI(P2);
R3 = RSI(P3);
AA = ADX(ADXP);
SS = sar(af,maxaf);
EE = Ema(C,Period);
전환선 = (highest(H,9)+lowest(L,9))/2;
기준선 = (highest(H,26)+lowest(L,26))/2;
선행스팬1 = (전환선[25]+기준선[25])/2;
선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2;
if TradingTime == 1 then
condition3 = (stime>=StartTime or stime<=EndTime );
Else if TradingTime == 2 then
condition3 = (stime>=StartTime and stime<=EndTime );
Else
condition3 = true;
if TradingTime == 1 or TradingTime == 2 then
{
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Xcond = false;
N1 = NetProfit;
}
}
else
{
if Bdate != Bdate[1] Then
{
Xcond = false;
N1 = NetProfit;
}
}
CumulativeLoss = PriceScale*CumulativeLossTicks;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
If MarketPosition <= 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
R1 > R2 and R2 > R3 and R3 >= 50 and
AA > value and AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세
선행스팬1 > 선행스팬2 and #양운
C > SS and C > EE Then
Buy("b",OnClose,Def,3);
If MarketPosition >= 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
R1 < R2 and R2 < R3 and R3 <= 50 and
AA > value and AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세
선행스팬1 < 선행스팬2 and #음운
C < SS and C < EE Then
Sell("s",OnClose,Def,3);
if MarketPosition == 1 Then
{
ExitLong("bp1",atlimit,EntryPrice+PriceScale*ProfitTickCount1,"",1,1);
ExitLong("bp2",atlimit,EntryPrice+PriceScale*ProfitTickCount2,"",1,1);
ExitLong("bp3",atlimit,EntryPrice+PriceScale*ProfitTickCount3);
ExitLong("bl",AtStop,avgEntryPrice-PriceScale*LossTickCount);
}
if MarketPosition == -1 Then
{
ExitShort("sp1",atlimit,EntryPrice-PriceScale*ProfitTickCount1,"",1,1);
ExitShort("sp2",atlimit,EntryPrice-PriceScale*ProfitTickCount2,"",1,1);
ExitShort("sp3",atlimit,EntryPrice-PriceScale*ProfitTickCount3);
ExitShort("sl",AtStop,avgEntryPrice+PriceScale*LossTickCount);
}
2024-07-22
635
글번호 181762
시스템