커뮤니티
안녕하세요
2018-02-07 19:59:45
103
글번호 116421
아래식에서 당일이익 과 당일손실강제청산후 진입이안되야되는데 계속 추가진입이 나옵니다
당일 손실이나 익절후에 진입안하도록 수정 부탁합니다^^
Inputs: Length(10), Consec(2);
Input : 당일손실틱수(100),당일수익틱수(100);
var : DH(0),DL(0);
var : HH(0),LL(0),T1(0),entry(0);
var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{
Condition1 = true;
DH = H;
DL = L;
}
if Condition1 == true then{
if H > DH Then
DH = H;
if L < DL Then
DL = L;
}
If DL > 0 and C < DL+PriceScale*300 and stime > 100000 and stime < 172000 and CountIf(Close > Highest(High, Length)[1], Consec) == Consec Then
Buy ("매수");
If DH > 0 and C > DH-PriceScale*300 and stime > 100000 and stime < 172000 and CountIf(Close < Lowest(Low, Length)[1], Consec) == Consec Then
Sell ("매도");
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*60,PointStop);
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));
}
답변 1
예스스탁 예스스탁 답변
2018-02-08 11:36:25
안녕하세요
예스스탁입니다.
Inputs: Length(10), Consec(2);
Input : 당일손실틱수(100),당일수익틱수(100);
var : DH(0),DL(0);
var : HH(0),LL(0),T1(0),Xcond(false);
var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{
Condition1 = true;
Xcond = false;
DH = H;
DL = L;
T1 = NetProfit;
}
dayPL = NetProfit-T1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbp",1) or IsExitName("dbl",1) or
IsExitName("dsp",1) or IsExitName("dsl",1) ) Then
Xcond = true;
if Condition1 == true then{
if H > DH Then
DH = H;
if L < DL Then
DL = L;
}
if Xcond == false then{
If DL > 0 and C < DL+PriceScale*300 and stime > 100000 and stime < 172000 and
CountIf(Close > Highest(High, Length)[1], Consec) == Consec Then
Buy ("매수");
If DH > 0 and C > DH-PriceScale*300 and stime > 100000 and stime < 172000 and
CountIf(Close < Lowest(Low, Length)[1], Consec) == Consec Then
Sell ("매도");
}
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*60,PointStop);
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));
}
즐거운 하루되세요
> 수원 님이 쓴 글입니다.
> 제목 : 안녕하세요
> 아래식에서 당일이익 과 당일손실강제청산후 진입이안되야되는데 계속 추가진입이 나옵니다
당일 손실이나 익절후에 진입안하도록 수정 부탁합니다^^
Inputs: Length(10), Consec(2);
Input : 당일손실틱수(100),당일수익틱수(100);
var : DH(0),DL(0);
var : HH(0),LL(0),T1(0),entry(0);
var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and stime >= 100000 and stime[1] < 100000) Then{
Condition1 = true;
DH = H;
DL = L;
}
if Condition1 == true then{
if H > DH Then
DH = H;
if L < DL Then
DL = L;
}
If DL > 0 and C < DL+PriceScale*300 and stime > 100000 and stime < 172000 and CountIf(Close > Highest(High, Length)[1], Consec) == Consec Then
Buy ("매수");
If DH > 0 and C > DH-PriceScale*300 and stime > 100000 and stime < 172000 and CountIf(Close < Lowest(Low, Length)[1], Consec) == Consec Then
Sell ("매도");
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*60,PointStop);
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));
}
다음글
이전글