기고글 토론 "윌리엄 간 메서드(1부): 간 각도 지표 생성하기" - 페이지 2

 
Vitaly Muzichenko #:

코스를 수강했는데 잘 풀리지 않는다면 - 그리고 논리적으로 풀리지 않는다면 - 행성 사이의 별을 올바르게 비교하지 않았다는 말을 듣게 될 것입니다.

당신은 요점을 놓치고 있습니다! 건이 어떻게 거래했는지 알아낸 사람은 누구에게도 가르치지 않을 것입니다. 그렇기 때문에 정보 집시의 모든 코스는 완전한 가짜입니다.

 
Bogard_11 #:

건이 어떻게 거래했는지 알아낸 사람은 누구에게도 가르쳐주지 않을 겁니다. 그렇기 때문에 정보 집시들이 제공하는 모든 강좌는 가짜에 불과합니다.

당신은 진실을 말하고 있습니다, 친애하는 :-)
 
건은 뛰어난 상인이자 점성가, 수비학자였으며 마법의 숫자를 믿었던 수학자였습니다. 제1차 세계대전과 제2차 세계대전의 시작과 끝을 예언한 위대한 점쟁이였습니다. 그는 수많은 제자를 두었지만 추종자들이 주장하듯이 자신의 전략을 누구에게도 알려주지 않았습니다. 엄청난 돈을 벌었고 그의 인생이 끝날 무렵에는 $ 100,000의 적당한 금액이 나왔습니다. 나는 Gunn의 천재적인 성격에 대한 다음 기사를 매우 흥미롭게 기대할 것입니다.
 
Eva-oren #:
건은 뛰어난 상인이자 점성가, 수비학자였으며 마법의 숫자를 믿었던 수학자였습니다. 제1차 세계대전과 제2차 세계대전의 시작과 끝을 예언한 위대한 점쟁이였습니다. 그는 수많은 제자를 두었지만 추종자들이 주장하듯이 자신의 전략을 누구에게도 알려주지 않았습니다. 엄청난 돈을 벌었고 그의 인생이 끝날 무렵에는 $ 100,000의 적당한 금액이 나왔습니다. 나는 Gunn의 천재적인 성격에 대한 다음 기사를 매우 흥미롭게 기대할 것입니다.

그 당시에는 드물었던 개인 제트기가 있었다는 사실을 잊었습니다. 그 당시 10만 달러는 지금으로 치면 10배는 아니더라도 적어도 1배는 되는 돈이죠.

추신 - 그는 전략을 전수했습니다. 그의 글에서. 누가 원했고, 전체 TC의 여러 장에서 수집했습니다. 건은 아무도 공짜로 얻을 수 없도록 모든 것을 흩어 놓았습니다.

 
Google에서 거래하는 방법 찾기

 
Ivan Butko #:
Google에서 거래 방법을 찾았습니다

두 번째 사진에서 - 원리를 이해하지 못합니다 :-(

 

사진을 보여드리겠습니다. 건을 이해하는 사람은 모서리 작업의 원리, 긴 입구를 찾을 위치와 롤오버 할 위치를 즉시 이해할 수 있습니다.


 
면책 조항 : 표시기에 대한 MQL5 프로그래밍 구문을 모릅니다.

그러나 각도 선 알고리즘이 옳지 않다고 생각합니다 (다른 소프트웨어에서 작성한 첨부 된 각도 선 표시기 참조). 다음은 DeepSeek와의 대화입니다 :

.
下面代码是通达信的代码,里面计算斜率的方法才是正确的,请阅读理解后,把上面priceShift 的计算方法改为下列代码正确的范式:

涨周期数:= IF(低点k位置 > 高点k位置, 低点k位置 - 高点k位置 + 1, 低点k位置), NODRAW;
跌周期数:= IF(高点k位置 > 低点k位置, 高点k位置 - 低点k位置 + 1, 高点k位置), NODRAW;

天线:= CONST(IF(高点k位置 = 1, H, REF(H, 高点k位置 - 1))), NODRAW;
地线:= CONST(IF(低点k位置 = 1, L, REF(L, 低点k位置 - 1))), NODRAW;

上涨天数:= IF(ISVALID(地线), BARSLAST(L = 地线), DRAWNULL), NODRAW;
下跌天数:= IF(ISVALID(天线), BARSLAST(H = 天线), DRAWNULL), NODRAW;

上涨高度:= IF(低点k位置 > 高点k位置, 天线 - 地线, HHV(H, 上涨天数) - 地线), NODRAW;
下跌高度:= IF(高点k位置 > 低点k位置, 天线 - 地线, 天线 - LLV(L, 下跌天数)), NODRAW;

上涨斜率:= IF(上涨天数 > 0, ROUND2(上涨高度 / 涨周期数, 4), 0), NODRAW;
下跌斜率:= IF(下跌天数 > 0, ROUND2(下跌高度 / 跌周期数, 4), 0), NODRAW;

그러나 DeepSeek는 저에게 적합하지 않은 수정 코드를 제공했습니다 :
//+------------------------------------------------------------------+
벤 팬 선 그리기 //| 벤 팬 선 그리기 & nbsp; |
//+------------------------------------------------------------------+
void DrawGannFan(double extremum, datetime extremumTime)
{
    // 간 각도와 해당 이름을 정의합니다.
    double angles[] = {82.5, 75, 71.25, 63.75, 45, 26.25, 18.75, 15, 7.5};
    string angleNames[] = {"1x8", "1x4", "1x3", "1x2", "1x1", "2x1", "3x1", "4x1", "8x1"};

    // 극한점에서 현재 K-선까지의 마침표 개수를 구합니다.
    int extremumBar = iBarShift(_Symbol, PERIOD_CURRENT, extremumTime);
    int currentBar = 0; // 현재 K-라인은 0입니다.
    int barDiff = currentBar - extremumBar; // 사이클 번호 차이
    
    // 가격 높이 차이 계산
    double priceDiff;
    if(isTrendUp)
    {
        // 상승 추세: 극저점에서 현재 최고 가격까지의 높이를 계산합니다.
        double currentHigh = iHigh(_Symbol, PERIOD_CURRENT, 0);
        priceDiff = currentHigh - extremum;
    }
    else
    {
        // 하락 추세: 최고가부터 현재 최저가까지의 높이를 계산합니다.
        double currentLow = iLow(_Symbol, PERIOD_CURRENT, 0);
        priceDiff = extremum - currentLow;
    }
    
    // 기본 기울기(1x1 선의 기울기)를 계산합니다.
    double baseSlope = (barDiff > 0) ? priceDiff / barDiff : 0;
    
    // 각 각도에 대한 섹터 라인 그리기
    for(int i = 0; i < ArraySize(angles); i++)
    {
        string label = "GannFan_" + angleNames[i];  // 개체 레이블
        double angle = angles[i];                  // 현재 각도
        
        // 각도에 따라 기울기 배수를 계산합니다.
        double slopeMultiplier = MathTan(angle * M_PI / 180.0) / MathTan(45 * M_PI / 180.0);
        
        가격 상쇄 계산(기본 기울기 및 각도 승수 기준) // 가격 상쇄 계산하기
        double priceShift = baseSlope * barDiff * slopeMultiplier * _Point;
        double endPrice;
        
        // 추세 방향에 따른 종가 계산
        if(isTrendUp)
        {
            endPrice = extremum + priceShift;
        }
        else
        {
            endPrice = extremum - priceShift;
            angle = -angle; // 하락 추세의 반전 각도
        }

        // 추세선 개체 만들기
        if(ObjectCreate(0, label, OBJ_TREND, 0, extremumTime, extremum, TimeCurrent(), endPrice))
        {
            // 추세선 속성 설정
            ObjectSetInteger(0, label, OBJPROP_COLOR, GannFanColor);
            ObjectSetInteger(0, label, OBJPROP_STYLE, STYLE_SOLID);
            ObjectSetInteger(0, label, OBJPROP_WIDTH, 1);
            ObjectSetInteger(0, label, OBJPROP_RAY_RIGHT, true);
            ObjectSetString(0, label, OBJPROP_TOOLTIP, "Gann Fan " + angleNames[i]);
        }
        else
        {
            Print("Failed to create Gann Fan line: ", GetLastError());
        }
    }
}

//+------------------------------------------------------------------+
//|| 리버스 갠 팬 라인 그리기 및 &nbsp; &nbsp ; ||
//+------------------------------------------------------------------+
void DrawOppositeGannFan(double extremum, datetime extremumTime)
{
    // 간 각도와 해당 이름을 정의합니다.
    double angles[] = {82.5, 75, 71.25, 63.75, 45, 26.25, 18.75, 15, 7.5};
    string angleNames[] = {"1x8", "1x4", "1x3", "1x2", "1x1", "2x1", "3x1", "4x1", "8x1"};

    // 극한점에서 현재 K-선까지의 마침표 개수를 구합니다.
    int extremumBar = iBarShift(_Symbol, PERIOD_CURRENT, extremumTime);
    int currentBar = 0; // 현재 K-라인은 0입니다.
    int barDiff = currentBar - extremumBar; // 사이클 번호 차이
    
    // 가격 높이 차이 계산
    double priceDiff;
    if(!isTrendUp)
    {
        // 역추세(상승): 극저점에서 현재 최고가까지의 높이를 계산합니다.
        double currentHigh = iHigh(_Symbol, PERIOD_CURRENT, 0);
        priceDiff = currentHigh - extremum;
    }
    else
    {
        // 역추세(하락): 최고가부터 현재 최저가까지의 높이를 계산합니다.
        double currentLow = iLow(_Symbol, PERIOD_CURRENT, 0);
        priceDiff = extremum - currentLow;
    }
    
    // 기본 기울기(1x1 선의 기울기)를 계산합니다.
    double baseSlope = (barDiff > 0) ? priceDiff / barDiff : 0;
    
    // 각 각도에 대한 섹터 라인 그리기
    for(int i = 0; i < ArraySize(angles); i++)
    {
        string label = "OppositeGannFan_" + angleNames[i];  // 개체 레이블
        double angle = angles[i];                          // 현재 각도
        
        // 각도에 따라 기울기 배수를 계산합니다.
        double slopeMultiplier = MathTan(angle * M_PI / 180.0) / MathTan(45 * M_PI / 180.0);
        
        가격 상쇄 계산(기본 기울기 및 각도 승수 기준) // 가격 상쇄 계산하기
        double priceShift = baseSlope * barDiff * slopeMultiplier * _Point;
        double endPrice;
        
        // 역추세 방향에 따른 종가 계산
        if(!isTrendUp)
        {
            endPrice = extremum + priceShift;
        }
        else
        {
            endPrice = extremum - priceShift;
            angle = -angle; // 하락 추세의 반전 각도
        }

        // 추세선 개체 만들기
        if(ObjectCreate(0, label, OBJ_TREND, 0, extremumTime, extremum, TimeCurrent(), endPrice))
        {
            // 추세선 속성 설정
            ObjectSetInteger(0, label, OBJPROP_COLOR, GannFanColor);
            ObjectSetInteger(0, label, OBJPROP_STYLE, STYLE_SOLID);
            ObjectSetInteger(0, label, OBJPROP_WIDTH, 1);
            ObjectSetInteger(0, label, OBJPROP_RAY_RIGHT, true);
            ObjectSetString(0, label, OBJPROP_TOOLTIP, "Opposite Gann Fan " + angleNames[i]);
        }
        else
        {
            Print("Failed to create Opposite Gann Fan line: ", GetLastError());
        }
    }
}





결국, 저는 DeepSeek에 소스 코드를 수정해달라고 요청해야 했습니다(잘 작동하고 자동으로 선을 그립니다):
#property copyright "Copyright 2024, Evgeniy Shtenco"  // 저작권 정보
#property link      "https://www.mql5.com/en/users/koshtenko"  // 작성자 링크
#property version   "1.00"  // 표시기 버전 번호
#property indicator_chart_window  // 지표가 차트 창에 표시됩니다.

// 입력 매개변수
input int LookBackBars = 300;      // 다시 분석된 K-라인 수
input color GannFanColor = clrBlue; // 본의 팬 라인 색상

// 전역 변수
double extremumPrice;        // 익스트림 포인트 가격
datetime extremumTime;       // 익스트림 포인트 시간
double oppositeExtremumPrice; // 익스트림 포인트 가격 역전
datetime oppositeExtremumTime; // 역극성 포인트 시간
bool isTrendUp;              // 추세 방향 플래그(상승 추세의 경우 참)

//+------------------------------------------------------------------+
//| 사용자 지정 인디케이터 초기화 함수 및 &nbsp; &nbsp ; ||
//+------------------------------------------------------------------+
int OnInit()
{
    return (INIT_SUCCEEDED);  // 초기화 성공
}

//+------------------------------------------------------------------+
//| 사용자 지정 인디케이터 초기화 함수 및 &nbsp; &nbsp ; ||
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
    {
        // 모든 Gann 섹터 객체 삭제
        ObjectsDeleteAll(0, "GannFan_");
ObjectsDeleteAll(0, "OppositeGannFan_");
}

//+------------------------------------------------------------------+
//| 사용자 지정 지표 계산 함수 및 &nbsp; &nbsp ; | | | | | | | |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,          // 현재 주기 수
const int prev_calculated,      // 이전에 계산된 주기 수
const datetime & time[],         // 시간 배열
                const double & open[],          // 시초가 배열
                const double & high[],           // 최고 가격 배열
                const double & low[],            // 최저가 배열
                const double & close[],         // 종가 배열
                const long & tick_volume[],      // 볼륨 배열
                const long & volume[],           // 실제 볼륨 배열
                const int & spread[])            // 포인트 스프레드 배열
{
    if (rates_total < LookBackBars) return (0);  // 데이터가 충분하지 않으면 반환

    // 이전에 그린 개체 지우기
    if (prev_calculated == 0) {
        ObjectsDeleteAll(0, "GannFan_");
        ObjectsDeleteAll(0, "OppositeGannFan_");
    }

    // 마지막 300개의 K 라인에서 극한점 찾기
    FindExtremums(rates_total, high, low, time);

    // 벤 부채꼴 선 그리기
    DrawGannFan(extremumPrice, extremumTime);
    DrawOppositeGannFan(oppositeExtremumPrice, oppositeExtremumTime);

    return (rates_total);  // 처리된 총 열 수를 반환합니다.
}

//+------------------------------------------------------------------+
//| 지정된 수의 K 선 내에서 극한점을 찾습니다. |
//+------------------------------------------------------------------+
void FindExtremums(const int rates_total, const double & high[], const double & low[], const datetime & time[])
{
    int startIndex = rates_total - LookBackBars;  // 인덱싱 시작(300K 라인 전)
    int endIndex = rates_total - 1;               // 끝 인덱스(최신 K-라인)

    // 최고점과 최저점 찾기
    int highestIndex = ArrayMaximum(high, startIndex, LookBackBars);
    int lowestIndex = ArrayMinimum(low, startIndex, LookBackBars);

    // 추세의 방향 결정(고점과 저점의 타이밍 비교)
    if (time[highestIndex] > time[lowestIndex]) {
        // 가장 높은 지점이 가장 낮은 지점 이후인 경우 하락 추세
        extremumPrice = high[highestIndex];
        extremumTime = time[highestIndex];
        oppositeExtremumPrice = low[lowestIndex];
        oppositeExtremumTime = time[lowestIndex];
        isTrendUp = false;
    }
    else {
        // 그렇지 않으면 상승 추세
        extremumPrice = low[lowestIndex];
        extremumTime = time[lowestIndex];
        oppositeExtremumPrice = high[highestIndex];
        oppositeExtremumTime = time[highestIndex];
        isTrendUp = true;
    }
}

//+------------------------------------------------------------------+
벤 팬 선 그리기 //| 벤 팬 선 그리기 & nbsp; |
//+------------------------------------------------------------------+
void DrawGannFan(double extremum, datetime extremumTime)
{
    // 간 각도와 해당 이름을 정의합니다.
    double angles[] = { 82.5, 75, 71.25, 63.75, 45, 26.25, 18.75, 15, 7.5};
    string angleNames[] = { "1x8", "1x4", "1x3", "1x2", "1x1", "2x1", "3x1", "4x1", "8x1"};

    // 섹터 라인의 종료 시간 계산(현재 시간 + 300주기)
    datetime endTime = TimeCurrent();  // 현재 시간을 종료 시간으로 사용

    // 각 각도에 대한 섹터 라인 그리기
    for (int i = 0; i < ArraySize(angles); i++)
    {
        string label = "GannFan_" + angleNames[i];  // 개체 레이블
        double angle = angles[i];                  // 현재 각도

        // 가격 상쇄 계산(시차 기준)
        double secondsDiff = endTime - extremumTime;
        double priceShift = MathTan(angle * M_PI / 180.0) * secondsDiff / PeriodSeconds();
        double endPrice;

        // 추세 방향에 따른 종가 계산
        if (isTrendUp) {
            endPrice = extremum + priceShift;
        }
        else {
            endPrice = extremum - priceShift;
            angle = -angle; // 하락 추세의 반전 각도
        }

        // 추세선 개체 만들기
        if (ObjectCreate(0, label, OBJ_TREND, 0, extremumTime, extremum, endTime, endPrice)) {
            // 추세선 속성 설정
            ObjectSetInteger(0, label, OBJPROP_COLOR, GannFanColor);
            ObjectSetInteger(0, label, OBJPROP_STYLE, STYLE_SOLID);
            ObjectSetInteger(0, label, OBJPROP_WIDTH, 1);
            ObjectSetInteger(0, label, OBJPROP_RAY_RIGHT, true);
            ObjectSetString(0, label, OBJPROP_TOOLTIP, "Gann Fan " + angleNames[i]);
        }
        else {
            Print("Failed to create Gann Fan line: ", GetLastError());
        }
    }
}

//+------------------------------------------------------------------+
//|| 리버스 갠 팬 라인 그리기 및 &nbsp; &nbsp ; ||
//+------------------------------------------------------------------+
void DrawOppositeGannFan(double extremum, datetime extremumTime)
{
    // 간 각도와 해당 이름을 정의합니다.
    double angles[] = { 82.5, 75, 71.25, 63.75, 45, 26.25, 18.75, 15, 7.5};
    string angleNames[] = { "1x8", "1x4", "1x3", "1x2", "1x1", "2x1", "3x1", "4x1", "8x1"};

    // 섹터 라인의 종료 시간(현재 시간)을 계산합니다.
    datetime endTime = TimeCurrent();

    // 각 각도에 대한 섹터 라인 그리기
    for (int i = 0; i < ArraySize(angles); i++)
    {
        string label = "OppositeGannFan_" + angleNames[i];  // 개체 레이블
        double angle = angles[i];                          // 현재 각도

        // 가격 상쇄 계산(시차 기준)
        double secondsDiff = endTime - extremumTime;
        double priceShift = MathTan(angle * M_PI / 180.0) * secondsDiff / PeriodSeconds();
        double endPrice;

        // 반대 추세의 방향에 따라 종가 계산
        if (!isTrendUp) // 역추세
        {
            endPrice = extremum + priceShift;
        }
        else {
            endPrice = extremum - priceShift;
            angle = -angle; // 하락 추세의 반전 각도
        }

        // 추세선 개체 만들기
        if (ObjectCreate(0, label, OBJ_TREND, 0, extremumTime, extremum, endTime, endPrice)) {
            // 추세선 속성 설정
            ObjectSetInteger(0, label, OBJPROP_COLOR, GannFanColor);
            ObjectSetInteger(0, label, OBJPROP_STYLE, STYLE_SOLID);
            ObjectSetInteger(0, label, OBJPROP_WIDTH, 1);
            ObjectSetInteger(0, label, OBJPROP_RAY_RIGHT, true);
            ObjectSetString(0, label, OBJPROP_TOOLTIP, "Opposite Gann Fan " + angleNames[i]);
        }
        else {
            Print("Failed to create Opposite Gann Fan line: ", GetLastError());
        }
    }
}

//+------------------------------------------------------------------+
//| 차트 이벤트 핸들러 함수 &nbsp nbsp; & & nbsp; |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,                  // 이벤트 ID
const long & lparam,            // 긴 정수 매개변수
                  const double & dparam,          // 배정밀도 매개변수
                  const string & sparam)         // 문자열 매개변수
{
    // 차트 변경 시 개체 다시 그리기
    if (id == CHARTEVENT_CHART_CHANGE || id == CHARTEVENT_CLICK) {
        // 극단을 다시 찾아 벤 팬 라인을 그립니다.
        int rates_total = Bars(_Symbol, PERIOD_CURRENT);
        double high[], low[];
        datetime time[];
        ArraySetAsSeries(high, true);
        ArraySetAsSeries(low, true);
        ArraySetAsSeries(time, true);
        CopyHigh(_Symbol, PERIOD_CURRENT, 0, rates_total, high);
        CopyLow(_Symbol, PERIOD_CURRENT, 0, rates_total, low);
        CopyTime(_Symbol, PERIOD_CURRENT, 0, rates_total, time);

        FindExtremums(rates_total, high, low, time);
        DrawGannFan(extremumPrice, extremumTime);
        DrawOppositeGannFan(oppositeExtremumPrice, oppositeExtremumTime);
    }
}
파일: