첨부 이미지
그림1
* 항상 많은 도움에 고맙습니다.
* 자동 청산시 그림과 같은 경우가 발생 합니다.
1번 요청 사항 청산 기준 수식 좀 부탁 드립니다.
▶기준1: 진입후 20봉 경과후 최대수익이 "0"이고 손실이 30틱 이상이면 청산
▶기준2: 진입후 진입시 고가 보다 20틱 이상 이면 청산(매수,매도)
2번 청산 기준 수식 좀 부탁 드립니다.
▶기준3: 진입후 손실이 20틱 이상 발생 하면 스위칭(매수,매도)
▶기준4: 스위칭후 수익이 20틱 이상 발생 하면 청산
* 고맙습니다. 수고하십시요.
* 잘안되네요..
if MarketPosition == 1 Then {if MarketPosition== 1 and IsEntryName("SS2") == true and highest(H,BarsSinceEntry) > EntryPrice+PriceScale*30 Then ExitLong("SS2GOD2",AtStop,EntryPrice+PriceScale);}
## 스위칭
if MarketPosition == -1 Then {if MarketPosition== -1 and IsEntryName("DD1") == true and highest(H,BarsSinceEntry) > EntryPrice+PriceScale*30 Then buy("DD3CUT1SW",AtStop,EntryPrice+PriceScale*30);}
답변 1
예스스탁
예스스탁 답변
2020-05-12 11:32:15
안녕하세요
예스스탁입니다.
1
if MarketPosition == 1 Then
{
sell("bs",AtStop,EntryPrice-PriceScale*30);
ExitLong("bx2",AtStop,H[BarsSinceEntry]+PriceScale*20);
}
if MarketPosition == -1 Then
{
if Lowest(L,BarsSinceEntry) >= EntryPrice Then
ExitShort("sx1",AtStop,EntryPrice+PriceScale*30);
ExitShort("sx2",AtStop,L[BarsSinceEntry]-PriceScale*20);
}
2
if MarketPosition == 1 Then
{
sell("bs",AtStop,EntryPrice-PriceScale*20);
if IsEntryName("sb") == true Then
ExitLong("sbx",atlimit,EntryPrice+PriceScale*20);
}
if MarketPosition == -1 Then
{
buy("sb",AtStop,EntryPrice+PriceScale*20);
if IsEntryName("bs") == true Then
ExitShort("bsx",atlimit,EntryPrice-PriceScale*20);
}
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 청산 수식(수익,손실) 좀 요청 드립니다
> * 항상 많은 도움에 고맙습니다.
* 자동 청산시 그림과 같은 경우가 발생 합니다.
1번 요청 사항 청산 기준 수식 좀 부탁 드립니다.
▶기준1: 진입후 20봉 경과후 최대수익이 "0"이고 손실이 30틱 이상이면 청산
▶기준2: 진입후 진입시 고가 보다 20틱 이상 이면 청산(매수,매도)
2번 청산 기준 수식 좀 부탁 드립니다.
▶기준3: 진입후 손실이 20틱 이상 발생 하면 스위칭(매수,매도)
▶기준4: 스위칭후 수익이 20틱 이상 발생 하면 청산
* 고맙습니다. 수고하십시요.
* 잘안되네요..
if MarketPosition == 1 Then {if MarketPosition== 1 and IsEntryName("SS2") == true and highest(H,BarsSinceEntry) > EntryPrice+PriceScale*30 Then ExitLong("SS2GOD2",AtStop,EntryPrice+PriceScale);}
## 스위칭
if MarketPosition == -1 Then {if MarketPosition== -1 and IsEntryName("DD1") == true and highest(H,BarsSinceEntry) > EntryPrice+PriceScale*30 Then buy("DD3CUT1SW",AtStop,EntryPrice+PriceScale*30);}