예스스탁
예스스탁 답변
2024-07-22 16:50:35
안녕하세요
예스스탁입니다.
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),T(0),B(0),S(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] Then
{
if T <= 0 and
Condition3 == true and
R1 > R2 and R2 > R3 and R3 >= 50 and
AA > value and
C > SS and C > EE Then
{
T = 1;
B = C-PriceScale*20;
TL_New(sDate,sTime,0,sDate,sTime,999999999);
}
if T == 1 and B > 0 Then
Buy("b",AtLimit,B,3);
}
If MarketPosition >= 0 and TotalTrades == TotalTrades[1] Then
{
if T >= 0 and
Condition3 == true and
R1 < R2 and R2 < R3 and R3 <= 50 and
AA < value and
C < SS and C < EE Then
{
T = -1;
S = c+PriceScale*20;
TL_New(sDate,sTime,0,sDate,sTime,999999999);
}
if T == -1 and S > 0 Then
Sell("s",AtLimit,S,3);
}
if MarketPosition == 1 Then
{
T = 0;
B = 0;
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
{
T = 0;
S = 0;
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);
}
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 수식작성 부탁드립니다.
> 안녕하세요..
이번에 부탁드릴 사항은 매수조건 만족 시 바로 진입하지 않고 실제 진입을 -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);
}