답변완료
문의드립니다
1. 아래 수식에서 추세선 꼭지점 마다 추세가 전환될 경우를 예상하여/ 추세 전환 후 첫 진입하려고 하는 첫진입 예상지수
(전고점+N틱, 혹은 전저점-N틱)를 알기 쉽게 추세 꼭지점 위,아래에 표시되게 수정 부탁합니다.
2. 현재 추세가 반대로 바뀌면 이미 진입된 매수, 매도 물량이 일괄 청산되도록 되어 있는데/
추세가 바뀔 때 바로 청산되는 것이 아니라 이미 진입된 매수 물량은 마지막 전고점+N틱에 청산되고, 매도 물량은 전저점-N틱에 청산될 수 있도록 수정 부탁해요.
감사합니다.
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0);
var:T(0),B(0),Bx(0),S(0),Sx(0);
Array:고점[10,2](0),저점[10,2](0);
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then{
color = RED;
# buy("b");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] Then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then{
color = blue;
# sell("s");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,3);
: 첫(),추가();
#상승구간의 마지막저점 저장
if Color == RED Then
{
var1 = 저점[2,1];
}
#하락구간의 마지막 고점 저장
if Color == BLUE Then
{
var2 = 고점[2,1];
}
if MarketPosition <= 0 Then
{
if color == BLUE and var1 > 0 and L > var1-PriceScale* Then
Buy("b",AtLimit,var1-PriceScale*,1);
}
if MarketPosition == 1 Then
{
value1 = Floor(MaxEntries/N)+1;
Buy("bb",AtLimit,(var1[BarsSinceEntry]-PriceScale*)-(PriceScale*)*MaxEntries,value1);
if T == -1 and 고점[1,1] > 0 Then
ExitLong("bx1",AtLimit,고점[1,1]+PriceScale*1);
if T == 1 and 고점[2,1] > 0 Then
ExitLong("bx2",AtLimit,고점[2,1]+PriceScale*1);
}
if MarketPosition >= 0 Then
{
if Color == RED and Var2 > 0 and H < var2+PriceScale* Then
Sell("s",AtLimit,Var2+PriceScale*,1);
}
if MarketPosition == -1 Then
{
value1 = Floor(MaxEntries/N)+1;
Sell("ss",AtLimit,(var2[BarsSinceEntry]+PriceScale*)+(PriceScale*)*MaxEntries,value1);
if T == 1 and 저점[1,1] > 0 Then
ExitShort("sx1",AtLimit,저점[1,1]-PriceScale*1);
if T == -1 and 저점[2,1] > 0 Then
ExitShort("sx2",AtLimit,저점[2,1]-PriceScale*1);
}
2022-04-12
997
글번호 157946
시스템
답변완료
질문드립니다
> 견유학자 님이 쓴 글입니다.
> 제목 : 질문드립니다
> Plot1(Data2(OpenD(0)),"d2시가");
Plot2(Data2(highD(1)),"d2고가");
Plot3(Data2(lowD(1)),"d2저가");
Plot4(Data3(OpenD(0)),"d3시가");
Plot5(Data3(highD(1)),"d3고가");
Plot6(Data3(lowD(1)),"d3저가");
Plot7(Data4(OpenD(0)),"d4시가");
Plot8(Data4(highD(1)),"d4고가");
Plot9(Data4(lowD(1)),"d4저가");
이상의 9개 선에 가격봉이 닿을때 소리가 나오게 하려면 어떻게 해야 할까요
라는 질문에 대해 아래의 수식을 주셨었는데요
문제는 위의 수식과는 달리, 아래의 수식을 적용하면 참조데이터의 선들이 본차트로 들어가질 않습니다.
원래는 본차트 1개에 참조차트 3개의 선들이 다 들어가도록 적용된 것들이었거든요.
그리고 그 음성들은 당연히 본차트의 가격이 그 선들(값들)에 닿았을 때 소리가 나길 원했던 것입니다.
혹시 제가 뭔가 잘못 적용한걸까요?
아래는 전에 주셨던 답글 수식
Plot1(Data2(OpenD(0)),"d2시가");
Plot2(Data2(highD(1)),"d2고가");
Plot3(Data2(lowD(1)),"d2저가");
Plot4(Data3(OpenD(0)),"d3시가");
Plot5(Data3(highD(1)),"d3고가");
Plot6(Data3(lowD(1)),"d3저가");
Plot7(Data4(OpenD(0)),"d4시가");
Plot8(Data4(highD(1)),"d4고가");
Plot9(Data4(lowD(1)),"d4저가");
var : O2(0,Data1),h2(0,Data1),l2(0,Data1);
var : O3(0,Data1),h3(0,Data1),l3(0,Data1);
var : O4(0,Data1),h4(0,Data1),l4(0,Data1);
O2 = Data2(OpenD(0));
H2 = Data2(highD(1));
L2 = Data2(lowD(1));
O3 = Data3(OpenD(0));
H3 = Data3(highD(1));
L3 = Data3(lowD(1));
O4 = Data4(OpenD(0));
H4 = Data4(highD(1));
L4 = Data4(lowD(1));
if (h >= O2 and h[1] < O2[1]) or (L <= O2 and L[1] > O2[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= H2 and h[1] < H2[1]) or (L <= H2 and L[1] > H2[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= L2 and h[1] < L2[1]) or (L <= L2 and L[1] > L2[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= O3 and h[1] < O3[1]) or (L <= O3 and L[1] > O3[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= H3 and h[1] < H3[1]) or (L <= H3 and L[1] > H3[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= L3 and h[1] < L3[1]) or (L <= L3 and L[1] > L3[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= O4 and h[1] < O4[1]) or (L <= O4 and L[1] > O4[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= H4 and h[1] < H4[1]) or (L <= H4 and L[1] > H4[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
if (h >= L4 and h[1] < L4[1]) or (L <= L4 and L[1] > L4[1]) Then
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
답변 부탁드립니다.
2022-04-11
1221
글번호 157944
지표
답변완료
CT를 YT로 변환
수고하십니다.
공부목적으로 대신 CT 수식을 예트로 처음 변환하여 보았습니다.
pdf 파일인지라 복사붙이기가 깨끗하게 안나오는군요
무엇이 잘못되었는지 ,
변환된 예트 시스템식이 CT식과는 진입/청산이 틀리게 작동을 합니다
var1, var2를 장단기지표로 보고, CT지표로 나온 그림과 비교하였는데,
차트 세팅을 잘못한것인지(수정주가 on|off 둘 다 해봄) 차이가 좀 많이 나네요??!!!
아마도 CT함수와 YT함수 매칭이 잘못된 것 같은데, 체크 부탁 드립니다.
수정하신 부분에 기존소스 주석처리와 함께 설명도 부탁드리겠습니다.
그리고, 매수|매도와 매수1|매도1의 차이가 무엇인지요?
시간이 되면 원격접속 부탁 드리겠습니다.
#======================================================#
# CT <수식 0-11> DD_CongestionBreak(방법1)
#======================================================#
Input: len(10), len1(70), len2(0.37), s1(2.7), method(1), delay(8)
If method=1 Then
Var1=atr(len)
Var2=atr(len1)
Elseif method=2 Then
Var20=high-low
Var1=mov(Var20,len,s)
Var2=mov(Var20,len1,s)
End If
Cond1=tdate=exitdate(1) And position(1)=1
Cond2=tdate=exitdate(1) And position(1)=-1
If Var1<var2 Then
Var10=1
Else
Var10=0
EndIf
If hhv(1,Var10,delay)=1 Then
If ttime<1500 Then
If Cond1=False And high<opend+(highd(1)-lowd(1))*len2 Then
Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*len2)
End If
IfCond2=False And low>opend-(highd(1)-lowd(1))*len2 Then
Call sell("매도",Atstop,Def,opend-(highd(1)-lowd(1))*len2)
End If
If Cond1=False And high>opend+(highd(1)-lowd(1))*len2 Then
Call buy("매수1",Atstop,Def,hhv(1,high,delay))
End If
If Cond2=False And low<opend-(highd(1)-lowd(1))*len2 Then
Callsell("매도1",Atstop,Def,llv(1,low,delay))
End If
End if
End If
If position<>0then
Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s1)
Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s1)
EndIf
#======================================================#
# YT <수식 0-11> DD_CongestionBreak(방법1)
#======================================================#
Input: len(10), len1(70), len2(0.37), s1(2.7), method(1), delay(8);
If method == 1 Then {
Var1=atr(len);
Var2=atr(len1) ;
}
Else if method == 2 Then {
Var20 = high - low;
Var1 = ma(Var20,len);
Var2 = ma(Var20,len1) ;
}
condition1 = date == exitdate(1) And MarketPosition(1)== 1 ;
condition2 = date == exitdate(1) And MarketPosition(1)== -1 ;
If Var1<var2 Then
Var10=1 ;
Else
Var10=0 ;
If NthHighest(1,Var10,delay)==1 Then {
If time<150000 Then {
If condition1==False And high < dayopen + (dayhigh(1)-daylow(1))*len2 Then
buy("매수",Atstop,dayopen + (dayhigh(1)-daylow(1))*len2);
If condition2==False And low>dayopen-(dayhigh(1)-daylow(1))*len2 Then
sell("매도",Atstop,dayopen-(dayhigh(1)-daylow(1))*len2);
If condition1==False And high > dayopen + (dayhigh(1)-daylow(1))*len2 Then
buy("매수1",Atstop,NthHighest(1,high,delay));
If condition2==False And low < dayopen - (dayhigh(1)-daylow(1))*len2 Then
sell("매도1",Atstop,NthLowest(1,low,delay));
}
}
If MarketPosition <> 0 then {
exitlong("매수청산",Atstop,NthHighest(1,high, BarsSinceEntry+1)-atr(20)*s1);
exitshort("매도청산",Atstop,NthLowest(1,low, BarsSinceEntry+1)+atr(20)*s1) ;
}
2022-04-12
1416
글번호 157942
시스템