예스스탁
예스스탁 답변
2020-09-16 11:16:59
안녕하세요
예스스탁입니다.
1
input : BuyA_CCILeng(2) // CCI 기간
, BuyA_SignalLeng(5) // 시그날 기간
;
input : BuyB_CCILeng(2) // CCI 기간
, BuyB_SignalLeng(2) // 시그날 기간
, BuyB_CCILine(0) // CCI 기준값
, BuyB_ChoiceType(0) // CCI 또는 Signal 선택
;
input : BuyC_CCILeng(2) // CCI 기간
, BuyC_SignalLeng(3) // 시그날 기간
, BuyC_CCILine(0) // CCI 기준값
, BuyC_ChoiceType(0) // CCI 또는 Signal 선택
;
input : BuyD_sLeng(9) // ADX 기간
;
input : BuyE_sLeng(17) // ADX 기간
;
input : BuyF_sLeng(42) // ADX 기간
;
var : BuyA_V1(0), BuyA_V2(0), BuyA_Result(FALSE);
var : BuyB_V(0), BuyB_V1(0), BuyB_V2(0), BuyB_Result(FALSE);
var : BuyC_V(0), BuyC_V1(0), BuyC_V2(0), BuyC_Result(FALSE);
var : BuyD_Price3(0), BuyD_Result(FALSE);
var : BuyE_Price3(0), BuyE_Result(FALSE);
var : BuyF_Price3(0), BuyF_Result(FALSE);
BuyA_V1 = CCI(BuyA_CCILeng);
BuyA_V2 = EMA(BuyA_V1, BuyA_SignalLeng);
BuyA_Result = crossup(BuyA_V1, BuyA_V2);
BuyB_V1 = CCI(BuyB_CCILeng);
BuyB_V2 = EMA(BuyB_V1, BuyB_SignalLeng);
If BuyB_ChoiceType == 0 Then // CCI 선택
Begin
BuyB_V = BuyB_V1;
End
Else // Signal 선택
Begin
BuyB_V = BuyB_V2;
End;
BuyB_Result = crossup(BuyB_V, BuyB_CCILine);
BuyC_V1 = CCI(BuyC_CCILeng);
BuyC_V2 = EMA(BuyC_V1, BuyC_SignalLeng);
If BuyC_ChoiceType == 0 Then // CCI 선택
Begin
BuyC_V = BuyC_V1;
End
Else // Signal 선택
Begin
BuyC_V = BuyC_V2;
End;
BuyC_Result = crossup(BuyC_V, BuyC_CCILine);
BuyD_Price3 = ADX (BuyD_sLeng);
BuyD_Result = FALSE;
IF BuyD_Price3 > BuyD_Price3[1] And BuyD_Price3[2] > BuyD_Price3[1] Then
BuyD_Result = TRUE;
BuyE_Price3 = ADX (BuyE_sLeng);
BuyE_Result = FALSE;
IF BuyE_Price3 > BuyE_Price3[1] And BuyE_Price3[2] > BuyE_Price3[1] Then
BuyE_Result = TRUE;
BuyF_Price3 = ADX (BuyF_sLeng);
BuyF_Result = FALSE;
IF BuyF_Price3 > BuyF_Price3[1] And BuyF_Price3[2] > BuyF_Price3[1] Then
BuyF_Result = TRUE;
if ( BuyA_Result And (BuyB_Result Or BuyC_Result) And (BuyD_Result Or BuyE_Result Or BuyF_Result) )
Then
Begin
Buy();
End;
input : ExitLongA_CCILeng(2) // CCI 기간
, ExitLongA_SignalLeng(5) // 시그날 기간
, ExitLongA_Trend(1) // 최소 추세 연속 봉 갯수
, ExitLongA_ChoiceType(0) // CCI 또는 Signal 선택
;
var : ExitLongA_V(0), ExitLongA_V1(0), ExitLongA_V2(0), ExitLongA_nVal(0), ExitLongA_SumDay(0), ExitLongA_Result(FALSE);
ExitLongA_V1 = CCI(ExitLongA_CCILeng);
ExitLongA_V2 = EMA(ExitLongA_V1, ExitLongA_SignalLeng);
If ExitLongA_ChoiceType == 0 Then // CCI 선택
Begin
ExitLongA_V = ExitLongA_V1;
End
Else // Signal 선택
Begin
ExitLongA_V = ExitLongA_V2;
End;
IF ExitLongA_V < ExitLongA_V[1] Then
ExitLongA_nVal = 1;
Else
ExitLongA_nVal = (-1);
ExitLongA_SumDay = AccumN(ExitLongA_nVal, ExitLongA_Trend);
ExitLongA_Result = (ExitLongA_SumDay == ExitLongA_Trend);
if ( ExitLongA_Result )
Then
Begin
ExitLong();
End;
SetStopEndOfday(152000);
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyStoplossPoint(1);
SetStopPosition; // 포지션 전체
SetStopLoss( MyStoplossPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyProfitTargetPoint(3);
SetStopPosition; // 포지션 전체
SetStopProfitTarget( MyProfitTargetPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyPointTrailingBefore(.65), MyPercentTrailingAfter(88);
SetStopPosition; // 포지션 전체
SetStopTrailing(MyPointTrailingBefore, MyPercentTrailingAfter,PercentStop);
2
#매도
input : SellA_CCILeng(3) // CCI 기간
, SellA_SignalLeng(5) // 시그날 기간
, SellA_CCILine(0) // CCI 기준값
, SellA_ChoiceType(0) // CCI 또는 Signal 선택
;
input : SellB_sLeng(2) // ADX 기간
;
input : SellC_sLeng(2) // ADX 기간
;
input : SellD_sLeng(2) // ADX 기간
;
var : SellA_V(0), SellA_V1(0), SellA_V2(0), SellA_Result(FALSE);
var : SellB_Price3(0), SellB_Result(FALSE);
var : SellC_Price3(0), SellC_Result(FALSE);
var : SellD_Price3(0), SellD_Result(FALSE);
SellA_V1 = CCI(SellA_CCILeng);
SellA_V2 = EMA(SellA_V1, SellA_SignalLeng);
If SellA_ChoiceType == 0 Then // CCI 선택
Begin
SellA_V = SellA_V1;
End
Else // Signal 선택
Begin
SellA_V = SellA_V2;
End;
SellA_Result = crossdown(SellA_V, SellA_CCILine);
SellB_Price3 = ADX (SellB_sLeng);
SellB_Result = FALSE;
IF SellB_Price3 > SellB_Price3[1] And SellB_Price3[2] > SellB_Price3[1] Then
SellB_Result = TRUE;
SellC_Price3 = ADX (SellC_sLeng);
SellC_Result = FALSE;
IF SellC_Price3 > SellC_Price3[1] And SellC_Price3[2] > SellC_Price3[1] Then
SellC_Result = TRUE;
SellD_Price3 = ADX (SellD_sLeng);
SellD_Result = FALSE;
IF SellD_Price3 > SellD_Price3[1] And SellD_Price3[2] > SellD_Price3[1] Then
SellD_Result = TRUE;
if ( SellA_Result And (SellB_Result Or SellC_Result Or SellD_Result) )
Then
Begin
Sell();
End;
//////////////////////////////////////////////////////////////////////////
// 매도청산
input : ExitShortA_CCILeng(2) // CCI 기간
, ExitShortA_SignalLeng(5) // 시그날 기간
, ExitShortA_Trend(2) // 최소 추세 연속 봉 갯수
, ExitShortA_ChoiceType(0) // CCI 또는 Signal 선택
;
var : ExitShortA_V(0), ExitShortA_V1(0), ExitShortA_V2(0), ExitShortA_nVal(0), ExitShortA_SumDay(0), ExitShortA_Result(FALSE);
ExitShortA_V1 = CCI(ExitShortA_CCILeng);
ExitShortA_V2 = EMA(ExitShortA_V1, ExitShortA_SignalLeng);
If ExitShortA_ChoiceType == 0 Then // CCI 선택
Begin
ExitShortA_V = ExitShortA_V1;
End
Else // Signal 선택
Begin
ExitShortA_V = ExitShortA_V2;
End;
IF ExitShortA_V > ExitShortA_V[1] Then
ExitShortA_nVal = 1;
Else
ExitShortA_nVal = (-1);
ExitShortA_SumDay = AccumN(ExitShortA_nVal, ExitShortA_Trend);
ExitShortA_Result = (ExitShortA_SumDay == ExitShortA_Trend);
if ( ExitShortA_Result )
Then
Begin
ExitShort();
End;
SetStopEndOfday(152000);
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyStoplossPoint(1);
SetStopPosition; // 포지션 전체
SetStopLoss( MyStoplossPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyProfitTargetPoint(3);
SetStopPosition; // 포지션 전체
SetStopProfitTarget( MyProfitTargetPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyPointTrailingBefore(.65), MyPercentTrailingAfter(.66);
SetStopPosition; // 포지션 전체
SetStopTrailing(MyPointTrailingBefore, MyPercentTrailingAfter,PercentStop);
SetStopPosition; // 포지션 전체
즐거운 하루되세요
> 김영재 님이 쓴 글입니다.
> 제목 : 시그널메이커 수식을 예스트레이더로 변환가능할까요?
> 시그널메이커에서 만든 수식입니다
예스트레이더로 변환 부탁드립니다
매수
param : BuyA_CCILeng(2) // CCI 기간
, BuyA_SignalLeng(5) // 시그날 기간
;
param : BuyB_CCILeng(2) // CCI 기간
, BuyB_SignalLeng(2) // 시그날 기간
, BuyB_CCILine(0) // CCI 기준값
, BuyB_ChoiceType(0) // CCI 또는 Signal 선택
;
param : BuyC_CCILeng(2) // CCI 기간
, BuyC_SignalLeng(3) // 시그날 기간
, BuyC_CCILine(0) // CCI 기준값
, BuyC_ChoiceType(0) // CCI 또는 Signal 선택
;
param : BuyD_sLeng(9) // ADX 기간
;
param : BuyE_sLeng(17) // ADX 기간
;
param : BuyF_sLeng(42) // ADX 기간
;
var : BuyA_V1(0), BuyA_V2(0), BuyA_Result(FALSE);
var : BuyB_V(0), BuyB_V1(0), BuyB_V2(0), BuyB_Result(FALSE);
var : BuyC_V(0), BuyC_V1(0), BuyC_V2(0), BuyC_Result(FALSE);
var : BuyD_Price3(0), BuyD_Result(FALSE);
var : BuyE_Price3(0), BuyE_Result(FALSE);
var : BuyF_Price3(0), BuyF_Result(FALSE);
BuyA_V1 = CCI2(Close, BuyA_CCILeng);
BuyA_V2 = EMA(BuyA_V1, BuyA_SignalLeng);
BuyA_Result = Crosses_Above(BuyA_V1, BuyA_V2);
BuyB_V1 = CCI2(Close, BuyB_CCILeng);
BuyB_V2 = EMA(BuyB_V1, BuyB_SignalLeng);
If BuyB_ChoiceType = 0 Then // CCI 선택
Begin
BuyB_V = BuyB_V1;
End
Else // Signal 선택
Begin
BuyB_V = BuyB_V2;
End;
BuyB_Result = Crosses_Above(BuyB_V, BuyB_CCILine);
BuyC_V1 = CCI2(Close, BuyC_CCILeng);
BuyC_V2 = EMA(BuyC_V1, BuyC_SignalLeng);
If BuyC_ChoiceType = 0 Then // CCI 선택
Begin
BuyC_V = BuyC_V1;
End
Else // Signal 선택
Begin
BuyC_V = BuyC_V2;
End;
BuyC_Result = Crosses_Above(BuyC_V, BuyC_CCILine);
BuyD_Price3 = ADX (BuyD_sLeng);
BuyD_Result = FALSE;
IF BuyD_Price3 > BuyD_Price3[1] And BuyD_Price3[2] > BuyD_Price3[1] Then
BuyD_Result = TRUE;
BuyE_Price3 = ADX (BuyE_sLeng);
BuyE_Result = FALSE;
IF BuyE_Price3 > BuyE_Price3[1] And BuyE_Price3[2] > BuyE_Price3[1] Then
BuyE_Result = TRUE;
BuyF_Price3 = ADX (BuyF_sLeng);
BuyF_Result = FALSE;
IF BuyF_Price3 > BuyF_Price3[1] And BuyF_Price3[2] > BuyF_Price3[1] Then
BuyF_Result = TRUE;
if ( BuyA_Result And (BuyB_Result Or BuyC_Result) And (BuyD_Result Or BuyE_Result Or BuyF_Result) )
Then
Begin
Buy();
End;
param : ExitLongA_CCILeng(2) // CCI 기간
, ExitLongA_SignalLeng(5) // 시그날 기간
, ExitLongA_Trend(1) // 최소 추세 연속 봉 갯수
, ExitLongA_ChoiceType(0) // CCI 또는 Signal 선택
;
var : ExitLongA_V(0), ExitLongA_V1(0), ExitLongA_V2(0), ExitLongA_nVal(0), ExitLongA_SumDay(0), ExitLongA_Result(FALSE);
ExitLongA_V1 = CCI2(Close, ExitLongA_CCILeng);
ExitLongA_V2 = EMA(ExitLongA_V1, ExitLongA_SignalLeng);
If ExitLongA_ChoiceType = 0 Then // CCI 선택
Begin
ExitLongA_V = ExitLongA_V1;
End
Else // Signal 선택
Begin
ExitLongA_V = ExitLongA_V2;
End;
IF ExitLongA_V < ExitLongA_V[1] Then
ExitLongA_nVal = 1
Else
ExitLongA_nVal = (-1);
ExitLongA_SumDay = AccumN(ExitLongA_nVal, ExitLongA_Trend);
ExitLongA_Result = (ExitLongA_SumDay = ExitLongA_Trend);
if ( ExitLongA_Result )
Then
Begin
ExitLong();
End;
SetStopEndOfday(152000);
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyStoplossPoint(1);
SetStopPosition; // 포지션 전체
SetStopLoss( MyStoplossPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyProfitTargetPoint(3);
SetStopPosition; // 포지션 전체
SetProfitTarget( MyProfitTargetPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyPointTrailingBefore(.65), MyPercentTrailingAfter(88);
SetStopPosition; // 포지션 전체
SetPercentTrailing(MyPointTrailingBefore, MyPercentTrailingAfter);
매도
param : SellA_CCILeng(3) // CCI 기간
, SellA_SignalLeng(5) // 시그날 기간
, SellA_CCILine(0) // CCI 기준값
, SellA_ChoiceType(0) // CCI 또는 Signal 선택
;
param : SellB_sLeng(2) // ADX 기간
;
param : SellC_sLeng(2) // ADX 기간
;
param : SellD_sLeng(2) // ADX 기간
;
var : SellA_V(0), SellA_V1(0), SellA_V2(0), SellA_Result(FALSE);
var : SellB_Price3(0), SellB_Result(FALSE);
var : SellC_Price3(0), SellC_Result(FALSE);
var : SellD_Price3(0), SellD_Result(FALSE);
SellA_V1 = CCI2(Close, SellA_CCILeng);
SellA_V2 = EMA(SellA_V1, SellA_SignalLeng);
If SellA_ChoiceType = 0 Then // CCI 선택
Begin
SellA_V = SellA_V1;
End
Else // Signal 선택
Begin
SellA_V = SellA_V2;
End;
SellA_Result = Crosses_Below(SellA_V, SellA_CCILine);
SellB_Price3 = ADX (SellB_sLeng);
SellB_Result = FALSE;
IF SellB_Price3 > SellB_Price3[1] And SellB_Price3[2] > SellB_Price3[1] Then
SellB_Result = TRUE;
SellC_Price3 = ADX (SellC_sLeng);
SellC_Result = FALSE;
IF SellC_Price3 > SellC_Price3[1] And SellC_Price3[2] > SellC_Price3[1] Then
SellC_Result = TRUE;
SellD_Price3 = ADX (SellD_sLeng);
SellD_Result = FALSE;
IF SellD_Price3 > SellD_Price3[1] And SellD_Price3[2] > SellD_Price3[1] Then
SellD_Result = TRUE;
if ( SellA_Result And (SellB_Result Or SellC_Result Or SellD_Result) )
Then
Begin
Sell();
End;
//////////////////////////////////////////////////////////////////////////
// 매도청산
param : ExitShortA_CCILeng(2) // CCI 기간
, ExitShortA_SignalLeng(5) // 시그날 기간
, ExitShortA_Trend(2) // 최소 추세 연속 봉 갯수
, ExitShortA_ChoiceType(0) // CCI 또는 Signal 선택
;
var : ExitShortA_V(0), ExitShortA_V1(0), ExitShortA_V2(0), ExitShortA_nVal(0), ExitShortA_SumDay(0), ExitShortA_Result(FALSE);
ExitShortA_V1 = CCI2(Close, ExitShortA_CCILeng);
ExitShortA_V2 = EMA(ExitShortA_V1, ExitShortA_SignalLeng);
If ExitShortA_ChoiceType = 0 Then // CCI 선택
Begin
ExitShortA_V = ExitShortA_V1;
End
Else // Signal 선택
Begin
ExitShortA_V = ExitShortA_V2;
End;
IF ExitShortA_V > ExitShortA_V[1] Then
ExitShortA_nVal = 1
Else
ExitShortA_nVal = (-1);
ExitShortA_SumDay = AccumN(ExitShortA_nVal, ExitShortA_Trend);
ExitShortA_Result = (ExitShortA_SumDay = ExitShortA_Trend);
if ( ExitShortA_Result )
Then
Begin
ExitShort();
End;
SetStopEndOfday(152000);
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyStoplossPoint(1);
SetStopPosition; // 포지션 전체
SetStopLoss( MyStoplossPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyProfitTargetPoint(3);
SetStopPosition; // 포지션 전체
SetProfitTarget( MyProfitTargetPoint );
////////////////////////////////////////////////////////////////////////////////////////
Inputs: MyPointTrailingBefore(.65), MyPercentTrailingAfter(.66);
SetStopPosition; // 포지션 전체
SetPercentTrailing(MyPointTrailingBefore, MyPercentTrailingAfter);
SetStopPosition; // 포지션 전체
SetExitOnClose;