커뮤니티

안녕하세요

프로필 이미지
뚜벅뚜벅
2018-10-17 22:01:49
136
글번호 122769
답변완료
수고하십니다. 아래 수식에서 신호를 (반듯이) rsi 침채 이탈후 매수신호 과열 이탈후 매도신호 나올수 있도록 구현해주십시요. 그 외에 신호는 안 나오게게 해주십시오. 매수매도 신호가 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),T1(0),T2(0),T3(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 > var3[1] Then T2 = 1; if var3 < var3[1] Then T2 = -1; if var4 > var4[1] Then T3 = 1; if var4 < var4[1] Then T3 = -1; # 매수 If var3 > var3[1] Then Buy("b"); # 매도 If var3 < var3[1] Then Sell ("s"); SetStopEndofday(1610);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-10-18 13:56:09

안녕하세요 예스스탁입니다. input: PeriodRSI(14); // Indicator period input: StepSizeFast(5); // Fast step input: StepSizeSlow(15); // Slow step input : 침체(30), 과열(70); var: fmin(9999),fmax(-9999); var: smin(9999),smax(-9999); var: ftrend(1),strend(1); var: RSI0(0),T1(0),T2(0),T3(0),S(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 > var3[1] Then T2 = 1; if var3 < var3[1] Then T2 = -1; if var4 > var4[1] Then T3 = 1; if var4 < var4[1] Then T3 = -1; If CrossUP(RSI0, 과열) Then S = 1; If CrossDown(RSI0, 과열) Then S = 11; If CrossDown(RSI0, 침체) Then S = -1; If CrossUp(RSI0, 침체) Then S = -11; # 매수 If S == -11 and var3 > var3[1] Then Buy("b"); # 매도 If S == 11 and var3 < var3[1] Then Sell ("s"); SetStopEndofday(1610); 즐거운 하루되세요 > 뚜벅뚜벅 님이 쓴 글입니다. > 제목 : 안녕하세요 > 수고하십니다. 아래 수식에서 신호를 (반듯이) rsi 침채 이탈후 매수신호 과열 이탈후 매도신호 나올수 있도록 구현해주십시요. 그 외에 신호는 안 나오게게 해주십시오. 매수매도 신호가 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),T1(0),T2(0),T3(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 > var3[1] Then T2 = 1; if var3 < var3[1] Then T2 = -1; if var4 > var4[1] Then T3 = 1; if var4 < var4[1] Then T3 = -1; # 매수 If var3 > var3[1] Then Buy("b"); # 매도 If var3 < var3[1] Then Sell ("s"); SetStopEndofday(1610);