커뮤니티
문의 드립니다.
2015-06-19 15:16:40
127
글번호 87423
1. 해당 지표를 시스템화 해주세요.
(fast metro > slow metro 일 때 매수,
fast metro < slow metro 일 때 매도)
input: PeriodRSI(14); // Indicator period
input: StepSizeFast(5); // Fast step
input: StepSizeSlow(15); // Slow step
var: fmin(9999),fmax(-9999);
var: smin(9999),smax(-9999);
var: ftrend(1),strend(1);
var: RSI0(0);
//---- restore values of the variables
RSI0=RSI(PeriodRSI);
fmax=RSI0+2*StepSizeFast;
fmin=RSI0-2*StepSizeFast;
if(RSI0>fmax[1]) then ftrend=1;
if(RSI0<fmin[1]) then ftrend=-1;
if(ftrend>0 && fmin<fmin[1]) then fmin=fmin[1];
if(ftrend<0 && fmax>fmax[1]) then fmax=fmax[1];
smax=RSI0+2*StepSizeSlow;
smin=RSI0-2*StepSizeSlow;
if(RSI0>smax[1]) then strend=1;
if(RSI0<smin[1]) then strend=-1;
if(strend>0 && smin<smin[1]) then smin=smin[1];
if(strend<0 && smax>smax[1]) then smax=smax[1];
if(ftrend>0) then var3=fmin+StepSizeFast;
if(ftrend<0) then var3=fmax-StepSizeFast;
if(strend>0) then var4=smin+StepSizeSlow;
if(strend<0) then var4=smax-StepSizeSlow;
감사합니다.
답변 1
예스스탁 예스스탁 답변
2015-06-19 16:10:30
안녕하세요
예스스탁입니다.
올려주신 내용에서 fast metro와 slow metro가 어떤 변수인지 모르겠습니다.
가장하단에 있는 var3을 fast metro, var4를 slow metro로 보고 작성했습니다.
input: PeriodRSI(14); // Indicator period
input: StepSizeFast(5); // Fast step
input: StepSizeSlow(15); // Slow step
var: fmin(9999),fmax(-9999);
var: smin(9999),smax(-9999);
var: ftrend(1),strend(1);
var: RSI0(0);
//---- restore values of the variables
RSI0=RSI(PeriodRSI);
fmax=RSI0+2*StepSizeFast;
fmin=RSI0-2*StepSizeFast;
if(RSI0>fmax[1]) then ftrend=1;
if(RSI0<fmin[1]) then ftrend=-1;
if(ftrend>0 && fmin<fmin[1]) then fmin=fmin[1];
if(ftrend<0 && fmax>fmax[1]) then fmax=fmax[1];
smax=RSI0+2*StepSizeSlow;
smin=RSI0-2*StepSizeSlow;
if(RSI0>smax[1]) then strend=1;
if(RSI0<smin[1]) then strend=-1;
if(strend>0 && smin<smin[1]) then smin=smin[1];
if(strend<0 && smax>smax[1]) then smax=smax[1];
if(ftrend>0) then var3=fmin+StepSizeFast;
if(ftrend<0) then var3=fmax-StepSizeFast;
if(strend>0) then var4=smin+StepSizeSlow;
if(strend<0) then var4=smax-StepSizeSlow;
if var3 > var4 Then
buy();
if var3 < var4 Then
sell();
즐거운 하루되세요
> 브런치 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 1. 해당 지표를 시스템화 해주세요.
(fast metro > slow metro 일 때 매수,
fast metro < slow metro 일 때 매도)
input: PeriodRSI(14); // Indicator period
input: StepSizeFast(5); // Fast step
input: StepSizeSlow(15); // Slow step
var: fmin(9999),fmax(-9999);
var: smin(9999),smax(-9999);
var: ftrend(1),strend(1);
var: RSI0(0);
//---- restore values of the variables
RSI0=RSI(PeriodRSI);
fmax=RSI0+2*StepSizeFast;
fmin=RSI0-2*StepSizeFast;
if(RSI0>fmax[1]) then ftrend=1;
if(RSI0<fmin[1]) then ftrend=-1;
if(ftrend>0 && fmin<fmin[1]) then fmin=fmin[1];
if(ftrend<0 && fmax>fmax[1]) then fmax=fmax[1];
smax=RSI0+2*StepSizeSlow;
smin=RSI0-2*StepSizeSlow;
if(RSI0>smax[1]) then strend=1;
if(RSI0<smin[1]) then strend=-1;
if(strend>0 && smin<smin[1]) then smin=smin[1];
if(strend<0 && smax>smax[1]) then smax=smax[1];
if(ftrend>0) then var3=fmin+StepSizeFast;
if(ftrend<0) then var3=fmax-StepSizeFast;
if(strend>0) then var4=smin+StepSizeSlow;
if(strend<0) then var4=smax-StepSizeSlow;
감사합니다.
다음글
이전글