예스스탁
예스스탁 답변
2022-05-09 16:45:06
안녕하세요
예스스탁입니다.
올리신 수식에 첫진입이 없습니다.
첫진입식에도 Xcond == false조건이 추가되어야 합니다.
var: t(0);
input : period(20),period2(20),매수간격(100),매도간격(100) ;
input: 이익변수(560),손절변수(420);
Input : 당일손실틱수(100);
var : HH(0),LL(0);
Var : N1(0),dayPl(0),당일손실(0),Xcond(false);
당일손실 = PriceScale*당일손실틱수;
if Bdate != Bdate[1] Then
{
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl <= -당일손실 Then
Xcond = true;
if (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
}
#중략~~~~~~~~~
if MarketPosition == 1 Then
{
if Xcond == False Then
buy("bb",AtStop,LatestEntryPrice(0)+PriceScale*매수간격);
if MaxEntries == 1 Then
ExitLong("매수1손절",AtStop,EntryPrice-PriceScale*손절변수);
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if MaxEntries >= 2 Then
ExitLong("bx",AtStop,HH-abs(HH-AvgEntryPrice)*0.2);
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 Then
{
if Xcond == False Then
Sell("ss",AtStop,LatestEntryPrice(0)-PriceScale*매도간격);
if MaxEntries == 1 Then
ExitShort("매도1손절",AtStop,EntryPrice+PriceScale*손절변수 );
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = H;
if MaxEntries >= 2 Then
ExitShort("sx",AtStop,LL+abs(LL-AvgEntryPrice)*0.2);
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 언제나 감사드립니다.
아래 수식에서 해외선물이므로 동일 영업일날에 순손실이
임의의 일정 금액(달러) 또는 일정 틱수가 되면 그 영업일에는 진입을 금지하고
싶습니다.
수식을 부탁드립니다.
var: t(0);
input : period(20),period2(20),매수간격(100),매도간격(100) ;
input: 이익변수(560),손절변수(420);
var : HH(0),LL(0);
중략~~~~~~~~~
if MarketPosition == 1 Then
{
buy("bb",AtStop,LatestEntryPrice(0)+PriceScale*매수간격);
if MaxEntries == 1 Then
ExitLong("매수1손절",AtStop,EntryPrice-PriceScale*손절변수);
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if MaxEntries >= 2 Then
ExitLong("bx",AtStop,HH-abs(HH-AvgEntryPrice)*0.2);
}
if MarketPosition == -1 Then
{
Sell("ss",AtStop,LatestEntryPrice(0)-PriceScale*매도간격);
if MaxEntries == 1 Then
ExitShort("매도1손절",AtStop,EntryPrice+PriceScale*손절변수 );
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = H;
if MaxEntries >= 2 and Then
ExitShort("sx",AtStop,LL+abs(LL-AvgEntryPrice)*0.2);
}