커뮤니티
질문드립니다.
2017-02-13 14:24:27
104
글번호 106776
안녕하세요? 도움요청 드립니다.
아래와 같은 시스템식에는 현재 TS가 없어서
TS를변수로 되게끔 추가하려고 합니다.
시스템식 수정 부탁드립니다.
//ver2.
Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000);
Variable : ent_position(0);
if MarketPosition == 0 Then{
var1 = 0;
ent_position = 0;
}
//If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then {
If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 Then {
Buy("매수",AtMarket);
Var1 = NextBarOpen;
ent_position = 1;
}
//If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then {
If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 Then {
Sell("매도",AtMarket);
Var1 = NextBarOpen;
ent_position = -1;
}
if PositionProfit >= profit_pt and ent_position<>0 Then{
if ent_position == 1 and C<O Then {
ExitLong("매수청산");
}
if ent_position == -1 and C>O Then {
ExitLong("매도청산");
}
}
SetStopLoss(loss_pt,PointStop);
SetStopEndofday(장종료청산);
답변 1
예스스탁 예스스탁 답변
2017-02-13 16:47:12
안녕하세요
예스스탁입니다.
Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000);
input : 최소수익(1.0),수익감소(0.5);
Variable : ent_position(0);
if MarketPosition == 0 Then{
var1 = 0;
ent_position = 0;
}
//If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then {
If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 Then {
Buy("매수",AtMarket);
Var1 = NextBarOpen;
ent_position = 1;
}
//If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then {
If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 Then {
Sell("매도",AtMarket);
Var1 = NextBarOpen;
ent_position = -1;
}
if PositionProfit >= profit_pt and ent_position<>0 Then{
if ent_position == 1 and C<O Then {
ExitLong("매수청산");
}
if ent_position == -1 and C>O Then {
ExitLong("매도청산");
}
}
#1포인트 이상 수익이후에 0.5수익감소하면 청산
if MarketPosition == 1 then{
if highest(H,BarsSinceEntry) >= EntryPrice+최소수익 Then
exitlong("매수TS청산",AtStop,highest(H,BarsSinceEntry)-수익감소);
}
if MarketPosition == -1 then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-최소수익 Then
ExitShort("매도TS청산",AtStop,Lowest(L,BarsSinceEntry)+수익감소);
}
SetStopLoss(loss_pt,PointStop);
SetStopEndofday(장종료청산);
즐거운 하루되세요
> 달성공 님이 쓴 글입니다.
> 제목 : 질문드립니다.
> 안녕하세요? 도움요청 드립니다.
아래와 같은 시스템식에는 현재 TS가 없어서
TS를변수로 되게끔 추가하려고 합니다.
시스템식 수정 부탁드립니다.
//ver2.
Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000);
Variable : ent_position(0);
if MarketPosition == 0 Then{
var1 = 0;
ent_position = 0;
}
//If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then {
If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 Then {
Buy("매수",AtMarket);
Var1 = NextBarOpen;
ent_position = 1;
}
//If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then {
If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 Then {
Sell("매도",AtMarket);
Var1 = NextBarOpen;
ent_position = -1;
}
if PositionProfit >= profit_pt and ent_position<>0 Then{
if ent_position == 1 and C<O Then {
ExitLong("매수청산");
}
if ent_position == -1 and C>O Then {
ExitLong("매도청산");
}
}
SetStopLoss(loss_pt,PointStop);
SetStopEndofday(장종료청산);