예스스탁
예스스탁 답변
2024-06-10 14:48:56
안녕하세요
예스스탁입니다.
input : StartTime(70000),EndTime(55000);
Input : 당일수익틱수(400),당일손실틱수(200);
input : Period(14);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0);
var : Tcond(false),Xcond(false);
var : ADXv(0),DP(0),DM(0);
ADXv = ADX(Period);
DP = DiPlus(Period);
DM = DiMinus(Period);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
Tcond = true;
Xcond = False;
}
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
if Bdate != Bdate[1] Then
{
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 or daypl <= -당일손실 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
}
if Xcond == false and Tcond == true then
{
if CrossUp(DP,DM) and ADXV >= 20 Then
Buy();
if CrossDown(DP,DM) and ADXV <= 20 Then
Sell();
}
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 수식어 문의 입니다.
수식어 내용 :
해외선물 매매시간 07:00~익일 06:00
장중 익절 400틱 손절200틱 매매정지
매수 : DMI+ DMI- 상향 돌파하고 ADX 20 이상
매도 : DMI- DMI+ 하향 돌파하고 ADX 20 이하
미리 감사드립니다.