답변완료
종목검색식부탁드림니다.
노고에 항상 감사드림니다.
A=DISPARITY(기간);
B=VALUEWHEN(1,CROSSUP(A,99) OR CROSSDOWN(A,99),가격);
C=VALUEWHEN(1,CROSSUP(A,101) OR CROSSDOWN(A,101),가격);
D=MA(C,20);
(CROSSUP(D,B) OR CROSSUP(D,C))
AND D>D(1)
지표변수: 기간20
가격(고가+저가)/2
2024-07-22
704
글번호 181731
종목검색
답변완료
수식작성 부탁드립니다.
안녕하세요..
이번에 부탁드릴 사항은 매수조건 만족 시 바로 진입하지 않고 실제 진입을 -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);
R1 = RSI(P1);
R2 = RSI(P2);
R3 = RSI(P3);
AA = ADX(ADXP);
SS = sar(af,maxaf);
EE = Ema(C,Period);
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
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
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
629
글번호 181721
시스템