예스스탁
예스스탁 답변
2020-02-25 11:16:13
안녕하세요
예스스탁입니다.
input : 손실틱(100);
if MarketPosition == 1 then
{
BuySetup = false;
if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and
CCIv < CCI값 and C < O Then
ExitLong("매수cci청산"); # CCI청산
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1"); # 수익청산
if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then
ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3); # 본전
Else
{
if L <= EntryPrice-PriceScale*즉시손절1 Then
ExitLong("즉시손절1",AtStop,L-PriceScale*저점손절틱수); # 손절
}
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then
ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락); # tr청산
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*손실틱 Then
ExitLong("tr2",atlimit,EntryPrice);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*손실틱 and CCIv >= 200 Then
ExitLong("tr2");
}
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 매수청산 수식에서 추가 기능 부여 부탁드리겠습니다.
> 아래 수식에서 다음과 같은 기능을 부여부탁드림니다.
1번
매수진입된 상태에서 -100틱(변수설정) 하락한후 매수진입가격도달시 청산 하는 수식을 추가로 넣어주세요~~
if MarketPosition == 1 then
{
BuySetup = false;
if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and
CCIv < CCI값 and C < O Then
ExitLong("매수cci청산"); # CCI청산
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1"); # 수익청산
if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then
ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3); # 본전
Else
{
if L <= EntryPrice-PriceScale*즉시손절1 Then
ExitLong("즉시손절1",AtStop,L-PriceScale*저점손절틱수); # 손절
}
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then
ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락); # tr청산
}
===========================================================================
2번
매수진입된 상태에서 -100틱(변수설정) 하락한후 CCI값(기간20) > 200 이상 일때 청산 하는 수식을 추가로 넣어주세요~~
if MarketPosition == 1 then
{
BuySetup = false;
if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and
CCIv < CCI값 and C < O Then
ExitLong("매수cci청산"); # CCI청산
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1"); # 수익청산
if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then
ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3); # 본전
Else
{
if L <= EntryPrice-PriceScale*즉시손절1 Then
ExitLong("즉시손절1",AtStop,L-PriceScale*저점손절틱수); # 손절
}
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then
ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락); # tr청산
}
===========================================================================