예스스탁
예스스탁 답변
2021-11-02 15:00:20
안녕하세요
예스스탁입니다.
1
이전문의하신 내용과 같이 수식에는 타주기를 계산하는 부분이 없는데 변수값만 사용이 되어 있습니다.
기본차트봉기준 n1,n2전봉의 고가를 기준으로 신호 발생하게 수정해 드립니다.
2
Buy("b1",AtStop,H1[n1]+PriceScale*1 and H2[n2]+PriceScale*1);
buy와 sell에 위와 가격지정에 and문이 사용되었습니다.의미를 알수 없는내용입니다.
1개 값중 큰값과 작은값로 처리해 드립니다.
3
input : n1(10),n2(30);
input : StartTime(223000),EndTime(235000);
input : 익절틱수(80),손절틱수(0);
var : Tcond(false);
Array : H1[50](0),L1[50](0),H2[50](0),L2[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 > H[n2]+PriceScale*1 and C > O Then
Buy("b");
#봉완성 매도
if C < L[N1]-PriceScale*1 and C < L[N2]-PriceScale*1 and C < O Then
Sell("s");
#즉시 매수
if NextBarOpen <= H[n1] and NextBarOpen <= H[n2] Then
Buy("b1",AtStop,max(H[n1]+PriceScale*1,H[n2]+PriceScale*1));
#즉시 매도
if NextBarOpen >= L[n1] and NextBarOpen >= L[n2] Then
Sell("s1",AtStop, min(L[n1]-PriceScale*1,L[n2]-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);
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);
}
}
즐거운 하루되세요
> jesten77 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 항상 감사드립니다.
응용을 해보고 있는데요.
아래 수식에 문제점이 있는 거 같습니다.
확인 및 수정 부탁드립니다.
input : n1(10),n2(30);
input : StartTime(223000),EndTime(235000);
input : 익절틱수(80),손절틱수(0);
var : Tcond(false);
Array : H1[50](0),L1[50](0),H2[50](0),L2[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]+PriceScale*1 and C > H2[n2]+PriceScale*1 and C > O Then
Buy("b");
#봉완성 매도
if C < L1[N1]-PriceScale*1 and C < L2[N2]-PriceScale*1 and C < O Then
Sell("s");
#즉시 매수
if NextBarOpen <= H1[n1] and NextBarOpen <= H2[n2] Then
Buy("b1",AtStop,H1[n1]+PriceScale*1 and H2[n2]+PriceScale*1);
#즉시 매도
if NextBarOpen >= L1[n1] and NextBarOpen >= L2[n2] Then
Sell("s1",AtStop,L1[n1]-PriceScale*1 and L2[n2]-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);
#매수진입 후 매수봉의 다음봉의 저가보다 1틱이상 낮은 시세 발생하면 청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L-PriceScale*1);
#매도진입 후 매도봉의 다음봉의 고가보다 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);
}
}