예스스탁
예스스탁 답변
2020-01-02 10:16:00
안녕하세요
예스스탁입니다.
참조데이타를 이용하실 경우에
내장변수는 내장딘 선언에 데이타에 대한 지정이 없으므로 별도로 선언해서 하셔야 합니다.
또한 변수에 저장되는 값이 어떤 데이타의 주기를 따라가야하는지
구분해서 선언해 주셔야 합니다.
진입신호의 횟수나 신호와 관련된 것은 모두 data1기준을 따라가야 합니다.
Input : RSIPeriod(14),RSI매수값(35),SimPeriod(14),심리도값(37);
Input : N1(1),초기화(7);
Input : CCI기간(80),CCI값(200);
Input : 하락틱수(40);
Input : 즉시익절1(300),즉시손절1(75);
Input : 분할매수횟수(2),분할매수틱수(45);
input : N(5);
var : CCIv(0,data2),RSIv(0,data2),Simri(0,data2),BuySetup(false,data2),DD(0,data2);
var : cond1(false,data2),V1(0,data2),V2(0,data2);
var : entry(0,data1),cond2(false,data1);
CCIv = data2(CCI(CCI기간));
RSIV = data2(RSI(RSIPeriod));
Simri = data2(Simrido(SimPeriod));
if data1(bdate != bdate[1]) Then
Entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
Cond2 = MarketPosition == 0 and
(IsExitName("즉시손절1",1) == false or
(IsExitName("즉시손절1",1) == true and BarsSinceExit(1) > N));
Cond1 = RSIv < RSI매수값 and Simri < 심리도값;
if data2(bdate != bdate[1]) Then
{
DD = DD+1;
if v2 > 0 and DD == v2+초기화 Then
BuySetup = false;
}
if BuySetup == false and Cond1 == true and Cond1[1] == false Then
{
v1 = data2(C);
v2 = DD;
BuySetup = true;
}
if Cond2 == true and MarketPosition == 0 and BuySetup == true Then
buy("매수",AtLimit,v1-PriceScale*하락틱수);
#추가진입
if MarketPosition == 1 and MaxEntries < 분할매수횟수 Then
buy("추가매수",atlimit,LatestEntryPrice(0)-PriceScale*분할매수틱수,1);
if MarketPosition == 1 then
{
BuySetup = false;
if CrossDown(CCIv,CCI값) Then
ExitLong("매수cci청산");
ExitLong("즉시익절1",AtLimit,EntryPrice+PriceScale*즉시익절1);
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
}
즐거운 하루 되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 과장님 수식 좀 도와주실수 있으신가요?- 따로 따로 답변해주시면 감사 data2함수관련
> 기본차트는 다른 봉수로 설정하고 참조차트(data2)에 아래식을 변형하게 하려 합니다.
기본차트 수식
Input : RSIPeriod(14),RSI매수값(35),SimPeriod(14),심리도값(37);
Input : N1(1),초기화(7);
Input : CCI기간(80),CCI값(200);
Input : 하락틱수(40);
Input : 즉시익절1(300),즉시손절1(75);
Input : 분할매수횟수(2),분할매수틱수(45);
input : N(5);
var : CCIv(0),RSIv(0),Simri(0),BuySetup(false),DD(0),entry(0);
CCIv = CCI(CCI기간);
RSIV = RSI(RSIPeriod);
Simri = Simrido(SimPeriod);
if bdate != bdate[1] Then
Entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
Condition2 = MarketPosition == 0 and
(IsExitName("즉시손절1",1) == false or
(IsExitName("즉시손절1",1) == true and BarsSinceExit(1) > N));
Condition1 = RSIv < RSI매수값 and Simri < 심리도값;
if bdate != bdate[1] Then
{
DD = DD+1;
if var2 > 0 and DD == var2+초기화 Then
BuySetup = false;
}
if BuySetup == false and Condition1 == true and Condition1[1] == false Then
{
var1 = C;
var2 = DD;
BuySetup = true;
}
if Condition2 == true and MarketPosition == 0 and BuySetup == true Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
#추가진입
if MarketPosition == 1 and MaxEntries < 분할매수횟수 Then
buy("추가매수",atlimit,LatestEntryPrice(0)-PriceScale*분할매수틱수,1);
if MarketPosition == 1 then
{
BuySetup = false;
if CrossDown(CCIv,CCI값) Then
ExitLong("매수cci청산");
ExitLong("즉시익절1",AtLimit,EntryPrice+PriceScale*즉시익절1);
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
}
===========================================================================
위 차트 수식을 data2 참조차트에 동일하게 구현하려고 합니다. 맞느지 한번 봐주세요
input 변수는 그대로
var 는 각 변수마다 (0) --> (0,data2)로 변경
지정수식은 A = B ---> A = data2(B)
그리고 잘 모르겠어요.. 다음 수식에는 data2를 어디다가 넣어야 하는지... ...ㅠㅠ
Input : RSIPeriod(14),RSI매수값(35),SimPeriod(14),심리도값(37);
Input : 초기화(7);
Input : CCI기간(80),CCI값(200);
Input : 하락틱수(40);
Input : 즉시익절1(300),즉시손절1(75);
Input : 분할매수횟수(2),분할매수틱수(45);
input : N(7);
var : CCIv(0,Data2),RSIv(0,Data2),Simri(0,Data2),BuySetup(false,Data2),DD(0,Data2),entry(0,Data2);
CCIv = data2(CCI(CCI기간));
RSIV = data2(RSI(RSIPeriod));
Simri = data2(Simrido(SimPeriod));
if data2( bdate != bdate[1] ) Then
Entry = 0;
if data2(MarketPosition != 0 and MarketPosition != MarketPosition[1]) Then
entry = entry+1;
Condition2 = data2(MarketPosition == 0 )and
data2((IsExitName("즉시손절1",1) == false)) or
data2( (IsExitName("즉시손절1",1) == true and BarsSinceExit(1) > N));
Condition1 = (RSIv < RSI매수값) and (Simri < 심리도값);
if data2(bdate != bdate[1]) Then
{
DD = DD+1;
if var2 > 0 and DD == var2+초기화 Then
BuySetup = false;
}
if BuySetup == false and Condition1 == true and Condition1[1] == false Then
{
var1 = C;
var2 = DD;
BuySetup = true;
}
if Condition2 == true and MarketPosition == 0 and BuySetup == true Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
#추가진입
if MarketPosition == 1 and MaxEntries < 분할매수횟수 Then
buy("추가매수",atlimit,LatestEntryPrice(0)-PriceScale*분할매수틱수,1);
if data2(MarketPosition == 1) then
{
BuySetup = false;
if CrossDown(CCIv,CCI값) Then
ExitLong("매수cci청산");
ExitLong("즉시익절1",AtLimit,EntryPrice+PriceScale*즉시익절1);
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
}