커뮤니티
부탁드립니다
2015-03-04 14:52:23
164
글번호 83693
부탁드립니다.
제가 초보라 문의드립니다.
제가 초보라 수정부탁합니다.
분할청산시 매도 청산은 정상적인데
매수 청산은 뭔가 이상합니다.
첨부파일 같이 첫번노랑색 부분에서 청산이 안되고 왜 뒤노랑색 부분에서
되는지와 2개약만 되었는지요
rsi외 다른시스템도 비슷한 현상 입니다.
프로그램 수정부탁합니다.
Input : Period(14), LPercent(30), SPercent(70);
Var : value(0);
value = RSI(Period);
# 매수/매도청산
If CrossUP(value, LPercent) Then
{
Buy();
if MarketPosition == 1 Then{
exitlong("bx1",AtLimit,EntryPrice+pricescale*10,"",1,1);
ExitLong("bx2",AtLimit,EntryPrice+pricescale*30,"",1,1);
ExitLong("bx3",AtLimit,EntryPrice+PriceScale*80,"",1,1);
ExitLong("bx4",AtLimit,EntryPrice+PriceScale*100,"",1,1);
If CrossDown(value, SPercent) Then
Sell();
ExitLong("bx5",OnClose,def,"",0,0);
}}
# 매도/매수청산
If CrossDown(value, SPercent) Then
{
Sell();
}
if MarketPosition == -1 Then{
ExitShort("sx1",AtLimit,EntryPrice+PriceScale*-10,"",1,1);
ExitShort("sx2",AtLimit,EntryPrice+PriceScale*-20,"",1,1);
ExitShort("sx3",AtLimit,EntryPrice+PriceScale*-40,"",1,1);
ExitShort("sx4",AtLimit,EntryPrice+PriceScale*-60,"",1,1);
If CrossUP(value, LPercent) Then{
Buy();
ExitShort("sx5",OnClose,def,"",0,0);
}}
- 1. 84194_chart.jpg (0.11 MB)
답변 1
예스스탁 예스스탁 답변
2015-03-04 17:46:15
안녕하세요
예스스탁입니다.
Input : Period(14), LPercent(30), SPercent(70);
Var : value(0);
value = RSI(Period);
# 매수/매도청산
If CrossUP(value, LPercent) Then
{
Buy();
if MarketPosition == 1 Then
{
exitlong("bx1",AtLimit,EntryPrice+pricescale*10,"",1,1);
ExitLong("bx2",AtLimit,EntryPrice+pricescale*30,"",1,1);
ExitLong("bx3",AtLimit,EntryPrice+PriceScale*80,"",1,1);
ExitLong("bx4",AtLimit,EntryPrice+PriceScale*100,"",1,1);
If CrossDown(value, SPercent) Then
Sell();
ExitLong("bx5",OnClose,def,"",0,0);
}
}
# 매도/매수청산
If CrossDown(value, SPercent) Then
{
Sell();
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtLimit,EntryPrice+PriceScale*-10,"",1,1);
ExitShort("sx2",AtLimit,EntryPrice+PriceScale*-20,"",1,1);
ExitShort("sx3",AtLimit,EntryPrice+PriceScale*-40,"",1,1);
ExitShort("sx4",AtLimit,EntryPrice+PriceScale*-60,"",1,1);
If CrossUP(value, LPercent) Then
{
Buy();
ExitShort("sx5",OnClose,def,"",0,0);
}
}
매수와 매도쪽의 괄호{} 부분 살펴보시기 바랍니다.
IF문의 연결이 서로 달라 청산의 내용이 다르게 됩니다.
매도쪽이 정상적으로 괄호가 지정되어 있습니다.
아래와 같이 {} 치기를 하셔야 합니다.
Input : Period(14), LPercent(30), SPercent(70);
Var : value(0);
value = RSI(Period);
# 매수/매도청산
If CrossUP(value, LPercent) Then
{
Buy();
}
if MarketPosition == 1 Then
{
exitlong("bx1",AtLimit,EntryPrice+pricescale*10,"",1,1);
ExitLong("bx2",AtLimit,EntryPrice+pricescale*30,"",1,1);
ExitLong("bx3",AtLimit,EntryPrice+PriceScale*80,"",1,1);
ExitLong("bx4",AtLimit,EntryPrice+PriceScale*100,"",1,1);
If CrossDown(value, SPercent) Then
{
Sell();
ExitLong("bx5",OnClose,def,"",0,0);
}
}
# 매도/매수청산
If CrossDown(value, SPercent) Then
{
Sell();
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtLimit,EntryPrice+PriceScale*-10,"",1,1);
ExitShort("sx2",AtLimit,EntryPrice+PriceScale*-20,"",1,1);
ExitShort("sx3",AtLimit,EntryPrice+PriceScale*-40,"",1,1);
ExitShort("sx4",AtLimit,EntryPrice+PriceScale*-60,"",1,1);
If CrossUP(value, LPercent) Then
{
Buy();
ExitShort("sx5",OnClose,def,"",0,0);
}
}
즐거운 하루되세요
> YG_ks**** 님이 쓴 글입니다.
> 제목 : 부탁드립니다
> 부탁드립니다.
제가 초보라 문의드립니다.
제가 초보라 수정부탁합니다.
분할청산시 매도 청산은 정상적인데
매수 청산은 뭔가 이상합니다.
첨부파일 같이 첫번노랑색 부분에서 청산이 안되고 왜 뒤노랑색 부분에서
되는지와 2개약만 되었는지요
rsi외 다른시스템도 비슷한 현상 입니다.
프로그램 수정부탁합니다.
Input : Period(14), LPercent(30), SPercent(70);
Var : value(0);
value = RSI(Period);
# 매수/매도청산
If CrossUP(value, LPercent) Then
{
Buy();
if MarketPosition == 1 Then{
exitlong("bx1",AtLimit,EntryPrice+pricescale*10,"",1,1);
ExitLong("bx2",AtLimit,EntryPrice+pricescale*30,"",1,1);
ExitLong("bx3",AtLimit,EntryPrice+PriceScale*80,"",1,1);
ExitLong("bx4",AtLimit,EntryPrice+PriceScale*100,"",1,1);
If CrossDown(value, SPercent) Then
Sell();
ExitLong("bx5",OnClose,def,"",0,0);
}}
# 매도/매수청산
If CrossDown(value, SPercent) Then
{
Sell();
}
if MarketPosition == -1 Then{
ExitShort("sx1",AtLimit,EntryPrice+PriceScale*-10,"",1,1);
ExitShort("sx2",AtLimit,EntryPrice+PriceScale*-20,"",1,1);
ExitShort("sx3",AtLimit,EntryPrice+PriceScale*-40,"",1,1);
ExitShort("sx4",AtLimit,EntryPrice+PriceScale*-60,"",1,1);
If CrossUP(value, LPercent) Then{
Buy();
ExitShort("sx5",OnClose,def,"",0,0);
}}