항상 감사드립니다.
확인 및 수정 부탁드립니다.
1. 손절을 bx, sx로 놓고 연구중에 있는데요. bx, sx되는 시점이 매수 매도 진입한 캔들이 완료되고 다음 캔들이 완성되고 그 캔들의 고가나 저가를 돌파할 때 청산됩니다.
진입한 캔들의 고가나 저가를 돌파할 때 청산되도록 수정 부탁드립니다.
2. 아래 수식에 Exit short, Exit long 수식 추가 부탁드립니다.
3. 거래시간 종료전에 익절 또는 손절 청산이 안되는 경우, 거래시간 이후에 익절 또는 손절 청산되도록 수정 부탁드립니다.
4. 종가 진입 - 매수는 양봉에만, 매도는 음봉에만 진입하도록 추가 부탁드립니다.
5. 조건 만족시 즉시 매수 매도 하는 수식 첨가 부탁드립니다.
* 주석 달아주시면 더욱 감사하겠습니다~~
input : n1(30);
input : StartTime(223000),EndTime(233000);
input : 익절틱수(80),손절틱수(0);
var : Tcond(false);
Array : H1[50](0),L1[50](0);
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
Tcond = true;
if Tcond == true Then
{
if C > H1[N1] and C > max(H1[N1])+PriceScale*1 and C > O Then
Buy("b");
if C < L1[N1] and C < min(L1[N1])-PriceScale*1 and C < O Then
Sell("s");
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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);
}
}
답변 1
예스스탁
예스스탁 답변
2021-11-01 11:05:43
안녕하세요
예스스탁입니다.
올리신 수식에는 다른주기의 고가나 저가를 계산하는 내용이 없습니다.
H1이나 L1값이 선언만 있고 계산내용이 없습니다.
올리신 그대로는 사용할수 없는 내용입니다.
기본차트 봉으로 n1개봉전 고가나 저가를 이용하는 내용인것으로 파악이 됩어
기본차트 봉으로 n1봉전 값과 비교해 신호발생하게 수정해 드립니다.
만약 다른주기이면
이전 답변내용을 참고하셔서 해당 수식 추가해서 수정하셔야 합니다.
수식안에 봉완성과 즉시 매수/매도가 같이 있으므로
선택해 사용하시기 바랍니다.
input : n1(30);
input : StartTime(223000),EndTime(233000);
input : 익절틱수(80),손절틱수(0);
var : Tcond(false);
Array : H1[50](0),L1[50](0);
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
Tcond = true;
if Tcond == true Then
{
#봉완성 매수
if C > H[n1]+PriceScale*1 and C > O Then
Buy("b");
#봉완성 매도
if C < L[N1]-PriceScale*1 and C < O Then
Sell("s");
#즉시 매수
if NextBarOpen <= H[n1] Then
Buy("b1",AtStop,H[n1]+PriceScale*1);
#즉시 매도
if NextBarOpen >= L[n1] Then
Sell("s1",AtStop,L[n1]-PriceScale*1);
#매수진입 후 매수봉의 저가보다 1틱이상 낮은 시세 발생하면 청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1);
#매도진입 후 매도봉의 고가보다 1틱이상 높은 시세 발생하면 청산
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> jesten77 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 항상 감사드립니다.
확인 및 수정 부탁드립니다.
1. 손절을 bx, sx로 놓고 연구중에 있는데요. bx, sx되는 시점이 매수 매도 진입한 캔들이 완료되고 다음 캔들이 완성되고 그 캔들의 고가나 저가를 돌파할 때 청산됩니다.
진입한 캔들의 고가나 저가를 돌파할 때 청산되도록 수정 부탁드립니다.
2. 아래 수식에 Exit short, Exit long 수식 추가 부탁드립니다.
3. 거래시간 종료전에 익절 또는 손절 청산이 안되는 경우, 거래시간 이후에 익절 또는 손절 청산되도록 수정 부탁드립니다.
4. 종가 진입 - 매수는 양봉에만, 매도는 음봉에만 진입하도록 추가 부탁드립니다.
5. 조건 만족시 즉시 매수 매도 하는 수식 첨가 부탁드립니다.
* 주석 달아주시면 더욱 감사하겠습니다~~
input : n1(30);
input : StartTime(223000),EndTime(233000);
input : 익절틱수(80),손절틱수(0);
var : Tcond(false);
Array : H1[50](0),L1[50](0);
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
Tcond = true;
if Tcond == true Then
{
if C > H1[N1] and C > max(H1[N1])+PriceScale*1 and C > O Then
Buy("b");
if C < L1[N1] and C < min(L1[N1])-PriceScale*1 and C < O Then
Sell("s");
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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);
}
}