예스스탁
예스스탁 답변
2022-03-30 13:32:12
안녕하세요
예스스탁입니다.
변경하신 내용에서 특별히 처리해 드릴부분은 없습니다.
1
day~로 시작하는 함수는 data1의 값을 리턴합니다.
참조데이타에서는 openD,lowD,highD,CloseD함수를 이용하셔야 하고
일간 거래량은 별도로 제공되지 않으므로 별도로 작성해 사용하셔야 합니다.
다만 data1과 data2가 같은 종목이면 해당 함수를 그대로 사용하셔도 됩니다.
2
atstop과 atlimit은 지정한 값과 기본차트의 현재가와만 비교를 합니다.
기본적으로 시스템을 data2기준으로 변경하면 해당타입은 봉완성시로 모두 변경해야 합니다.
해당식의 의도를 정확히 알수 없어 해당내용은 그대로 적어드립니다.
3
수식에 같은 계산을 하는 내용은 변수처리해서 사용하셔야 합니다.
Disparity(360)와 같이 반복적으로 사용하는 경우가 있는데
동일 계산을 하는 함수를 나열해서 사용하면
함수가 불필요하게 여러번 호출이 되서 수식의 계산속도만 더 걸리게 됩니다.
4
input : Period(360);
var : HP(0,Data2),HV(0,Data2);
var : vema(0,Data1),vma(0,Data2),WMav(0,Data2),dis1(0,Data2),dis2(0,Data2);
if Bdate != Bdate[1] Then
{
HP = 0;
HV = 0;
}
vema = data2(Ema(V,Period));
vma = data2(ma(v,5));
WMav = WMa(C,10);
dis1 = Disparity(240);
dis2 = Disparity(360);
if data2(DayVolume(1)*C > 1000000000 and c > DayOpen(0)) Then
{
if data2(V > vema*10 and V >= Highest(V,period)) Then
{
HV = data2(V);
HP = data2(H);
}
if data2(C>O and V>V[1] and ((C > HP[1] and CrossUp(v,HV[1])) or (V > HV[1] and CrossUp(C,HP[1]))) and V < ma(v,5)*5) Then
{
Buy("BV");
}
if LatestExitName(0) == "XV" or isexitname("Stoptrailing",1) == true Then
{
if data2(c > O and V > v[1] and WMav > WMav[1]) Then
{
Buy("Br",AtLimit,O);
}
}
if data2(crossdown(dis2,150) or crossdown(dis2,145) or crossdown(dis2,140) or crossdown(dis2,135) or
crossdown(dis2,130) or crossdown(dis2,125) or crossdown(dis2,120)) Then
{
ExitLong("XH",AtStop,c[1]);
}
if data2(CrossDown(dis1,99)) Then
{
ExitLong("XL",AtStop,c[1]);
}
if latestEntryName(0) == "Br" and data2(c < o and V < V[1]) Then
{
ExitLong("Xr",AtStop,O);
}
if LatestEntryName(0) == "BV" Then
{
if data2(dis2 > 110) Then
SetStopTrailing(30,20,PercentStop,0);
}
}
즐거운 하루되세요
> 김예스 님이 쓴 글입니다.
> 제목 : 수식을 참조지표로 변경하고 싶습니다.
> 안녕하세요,
아래 수정 전 수식을 1분주기 3000봉 띄워서 매매하고 있었는데,
1분봉 차트를 data2 참조지표로 내리고, 10초차트를 300개만 data1으로 띄워서 매매를 하고자 합니다.
그래서 수식을 아래처럼 변경했는데 신호가 원하는 곳에 발생하지 않습니다.
10초차트를 300개만 띄울 생각인데 dayopen, dayvolume(1)같은 함수도 data2(dayvolume(1)) 이런식으로 하면 되는지 궁금합니다.
의도는 1분차트data2에서 period기간 내 최대 거래량(HV)과 가격(HP)을 저장하고, 10초차트data1 거래량이 data2 최대 거래량(HV)*0.9 이상에서 전봉 거래량 대비 20배 이상 발생 했을 때 매수("BV")하고자 합니다.
data2에서 최대 거래량과 가격이 저장이 안되는 것 같습니다.
참조지표에서 거래량 데이터를 불러올 수 없는건가요?
수정 부탁드립니다.
수정 전 수식 :
input : Period(360);
var : HP(0),HV(0);
if Bdate != Bdate[1] Then {
HP = 0;
HV = 0;
}
if DayVolume(1)*C > 1000000000 and c > DayOpen(0) Then {
if V > ema(V,period)*10 and V >= Highest(V,period) Then {
HV = V;
HP = H;
}
if C>O and v>V[1] and ((C > HP[1] and CrossUp(v,HV[1])) or (V > HV[1] and CrossUp(C,HP[1]))) and V < ma(v,5)*5 Then {
Buy("BV");
}
if LatestExitName(0) == "XV" or isexitname("Stoptrailing",1) == true Then {
if c > O and V > v[1] and WMa(C,10) > WMa(c,10)[1] Then{
Buy("Br",AtLimit,O);
}
}
if crossdown(Disparity(360),150) or crossdown(Disparity(360),145) or crossdown(Disparity(360),140) or crossdown(Disparity(360),135) or crossdown(Disparity(360),130) or crossdown(Disparity(360),125) or crossdown(Disparity(360),120) Then {
ExitLong("XH",AtStop,c[1]);
}
if CrossDown(Disparity(240),99) Then {
ExitLong("XL",AtStop,c[1]);
}
if latestEntryName(0) == "Br" and c < o and V < V[1] Then {
ExitLong("Xr",AtStop,O);
}
if LatestEntryName(0) == "BV" Then {
if Disparity(360) > 110 Then SetStopTrailing(30,20,PercentStop,0);
}
}
수정한 수식 :
input : Period(360);
var : HP(0,Data2),HV(0,Data2);
if Data2(Bdate != Bdate[1]) Then {
HP = 0;
HV = 0;
}
if Data2(DayVolume(1)*C > 1000000000 and c > DayOpen(0)) Then {
if Data2(V > ma(V,period)*20 and V >= Highest(V,period)) Then {
HV = Data2(V);
HP = Data2(H);
}
if Data2(C>O and v>V[1]) and data1(C) > HP*0.9 and data2(v) > HV*0.9 and data1(ma(c,10) > ma(c,10)[1]) Then {
if data1(ma(v,3) > ma(v,10)[1]*20) Then
Buy("BV");
}
if LatestExitName(0) == "XV" or isexitname("Stoptrailing",1) == true Then {
if Data2(c > O and V > v[1] and WMa(C,10) > WMa(c,10)[1]) Then{
Buy("Br",AtLimit,O);
}
}
if Data2(crossdown(Disparity(360),150) or crossdown(Disparity(360),145) or crossdown(Disparity(360),140) or crossdown(Disparity(360),135) or crossdown(Disparity(360),130) or crossdown(Disparity(360),125) or crossdown(Disparity(360),120)) Then {
ExitLong("XH",AtStop,c[1]);
}
if Data2(CrossDown(Disparity(240),99)) Then {
ExitLong("XL",AtStop,c[1]);
}
if latestEntryName(0) == "Br" and Data2(c < o and V < V[1]) Then {
ExitLong("Xr",AtStop,O);
}
if LatestEntryName(0) == "BV" Then {
if Data2(Disparity(360) > 110) Then SetStopTrailing(30,20,PercentStop,0);
}
}