커뮤니티
수식부탁 드립니다.
2010-08-25 11:55:18
792
글번호 31840
1.
선물 분(틱)봉
파라볼릭지표
종가청산
매일 시가부터 신호 다시 그려서 최초신호부터 진입
2.
선물 분(틱)봉
파라볼릭지표
갭보정
종가청산
전일신호방향 그대로 시가진입
수고스럽게 해드려 죄송합니다.
좋은 하루 되세요.
답변 1
예스스탁 예스스탁 답변
2010-08-25 17:35:17
안녕하세요
예스스탁입니다.
1. 매일 시가부터 파라볼릭을 다시 계산하여 신호발생하는 식입니다.
Input : AF(0.02), AFMAX(0.2);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),Sarv(0);
if dayindex == 0 Then{
Direction = 0;
Sar_value = C;
AF_value = 0.02;
EP = 0;
HighValue = H;
Lowvalue = L;
Sarv = 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 Low < 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 High > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = High;
}
}
Sarv = 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;
}
}
Sarv = 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;
Sarv = SAR_Value;
}
}
if Direction == -1 then
{
if Close > Close[1] then
{
Direction = 1;
SAR_Value = LowValue;
Sarv = SAR_Value;
}
}
}
LowValue = min(Low, LowValue);
HighValue = max(High, HighValue);
}
}
if crossup(c,sarv) Then
buy();
if CrossDown(c,sarv) Then
sell();
setstopendofday(150000);
2.
Input : AF(0.02), AFMAX(0.2);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),Sarv(0);
var : sumGap(0), gap(0), GO(0), GH(0), GL(0), GC(0);
if date!=date[1] then { // 날짜가 변경되는 봉에서
gap = Open-Close[1]; // 일간갭
sumGap = sumGap+gap; // 일간갭 누적
}
GO = O - sumGap; // 시가에서 갭누적값을 차감
GH = H - sumGap; // 고가에서 갭누적값을 차감
GL = L - sumGap; // 저가에서 갭누적값을 차감
GC = C - sumGap; // 종가에서 갭누적값을 차감
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if GH > HighValue then
{
HighValue = GH;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if GL < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = Gl;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if GL < LowValue then
{
LowValue = gL;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if GH > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = GH;
}
}
Sarv = 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 GH > HighValue then
{
HighValue = GH;
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 GL < LowValue then
{
LowValue = GL;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
Sarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if GC > GC[1] then Direction = 1;
else
if GC < GC[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if GC < GC[1] then
{
Direction = -1;
SAR_Value = HighValue;
Sarv = SAR_Value;
}
}
if Direction == -1 then
{
if GC > GC[1] then
{
Direction = 1;
SAR_Value = LowValue;
Sarv = SAR_Value;
}
}
}
LowValue = min(GL, LowValue);
HighValue = max(GH, HighValue);
}
}
if stime == 151500 and MarketPosition == 0 Then{
if MarketPosition(1) == 1 Then
buy("b",atmarket);
if MarketPosition(1) == -1 Then
sell("s",AtMarket);
}
if crossup(gc,sarv) Then
buy();
if CrossDown(gc,sarv) Then
sell();
setstopendofday(150000);
즐거운 하루되세요
> 아침못 님이 쓴 글입니다.
> 제목 : 수식부탁 드립니다.
> 1.
선물 분(틱)봉
파라볼릭지표
종가청산
매일 시가부터 신호 다시 그려서 최초신호부터 진입
2.
선물 분(틱)봉
파라볼릭지표
갭보정
종가청산
전일신호방향 그대로 시가진입
수고스럽게 해드려 죄송합니다.
좋은 하루 되세요.
다음글
이전글