커뮤니티
문의드립니다
안녕하세요?
1.아래수식이 콤파일이 안되는데 도와주세요
Input : Period(20);
Input : 상승색1(Pink), 상승색2(Magenta), 상승색3(Red);
Input : 하락색1(LightBlue), 하락색2(Cyan), 하락색3(Blue);
Var : DParity(0), clr(0);
Var : AlertFlag_101(False), AlertFlag_99(False);
Var : txtID101(0), txtID99(0);
//--------------------------------------
// 이격도 계산
//--------------------------------------
DParity = Disparity(Period);
//--------------------------------------
// 색상 지정
//--------------------------------------
If DParity >= 100 and DParity < 100.5 Then
clr = 상승색1;
Else If DParity >= 100.5 and DParity < 101 Then
clr = 상승색2;
Else If DParity >= 101 Then
clr = 상승색3;
Else If DParity < 100 and DParity > 99.5 Then
clr = 하락색1;
Else If DParity <= 99.5 and DParity > 99 Then
clr = 하락색2;
Else
clr = 하락색3;
//--------------------------------------
// 기준선 표시
//--------------------------------------
Plot1(DParity, "이격도", clr);
PlotBaseLine1(101.0, "101.0");
PlotBaseLine2(100.5, "100.5");
PlotBaseLine3(100.0, "기준선");
PlotBaseLine4(99.5, "99.5");
PlotBaseLine5(99.0, "99.0");
//--------------------------------------
// 알림 + 시각 표시 (핸들 저장 방식)
//--------------------------------------
// 101 상향 돌파
If DParity >= 101 and AlertFlag_101 = False Then Begin
PlaySound("C:\WRFutures\YesGlobalPro\data\Sound\이격도 101 상방돌파.wav");
Alert("이격도 101선 상향 돌파!");
txtID101 = Text_New_Self(Date, Time, DParity + 0.3, "▲101돌파");
Text_SetColor(txtID101, 상승색3);
AlertFlag_101 = True;
End
Else If DParity < 101 Then
AlertFlag_101 = False;
// 99 하향 돌파
If DParity <= 99 and AlertFlag_99 = False Then Begin
PlaySound("C:\WRFutures\YesGlobalPro\data\Sound\이격도 99 하방돌파.wav");
Alert("이격도 99선 하향 돌파!");
txtID99 = Text_New_Self(Date, Time, DParity - 0.3, "▼99이탈");
Text_SetColor(txtID99, 하락색3);
AlertFlag_99 = True;
End
Else If DParity > 99 Then
AlertFlag_99 = False;
2.아래수식은콤파일은되는데 아무신호도발생하지않습니다
Input : fractalPeriods(2);
Vars : disp20(0);
// 20일 이격도 계산
disp20 = Close / Average(Close, 20) * 100;
// ------------------------
// 매수 조건
// ------------------------
If disp20 < 90 Then
Begin
If SwingLow(1, Low, fractalPeriods, fractalPeriods, fractalPeriods*2+1) <> -1 Then
Buy ("FractalBuy");
End;
// ------------------------
// 매도 조건
// ------------------------
If disp20 > 110 Then
Begin
If SwingHigh(1, High, fractalPeriods, fractalPeriods, fractalPeriods*2+1) <> -1 Then
Sell ("FractalSell");
End;
감사합니다
- 1. 2025-10-19 09;40;44.PNG (0.01 MB)