답변완료
지표식을 시스템식으로
아래는 어느 분이 만든 지표식인데요, 지표(빨간점)가 발생하는 지점에서 MP==0 이면 매수(BUY)하는 시스템식으로 변환 부탁드립니다. 미리 감사
//전환쌍바닥지표식
Input : 전환(0.2),쌍바닥상(1),쌍바닥하(2);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분("");
Array:고[10,4](0),저[10,4](0);
var : TX12(0),cond12(False);
//Plot1(0);
HH = H;
LL = L;
If Index == 0 Then
{
고[1,1] = HH;
고[1,2] = 0;
고[1,3] = sDate;
고[1,4] = sTime;
저[1,1] = LL;
저[1,2] = 0;
저[1,3] = sDate;
저[1,4] = sTime;
}
If Index > 0 Then
{
hiBar = hiBar + 1;
loBar = loBar + 1;
}
If HH[hiBar] < HH Then hiBar = 0;
If LL[loBar] > LL Then loBar = 0;
Condition1 = 저[1,1]+전환 <= HH and hiBar == 0;
Condition2 = 고[1,1]-전환 >= LL and loBar == 0;
처리구분 = "";
If Condition1 and Condition2 Then
{
If 최종꼭지점 == "저점" Then
{
If 저[1,1] > LL Then 처리구분 = "저점처리";
Else 처리구분 = "고점처리";
}
Else If 최종꼭지점 == "고점" Then
{
If 고[1,1] < HH Then 처리구분 = "고점처리";
Else 처리구분 = "저점처리";
}
}
Else If Condition1 Then 처리구분 = "고점처리";
Else If Condition2 Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
}
Else If 고[1,1] < HH[hiBar] Then
{
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
}
최종꼭지점 = "고점";
}
If 처리구분 == "저점처리" Then
{
If 최종꼭지점 == "고점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
cond12 = False;
if 저[1,1] <= 저[2,1]+PriceScale*쌍바닥상 and 저[1,1] >= 저[2,1]-PriceScale*쌍바닥하 and 저[2,1] > 0 Then
{
cond12 = true;
tx12 = Text_New(저[1,3],저[1,4],저[1,1],"●");
Text_SetStyle(tx12,2,0);
Text_SetColor(tx12,red);
Text_SetSize(tx12,15);
}
}
Else If 저[1,1] > LL[loBar] Then
{
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
if cond12 == False Then
{
if 저[1,1] <= 저[2,1]+PriceScale*쌍바닥상 and 저[1,1] >= 저[2,1]-PriceScale*쌍바닥하 and 저[2,1] > 0 Then
{
cond12 = true;
tx12 = Text_New(저[1,3],저[1,4],저[1,1],"●");
Text_SetStyle(tx12,2,0);
Text_SetColor(tx12,red);
Text_SetSize(tx12,15);
}
}
Else
{
if 저[1,1] <= 저[2,1]+PriceScale*쌍바닥상 and 저[1,1] >= 저[2,1]-PriceScale*쌍바닥하 and 저[2,1] > 0 Then
{
Text_SetLocation(tx12,저[1,3],저[1,4],저[1,1]);
}
Else
{
Text_Delete(tx12);
cond12 = False;
}
}
}
최종꼭지점 = "저점";
}
2024-03-18
621
글번호 177604
시스템
답변완료
지표변환 부탁드립니다
감사합니다
아래 지표를 타분봉에서 사용할 수 있도록 변환부탁드립니다
Input :length(2);
Variables:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분("")
,sumv(0),sumi(0),mav(0),T(0);
Array:고[10,4](0),저[10,4](0);
#==========================================#
//
var : cnt(0);
Array : VV[100](0);
if Bdate == Bdate[1] and NextBarSdate == sDate Then //
{
vv[0] = V;
For cnt = 1 to 99
{
vv[cnt] = vv[cnt]+1;
}
}
HH = vv[0];
LL = vv[0];
If Index == 0 Then
{
고[1,1] = HH;
저[1,1] = LL;
}
Condition1 = Highest(HH,length) == HH and 최종고가 <> HH;
Condition2 = Lowest (LL,length) == LL and 최종저가 <> LL;
처리구분 = "";
If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생
{
If 최종꼭지점 == "저점" Then
{
If 저[1,1] > LL Then 처리구분 = "저점처리";
Else 처리구분 = "고점처리";
}
Else If 최종꼭지점 == "고점" Then
{
If 고[1,1] < HH Then 처리구분 = "고점처리";
Else 처리구분 = "저점처리";
}
}
Else If Condition1 Then 처리구분 = "고점처리";
Else If Condition2 Then 처리구분 = "저점처리";
#==========================================#
If 처리구분 == "고점처리" Then
{
T = 1;
최종고가 = HH; // 신규고점을 체크하기 위해 저장
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH;
고[1,2] = Index;
고[1,3] = sDate;
고[1,4] = sTime;
}
Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현
{
고[1,1] = HH;
고[1,2] = Index;
고[1,3] = sDate;
고[1,4] = sTime;
}
최종꼭지점 = "고점";
}
#==========================================#
If 처리구분 == "저점처리" Then
{
T = -1;
최종저가 = LL;
If 최종꼭지점 == "고점" then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL;
저[1,2] = Index;
저[1,3] = sDate;
저[1,4] = sTime;
If 저[1,1] > LL then
{
저[1,1] = LL;
저[1,2] = Index;
저[1,3] = sDate;
저[1,4] = sTime;
}
최종꼭지점 = "저점";
}
}
Plot1(vv[0]);
PLOT2(최종고가);
PLOT3(최종저가);
2024-03-18
966
글번호 177583
지표