예스스탁
예스스탁 답변
2022-05-23 14:45:13
안녕하세요
예스스탁입니다.
Input: DN(4),TS(10),AT(15),MUL(2);
var : cnt(0),이익횟수(0);
var : cond1(False),cond2(False);
value1 = ma(C, 5);
value2 = ma(C, 20);
if bdate != bdate[1] Then
{
이익횟수 = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if PositionProfit(cnt) > 0 Then
이익횟수 = 이익횟수+1;
}
#당일 이익횟수는 3회이상이고 앞에 10봉내에서 3회이상 이익발생
cond2 = 이익횟수 >= 3 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) >= 0,10) >= 3;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
if CrossUP(value1, value2) and cond1 == true Then
Buy("b1");
if cond2 == true Then
Buy("b2");
}
if MarketPosition == 1 Then
{
if IsEntryName("b1") Then
SetStopTrailing(dn,ts,PercentStop);
Else
SetStopTrailing(0,0);#해제
if IsEntryName("b2") Then
{
exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul);
}
}
Else
{
SetStopTrailing(0,0);#해제
}
즐거운 하루되세요
> 피카2 님이 쓴 글입니다.
> 제목 : 청산조건 2가지로 운용 문의
> 언제나 감사드립니다.
진입조건에 따라 청산식을 다르게 적용하는 수식좀 부탁드립니다
1.cond1(일반진입)충족시 매수, 매수청산은 SetStopTrailing(dn,ts,PercentStop) 적용
2.cond2:(강한진입: 앞에 10봉내에서 3회이상 수익거래 발생한 후 진입할 때는 추적청산(atr) 적용
/////////////////////
Input: DN(4),TS(10),이익횟수(3),AT(15),MUL(2);
var : cnt(0),이익횟수(0);
var : cond1(),cond2();//??
value1 = ma(C, 5);
value2 = ma(C, 20);
# 매수
If CrossUP(value1, value2) Then // 일반진입
{
Buy("b1");
}
If cond2 Then
{
Buy("b2");
}
cond2= ? // 강한진입(앞에 10봉내에서 3회이상 이익발생후 진입)
##여기서 성능보고 거래내역을 보면 SetStopTrailing 신호발생 청산후, 같은시간 같은가격으로 신규진입이 동시신호 발생할 때가 있는 데,이것 제어하는 방법도 좀 부탁드립니다.
settrailing 하는 순간에도 매수조건 충족이라 발생하는 것 같은 데요,이것 제어방법도
하나 부탁드립니다.지진입가!= 진입가[1]//진입시간!= ???
if bdate != bdate[1] Then{
이익횟수 = 0;
}
For cnt = 1 to 10
{
if positiionprofit(cnt) > 0 Then
이익횟수 = 이익횟수+1;
}
#???
if IsEntryName("b1") Then{
SetStopTrailing(dn,ts,PercentStop);
}
if IsEntryName("b2") Then{
exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul);
}
작성해주신 식을 선물3분 봉에 적용했는데 b1,b2 모두 신호가 발생하지 않아서요
청산(5,0.3,PercentStop)으로 했습니다. 혹시,작성 본문에서 cond1 에 대한 정의가 없어서
인지요.답변 좀 부탁드립니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 청산조건 2가지로 운용 문의
>
안녕하세요
예스스탁입니다.
Input: DN(5),TS(0.3),AT(15),MUL(2);
var : cnt(0),이익횟수(0);
var : cond1(False),cond2(False);
value1 = ma(C, 5);
value2 = ma(C, 20);
if bdate != bdate[1] Then
{
이익횟수 = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if PositionProfit(cnt) > 0 Then
이익횟수 = 이익횟수+1;
}
#당일 이익횟수는 3회이상이고 앞에 10봉내에서 3회이상 이익발생
cond2 = 이익횟수 >= 3 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) >= 0,10) >= 3;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
if CrossUP(value1, value2) and cond1 == true Then
Buy("b1");
if cond2 == true Then
Buy("b2");
}
if MarketPosition == 1 Then
{
if IsEntryName("b1") Then
SetStopTrailing(dn,ts,PercentStop);
Else
SetStopTrailing(0,0);#해제
if IsEntryName("b2") Then
{
exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul);
}
}
Else
{
SetStopTrailing(0,0);#해제
}
즐거운 하루되세요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 청산조건 2가지로 운용 문의
>
안녕하세요
예스스탁입니다.
Input: DN(4),TS(10),AT(15),MUL(2);
var : cnt(0),이익횟수(0);
var : cond1(False),cond2(False);
value1 = ma(C, 5);
value2 = ma(C, 20);
if bdate != bdate[1] Then
{
이익횟수 = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if PositionProfit(cnt) > 0 Then
이익횟수 = 이익횟수+1;
}
#당일 이익횟수는 3회이상이고 앞에 10봉내에서 3회이상 이익발생
cond2 = 이익횟수 >= 3 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) >= 0,10) >= 3;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
if CrossUP(value1, value2) and cond1 == true Then
Buy("b1");
if cond2 == true Then
Buy("b2");
}
if MarketPosition == 1 Then
{
if IsEntryName("b1") Then
SetStopTrailing(dn,ts,PercentStop);
Else
SetStopTrailing(0,0);#해제
if IsEntryName("b2") Then
{
exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul);
}
}
Else
{
SetStopTrailing(0,0);#해제
}
SetStopLoss(0.1,PercentStop);
즐거운 하루되세요
예스스탁
예스스탁 답변
2022-05-24 13:18:39
안녕하세요
예스스탁입니다.
b1진입에 cond1에 대한 내용을 추가하셔야 합니다.
이전 문의에 별도로 지정하는 내용이 있으신거 같아서
조건에 cond1 == true이라고 추가해 놓은 상태입니다.
즐거운 하루되세요
> 피카2 님이 쓴 글입니다.
> 제목 : Re : Re : 청산조건 2가지로 운용 문의
>
작성해주신 식을 선물3분 봉에 적용했는데 b1,b2 모두 신호가 발생하지 않아서요
청산(5,0.3,PercentStop)으로 했습니다. 혹시,작성 본문에서 cond1 에 대한 정의가 없어서
인지요.답변 좀 부탁드립니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 청산조건 2가지로 운용 문의
>
안녕하세요
예스스탁입니다.
Input: DN(5),TS(0.3),AT(15),MUL(2);
var : cnt(0),이익횟수(0);
var : cond1(False),cond2(False);
value1 = ma(C, 5);
value2 = ma(C, 20);
if bdate != bdate[1] Then
{
이익횟수 = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if PositionProfit(cnt) > 0 Then
이익횟수 = 이익횟수+1;
}
#당일 이익횟수는 3회이상이고 앞에 10봉내에서 3회이상 이익발생
cond2 = 이익횟수 >= 3 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) >= 0,10) >= 3;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
if CrossUP(value1, value2) and cond1 == true Then
Buy("b1");
if cond2 == true Then
Buy("b2");
}
if MarketPosition == 1 Then
{
if IsEntryName("b1") Then
SetStopTrailing(dn,ts,PercentStop);
Else
SetStopTrailing(0,0);#해제
if IsEntryName("b2") Then
{
exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul);
}
}
Else
{
SetStopTrailing(0,0);#해제
}
즐거운 하루되세요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 청산조건 2가지로 운용 문의
>
안녕하세요
예스스탁입니다.
Input: DN(4),TS(10),AT(15),MUL(2);
var : cnt(0),이익횟수(0);
var : cond1(False),cond2(False);
value1 = ma(C, 5);
value2 = ma(C, 20);
if bdate != bdate[1] Then
{
이익횟수 = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if PositionProfit(cnt) > 0 Then
이익횟수 = 이익횟수+1;
}
#당일 이익횟수는 3회이상이고 앞에 10봉내에서 3회이상 이익발생
cond2 = 이익횟수 >= 3 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) >= 0,10) >= 3;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
if CrossUP(value1, value2) and cond1 == true Then
Buy("b1");
if cond2 == true Then
Buy("b2");
}
if MarketPosition == 1 Then
{
if IsEntryName("b1") Then
SetStopTrailing(dn,ts,PercentStop);
Else
SetStopTrailing(0,0);#해제
if IsEntryName("b2") Then
{
exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul);
}
}
Else
{
SetStopTrailing(0,0);#해제
}
SetStopLoss(0.1,PercentStop);
즐거운 하루되세요