커뮤니티
청산수식 확인 요청 드립니다.(2건)
2019-02-07 07:37:17
199
글번호 125886
* 많은 도움에 고맙습니다.
.질문1) 본전에 오면 청신이 되야 하는데 외 청산이 안되는거죠?
A로직, B로직 모두 안먹히는데 외그런거죠??? 지도 요청 드립니다.
* A로직
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+15 Then ExitLong("bx",AtStop,EntryPrice);
if MarketPosition == -1 and highest(H,BarsSinceEntry) >= EntryPrice+15 Then ExitShort("cx",AtStop,EntryPrice);
* B로직
if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) == EntryPrice+PriceScale*70 Then ExitLong("B본4",AtStop,AvgEntryPrice+PriceScale*50); }
if MarketPosition == -1 Then { if highest(H,BarsSinceEntry) == EntryPrice+PriceScale*70 Then ExitShort("s본4",AtStop,AvgEntryPrice+PriceScale*50); }
.질문2) 특정 매매 이름별 청산 금액 틀리게 적용하는 로직 좀 알려주십시요.
즉 if MarketPosition == 1 and CrossUp(var73,var72) Then Sell("도도");
if MarketPosition == -1 and CrossUp(var71,var74) Then buy("수수");
이경우
"도도" 라는 이름의 매도는 10틱 수익 이면 청산
"수수" 라는 이름의 매수는 20틱 손실 이면 청산
명칭에 따라 다르게 청산 설정 금액을 지정하고 싶습니다.
* 고맙습니다. 좋은 하루 되십시요^^
- 1. 본전청산_안됨.png (0.42 MB)
답변 1
예스스탁 예스스탁 답변
2019-02-07 12:45:18
안녕하세요
예스스탁입니다.
1
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+15 Then ExitLong"bx",AtStop,EntryPrice);
if MarketPosition == -1 and highest(H,BarsSinceEntry) >= EntryPrice+15 Then ExitShort("cx",AtStop,EntryPrice);
A로직의 매도쪽 청산내용이 잘못되어 있습니다.
매수청산은 진입가 대비 15포인트 이상 상승후 진입가까지 하락하면 청산
매도청산은 진입가 대비 15포인트 이상 상승후 진입가까지 이상이면 청산입니다.
매도청산은 진입가 대비 15포인트 이하로 하락후 진입가까지 상승하면 청산으로 변경하셔야 합니다.
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-15 Then ExitShort("cx",AtStop,EntryPrice);
또한 지금 단순 가격으로 15포인트 수익달성이 되어야 합니다. 15틱이면 아래와 같이 변경하셔야 합니다.
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*15 Then ExitLong"bx",AtStop,EntryPrice);
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*15 Then ExitShort("cx",AtStop,EntryPrice);
2
B로직은 아래와 같이 변경하셔야 합니다.
수익이 정확히 70틱이어야지만 발생합니다. 70틱이상으로 지정하셔야 합니다.
if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*70 Then ExitLong("B본4",AtStop,AvgEntryPrice+PriceScale*50); }
if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*70 Then ExitShort("s본4",AtStop,AvgEntryPrice+PriceScale*50); }
3
if MarketPosition == 1 and IsEntryName("수수") == true then
{
ExitLong("bx",AtStop,EntryPrice-PriceScale*20);
}
if MarketPosition == -1 and IsEntryName("도도") == true then
{
ExitShort("sx",AtStop,EntryPrice+PriceScale*10);
}
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 청산수식 확인 요청 드립니다.(2건)
> * 많은 도움에 고맙습니다.
.질문1) 본전에 오면 청신이 되야 하는데 외 청산이 안되는거죠?
A로직, B로직 모두 안먹히는데 외그런거죠??? 지도 요청 드립니다.
* A로직
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+15 Then ExitLong("bx",AtStop,EntryPrice);
if MarketPosition == -1 and highest(H,BarsSinceEntry) >= EntryPrice+15 Then ExitShort("cx",AtStop,EntryPrice);
* B로직
if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) == EntryPrice+PriceScale*70 Then ExitLong("B본4",AtStop,AvgEntryPrice+PriceScale*50); }
if MarketPosition == -1 Then { if highest(H,BarsSinceEntry) == EntryPrice+PriceScale*70 Then ExitShort("s본4",AtStop,AvgEntryPrice+PriceScale*50); }
.질문2) 특정 매매 이름별 청산 금액 틀리게 적용하는 로직 좀 알려주십시요.
즉 if MarketPosition == 1 and CrossUp(var73,var72) Then Sell("도도");
if MarketPosition == -1 and CrossUp(var71,var74) Then buy("수수");
이경우
"도도" 라는 이름의 매도는 10틱 수익 이면 청산
"수수" 라는 이름의 매수는 20틱 손실 이면 청산
명칭에 따라 다르게 청산 설정 금액을 지정하고 싶습니다.
* 고맙습니다. 좋은 하루 되십시요^^
다음글
이전글