답변완료
피보나치 사선 제거
Input : AF(0.02), AFMAX(0.2),pt(1);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0);
var : box(0);
if Index == 0 or (Bdate != Bdate[1]) Then
{
Direction = 0;
SAR_Value = C;
AF_Value = 0.02;
HighValue = H;
LowValue = L;
EP = 0;
}
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = low;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = High;
}
}
CSarv = SAR_Value;
}
else
{
if SAR_Value != 0 && EP == 0 then
{
if Direction == 1 then
{
EP = HighValue;
AF_Value = AF;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
else
{
EP = LowValue;
AF_Value = Af;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
CSarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if Close > Close[1] then Direction = 1;
else
if Close < Close[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if Close < Close[1] then
{
Direction = -1;
SAR_Value = HighValue;
CSarv = SAR_Value;
}
}
if Direction == -1 then
{
if Close > Close[1] then
{
Direction = 1;
SAR_Value = LowValue;
CSarv = SAR_Value;
}
}
}
LowValue = min(Low, LowValue);
HighValue = max(High, HighValue);
}
}
if Bdate != Bdate[1] Then
Condition1 = False;
if CrossUp(c,CSarv) Then
Condition1 = False;
if CrossDown(c,CSarv) Then
{
if CSarv <= DayHigh-pt Then
{
Condition1 = true;
var1 = CSarv;
Var2 = (DayHigh-var1)/618;
var3 = DayHigh-Var2*1000;
Var4 = var1-(DayHigh-var1);
}
}
Plot1(CSarv);
if Condition1 == true Then
{
if C < CSarv Then
{
plot2(Var3);
plot3(Var3-PriceScale);
}
Else
{
NoPlot(2);
NoPlot(3);
}
if C < CSarv Then
{
plot4(Var4);
plot5(Var4-PriceScale);
}
Else
{
NoPlot(4);
NoPlot(5);
}
}
Else
{
NoPlot(2);
NoPlot(3);
NoPlot(4);
NoPlot(5);
}
일자그래프에 색 채우기를 하면 직전 출력 부분과 연결되어 사선이 생기는데,사선을 없애는 방법이 있는지요?
안되면 전일은 무시하고 당일만 출력되게 수정 부탁합니다.
2022-08-17
1301
글번호 161566
지표
답변완료
함수요청
안녕하세요?
글번호 78483번 재질문입니다.
글번호 77970번에서 작성주신 스크립트
var : T(0),S(0),mav(0);
mav = ma(c,20);
if Bdate != Bdate[1] Then
{
T = 0;
S = 0;
if L[1] > mav[1] and H < mav Then
Sell("s",AtMarket);
if H[1] < mav[1] and L > mav Then
Buy("b",AtMarket);
}
if MarketPosition == -1 Then
{
if CrossUp(c,mav) Then
ExitShort("sx",AtMarket);
if L < DayLow(0)[1] and L[1] != DayLow(0)[1] Then
{
var1 = var1+1;
if var1 == 3 Then
ExitShort("sx1");
}
}
Else
var1 = 0;
if MarketPosition == 1 Then
{
if CrossDown(c,mav) Then
ExitLong("bx",AtMarket);
if H > DayHigh(0)[1] and H[1] != DayHigh(0)[1] Then
{
var2 = var2+1;
if var2 == 3 Then
ExitLong("bx1");
}
}
Else
Var2 = 0;
SetStopEndofday(151500);
에 글번호 78483번 2번에서 작성 주신 함수를 적용하여 스크립트로 작성 요청드립니다.
2
만약 MACD오실레이터 조건은 첫봉에서만 조건을 체크하는게 아니면
아래와 같이 진입식 변경하시면 됩니다.
if Bdate != Bdate[1] Then
{
T = 0;
if L[1] > mav[1] and H < mav Then
T = -1;
if H[1] < mav[1] and L > mav Then
T = 1;
}
if T == -1 and MACDO > 0 and MACDO < MACDO[1] Then
Sell("s",AtMarket);
if T == 1 and MACDO < 0 and MACDO > MACDO[1] Then
Buy("b",AtMarket);
2022-08-17
1205
글번호 161564
시스템
답변완료
BB
안녕하세요~~
지표가 동일한것을 확인하였으나 시스템식으로 만들면 오차가 납니다
If CountIF(c < BBBot, Bars) == Bars Then buy
If (c[2] < Bot2 && c[1] < Bot1) and (c[1] < Bot1 && c[0] < Bot) Then buy
아래 지표 적용해 보시면
모든 봉에서 지표값이 동일한 것을 확인하실수 있습니다.
input : Length(20), stdDev(2), Bars(3);
var : BBTop(0),BBBot(0),Top(0), Bot(0), Top1(0), Bot1(0), Top2(0), Bot2(0);
BBTop = BollBandup(Length, StdDev);
BBBot = BollBanddown(Length, StdDev);
If CountIF(c < BBBot, Bars) == Bars Then
var1 = 1;
Else
Var1 = 0;
Top = BollBandup(Length, StdDev);
Bot = BollBanddown(Length, StdDev);
Top1 = BollBandup(Length, StdDev)[1];
Bot1 = BollBanddown(Length, StdDev)[1];
Top2 = BollBandup(Length, StdDev)[2];
Bot2 = BollBanddown(Length, StdDev)[2];
If (c[2] < Bot2 && c[1] < Bot1) and (c[1] < Bot1 && c[0] < Bot) Then
value1 = 1;
Else
value1 = 0;
Plot1(var1);
plot2(Value1);
2022-08-17
1428
글번호 161553
시스템