옵션 청산시 아래와 같이 수식을 넣었는데 청산이 안되는데
틀린부분이 어딜까요?
## 매수익절
if MarketPosition == 1 and EntryPrice<0.51 Then
SetStopProfittarget(400,PercentStop);
if MarketPosition == 1 and EntryPrice>0.5 and EntryPrice<1.01 Then
SetStopProfittarget(200,PercentStop);
if MarketPosition == 1 and EntryPrice>1 and EntryPrice<1.51 Then
SetStopProfittarget(300,PercentStop);
if MarketPosition == 1 and EntryPrice>1.5 and EntryPrice<2.01 Then
SetStopProfittarget(250,PercentStop);
if MarketPosition == 1 and EntryPrice>2 Then
SetStopProfittarget(200,PercentStop);
SetStopLoss(50,PercentStop);
if MarketPosition == 1 Then
SetStopProfittarget(530,PercentStop);
Else if MarketPosition == -1 Then
SetStopProfittarget(500,PercentStop);
SetStopEndofday(150000);
답변 3
예스스탁
예스스탁 답변
2024-02-07 15:33:46
안녕하세요
예스스탁입니다.
강제청산은 한번 셋팅이 되면 해당 설정이 유지되므로
지정한 포지션이나 조건이 아닌때는 해제하는 내용이 있어야 합니다.
또한 한번에 여러개 값으로 셋팅되지 않습니다.
오리신 내용에 가격별 목표수익청산과 단지 포지션에 따른 목표수익청산이 따로 있는데
2개를 모두 사용하실수는 없고 아래와 같이 택일해서 쓰셔야 합니다.
다른 부분은 수정해 드릴부분이 없습니다.
1번은 진입가에 따라 진입가 대비 +400%~+200%까지 수익이면 청산이고
2번은 매수포지션이면 530%, 매도포지션이면 500% 수익청산입니다.
1
if MarketPosition == 1 Then
{
if EntryPrice <= 0.5 Then
SetStopProfittarget(400,PercentStop);
else if EntryPrice > 0.5 and EntryPrice <= 1.00 Then
SetStopProfittarget(200,PercentStop);
else if EntryPrice > 1 and EntryPrice <= 1.50 Then
SetStopProfittarget(300,PercentStop);
else if EntryPrice > 1.5 and EntryPrice <= 2.0 Then
SetStopProfittarget(250,PercentStop);
else if EntryPrice > 2 Then
SetStopProfittarget(200,PercentStop);
}
Else #매수포지션 아니면 해제
SetStopProfittarget(0);#해제
SetStopLoss(50,PercentStop);
SetStopEndofday(150000);
2
if MarketPosition == 1 Then
SetStopProfittarget(530,PercentStop);
Else if MarketPosition == -1 Then
SetStopProfittarget(500,PercentStop);
Else
SetStopProfittarget(0);
즐거운 명절되세요
> 몸통공격 님이 쓴 글입니다.
> 제목 : 시스템 수식 부탁드립니다.
> 옵션 청산시 아래와 같이 수식을 넣었는데 청산이 안되는데
틀린부분이 어딜까요?
## 매수익절
if MarketPosition == 1 and EntryPrice<0.51 Then
SetStopProfittarget(400,PercentStop);
if MarketPosition == 1 and EntryPrice>0.5 and EntryPrice<1.01 Then
SetStopProfittarget(200,PercentStop);
if MarketPosition == 1 and EntryPrice>1 and EntryPrice<1.51 Then
SetStopProfittarget(300,PercentStop);
if MarketPosition == 1 and EntryPrice>1.5 and EntryPrice<2.01 Then
SetStopProfittarget(250,PercentStop);
if MarketPosition == 1 and EntryPrice>2 Then
SetStopProfittarget(200,PercentStop);
SetStopLoss(50,PercentStop);
if MarketPosition == 1 Then
SetStopProfittarget(530,PercentStop);
Else if MarketPosition == -1 Then
SetStopProfittarget(500,PercentStop);
SetStopEndofday(150000);
(질의내용: 1.매수익절은 진입단가에 따라서 수익율을 다르게 익절하고
2. 매도 익절은 진입단가에 상관없이 50% 수익시 익절하려고 하는데
알려주신대로 한 것 같은데 반영이 안되네요.)
--------------------------------------------------------------------------------------
## 매수익절
if MarketPosition == 1
{ EntryPrice<=0.51 Then
SetStopProfittarget(300,PercentStop);
else if EntryPrice>0.5 and EntryPrice<=1.00 Then
SetStopProfittarget(250,PercentStop);
else if EntryPrice>1 and EntryPrice<=1.50 Then
SetStopProfittarget(200,PercentStop);
else if EntryPrice>1.5 and EntryPrice<=2.00 Then
SetStopProfittarget(150,PercentStop);
else if EntryPrice>2 Then
SetStopProfittarget(100,PercentStop);
}
## 매도익절
Else if
SetStopProfittarget(50,PercentStop);
SetStopLoss(50,PercentStop);
SetStopEndofday(150000);
예스스탁
예스스탁 답변
2024-02-08 08:53:42
안녕하세요
예스스탁입니다.
매수포지션일때, 매도포지션일때, 아닐때(무포일때 초기화)
위와 같이 3가지 경우로 구분해 처리하시면 됩니다.
if MarketPosition == 1 Then
{
if EntryPrice<=0.51 Then
SetStopProfittarget(300,PercentStop);
else if EntryPrice>0.5 and EntryPrice<=1.00 Then
SetStopProfittarget(250,PercentStop);
else if EntryPrice>1 and EntryPrice<=1.50 Then
SetStopProfittarget(200,PercentStop);
else if EntryPrice>1.5 and EntryPrice<=2.00 Then
SetStopProfittarget(150,PercentStop);
else if EntryPrice>2 Then
SetStopProfittarget(100,PercentStop);
}
Else if MarketPosition == -1 Then
{
SetStopProfittarget(50,PercentStop);
}
Else
SetStopProfittarget(0);
SetStopLoss(50,PercentStop);
SetStopEndofday(150000);
즐거운 명절되세요
> 몸통공격 님이 쓴 글입니다.
> 제목 : Re : Re : 시스템 수식 부탁드립니다.
> (질의내용: 1.매수익절은 진입단가에 따라서 수익율을 다르게 익절하고
2. 매도 익절은 진입단가에 상관없이 50% 수익시 익절하려고 하는데
알려주신대로 한 것 같은데 반영이 안되네요.)
--------------------------------------------------------------------------------------
## 매수익절
if MarketPosition == 1
{ EntryPrice<=0.51 Then
SetStopProfittarget(300,PercentStop);
else if EntryPrice>0.5 and EntryPrice<=1.00 Then
SetStopProfittarget(250,PercentStop);
else if EntryPrice>1 and EntryPrice<=1.50 Then
SetStopProfittarget(200,PercentStop);
else if EntryPrice>1.5 and EntryPrice<=2.00 Then
SetStopProfittarget(150,PercentStop);
else if EntryPrice>2 Then
SetStopProfittarget(100,PercentStop);
}
## 매도익절
Else if
SetStopProfittarget(50,PercentStop);
SetStopLoss(50,PercentStop);
SetStopEndofday(150000);