커뮤니티
시스템정정 rsi로부탁드림니다,
2015-10-27 03:23:06
217
글번호 91730
input : P(20),N(20),Short(12),long(26),sig(9);
var : HH(0),LL(0),MACDV(0),MACDS(0);
var : Hi(0),Li(0),TT(0),Vol(0);
HH = highest(H,P);
LL = highest(H,L);
MACDV = MACD(Short,long);
MACDS = ema(MACDV,Sig);
if TT <= 0 and crossup(C,HH[1]) Then{
TT = 1;
Hi = index;
}
if TT >= 0 and CrossDown(C,LL[1]) Then{
TT = -1;
Li = index;
}
if TT == 1 and index <= Hi+N and crossup(MACDV,MACDS) Then{
if (MarketPosition == 0 and PositionProfit(1) < 0) then
Vol = MaxContracts(1)*2;
else if (MarketPosition != 0 and PositionProfit < 0) Then
Vol = MaxContracts*2;
Else
Vol = 1;
if (MarketPosition == 0 and MarketPosition(1) != 1) or
MarketPosition == -1 Then
buy("b",OnClose,def,vol);
}
if TT == -1 and index <= Li+N and CrossDown(MACDV,MACDS) Then{
if (MarketPosition == 0 and PositionProfit(1) < 0) then
Vol = MaxContracts(1)*2;
else if (MarketPosition != 0 and PositionProfit < 0) Then
Vol = MaxContracts*2;
Else
Vol = 1;
if (MarketPosition == 0 and MarketPosition(1) != -1) or
MarketPosition == 1 Then
sell("s",OnClose,def,Vol);
}
---------------------------------------------------------------------------------
전에 문의드린 작성해주신수신인데요
macd 를 rsi 로바꾸고 싶습니다
20개봉중에 최고최저점을 종가로 이탈하고나서 20개봉안에 rsi 과열 과매도 입니다
사용자지정 손절매나 목표수익시 다음반대신호에 진입만허용입니다,
익손절을 해놓으면 무작위진입하는것같아여 그림보내드림니다,
수고하세요
- 1. dPtmtmxkr.gif (0.01 MB)
답변 1
예스스탁 예스스탁 답변
2015-10-27 13:37:59
안녕하세요
예스스탁입니다.
식을 수정했습니다.
RSI 30 상향돌파 매수, 70 하향이탈 매도로 작성했습니다.
input : P(20),N(20),Period(10);
var : HH(0),LL(0),RSIV(0);
var : Hi(0),Li(0),TT(0),Vol(0);
HH = highest(H,P);
LL = lowest(L,P);
RSIV = RSI(Period);
if TT <= 0 and crossup(C,HH[1]) Then{
TT = 1;
Hi = index;
}
if TT >= 0 and CrossDown(C,LL[1]) Then{
TT = -1;
Li = index;
}
if TT == 1 and index <= Hi+N and crossup(RSIV,30) Then{
if (MarketPosition == 0 and MarketPosition(1) != 1) or MarketPosition == -1 Then
{
if (MarketPosition == 0 and PositionProfit(1) < 0) then
Vol = vol*2;
else if (MarketPosition != 0 and PositionProfit < 0) Then
Vol = vol*2;
Else
Vol = 1;
buy("b",OnClose,def,vol);
}
}
if TT == -1 and index <= Li+N and CrossDown(RSIV,70) Then{
if (MarketPosition == 0 and MarketPosition(1) != -1) or MarketPosition == 1 Then {
if (MarketPosition == 0 and PositionProfit(1) < 0) then
Vol = vol*2;
else if (MarketPosition != 0 and PositionProfit < 0) Then
Vol = vol*2;
Else
Vol = 1;
sell("s",OnClose,def,Vol);
}
}
즐거운 하루되세요
> 끝까지가보죠 님이 쓴 글입니다.
> 제목 : 시스템정정 rsi로부탁드림니다,
> input : P(20),N(20),Short(12),long(26),sig(9);
var : HH(0),LL(0),MACDV(0),MACDS(0);
var : Hi(0),Li(0),TT(0),Vol(0);
HH = highest(H,P);
LL = highest(H,L);
MACDV = MACD(Short,long);
MACDS = ema(MACDV,Sig);
if TT <= 0 and crossup(C,HH[1]) Then{
TT = 1;
Hi = index;
}
if TT >= 0 and CrossDown(C,LL[1]) Then{
TT = -1;
Li = index;
}
if TT == 1 and index <= Hi+N and crossup(MACDV,MACDS) Then{
if (MarketPosition == 0 and PositionProfit(1) < 0) then
Vol = MaxContracts(1)*2;
else if (MarketPosition != 0 and PositionProfit < 0) Then
Vol = MaxContracts*2;
Else
Vol = 1;
if (MarketPosition == 0 and MarketPosition(1) != 1) or
MarketPosition == -1 Then
buy("b",OnClose,def,vol);
}
if TT == -1 and index <= Li+N and CrossDown(MACDV,MACDS) Then{
if (MarketPosition == 0 and PositionProfit(1) < 0) then
Vol = MaxContracts(1)*2;
else if (MarketPosition != 0 and PositionProfit < 0) Then
Vol = MaxContracts*2;
Else
Vol = 1;
if (MarketPosition == 0 and MarketPosition(1) != -1) or
MarketPosition == 1 Then
sell("s",OnClose,def,Vol);
}
---------------------------------------------------------------------------------
전에 문의드린 작성해주신수신인데요
macd 를 rsi 로바꾸고 싶습니다
20개봉중에 최고최저점을 종가로 이탈하고나서 20개봉안에 rsi 과열 과매도 입니다
사용자지정 손절매나 목표수익시 다음반대신호에 진입만허용입니다,
익손절을 해놓으면 무작위진입하는것같아여 그림보내드림니다,
수고하세요