커뮤니티
시스템 합성관련 문의
2017-07-14 12:58:40
171
글번호 111314
안녕하세요.
무더운 여름 고생이 많으시네요
제가 도움을 구하고자 하는것은 두 가지 시스템을 합성을 하려다보니 첨부된 파일과 같이
"연산자 앞뒤 두데이터의 형태가 같아야 합니다" 라는 문구가 뜨는데 어떻게 하는지 몰라서 문의 드립니다.
시스템#1================================================================================
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : P(20);
Var: value(0), HH(0), LL(0), HHH(0), LLL(0), FK(0);
HHH = highest(H,P);
LLL = lowest(L,P);
FK = (C-LLL) / (HHH-LLL) * 100;
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
# 매수/매도청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and crossup(FK,80) Then
{
Buy();
}
# 매도/매수청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(FK,20) Then
{
Sell();
}
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
시스템#2 ==========================================================================
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : Period1(50), Period2(10), Period3(5), sigPeriod(9), FastMovAvg(12), SlowMovAvg(26), MACDMovAvg(9);
Var: CCIv(0), CCIsig(0), HH(0), LL(0), XMACD(0);
CCIv = CCI(Period1);
CCIsig = ema(CCIv,Period2);
value1 = TRIX(Period3);
value2 = ema(value1, sigPeriod);
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossUp(CCIv, 0) and (CrossUP(value1, value2) or Crossup(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Buy();
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(CCIv, 0) and (CrossDown(value1, value2) or CrossDown(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Sell();
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
수고하세요....
- 1. 111857_캡처.PNG (0.02 MB)
답변 1
예스스탁 예스스탁 답변
2017-07-14 15:54:31
안녕하세요
예스스탁입니다.
합성관리자에서
condition1~condition99에 변수타입에 대한 오류가 있는것 같습니다.
아래와 같이 선언문에
선언을 추가해 주시면 됩니다.
해당 부분은 관련팀에 전달해 수정하도록 하겠습니다.
1.
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : P(20);
Var: value(0), HH(0), LL(0), HHH(0), LLL(0), FK(0),Condition3(false);
HHH = highest(H,P);
LLL = lowest(L,P);
FK = (C-LLL) / (HHH-LLL) * 100;
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
# 매수/매도청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and crossup(FK,80) Then
{
Buy();
}
# 매도/매수청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(FK,20) Then
{
Sell();
}
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
2
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : Period1(50), Period2(10), Period3(5), sigPeriod(9), FastMovAvg(12), SlowMovAvg(26), MACDMovAvg(9);
Var: CCIv(0), CCIsig(0), HH(0), LL(0), XMACD(0),Condition3(false);
CCIv = CCI(Period1);
CCIsig = ema(CCIv,Period2);
value1 = TRIX(Period3);
value2 = ema(value1, sigPeriod);
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossUp(CCIv, 0) and (CrossUP(value1, value2) or Crossup(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Buy();
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(CCIv, 0) and (CrossDown(value1, value2) or CrossDown(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Sell();
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 시스템 합성관련 문의
> 안녕하세요.
무더운 여름 고생이 많으시네요
제가 도움을 구하고자 하는것은 두 가지 시스템을 합성을 하려다보니 첨부된 파일과 같이
"연산자 앞뒤 두데이터의 형태가 같아야 합니다" 라는 문구가 뜨는데 어떻게 하는지 몰라서 문의 드립니다.
시스템#1================================================================================
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : P(20);
Var: value(0), HH(0), LL(0), HHH(0), LLL(0), FK(0);
HHH = highest(H,P);
LLL = lowest(L,P);
FK = (C-LLL) / (HHH-LLL) * 100;
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
# 매수/매도청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and crossup(FK,80) Then
{
Buy();
}
# 매도/매수청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(FK,20) Then
{
Sell();
}
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
시스템#2 ==========================================================================
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : Period1(50), Period2(10), Period3(5), sigPeriod(9), FastMovAvg(12), SlowMovAvg(26), MACDMovAvg(9);
Var: CCIv(0), CCIsig(0), HH(0), LL(0), XMACD(0);
CCIv = CCI(Period1);
CCIsig = ema(CCIv,Period2);
value1 = TRIX(Period3);
value2 = ema(value1, sigPeriod);
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossUp(CCIv, 0) and (CrossUP(value1, value2) or Crossup(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Buy();
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(CCIv, 0) and (CrossDown(value1, value2) or CrossDown(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Sell();
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
수고하세요....