커뮤니티
이렇게 하는게 맞는건가요?
2011-05-03 11:25:43
652
글번호 38237
if C < O and
value1 == 1 And
countif(H > var1)
Sell("s",AtLimit,C+PriceScale)
SetStopLoss(PriceScale*L2,PointStop);
if marketposition()==1 then{
hvalue=highest(h,barssinceentry+1);
exitlong("trailstop_el",atstop,hvalue-tsvalue);
if highest(H,BarsSinceEntry)>=EntryPrice+0.5 Then
ExitLong("bx",AtStop,EntryPrice-0.3);
}
if MarketPosition()==-1 then {
lvalue=lowest(l,barssinceentry+1);
exitshort("trailstop_es",atstop,lvalue+tsvalue);
if Lowest(L,BarsSinceEntry)<=EntryPrice-0.5 Then
ExitShort("sx",AtStop,EntryPrice+0.3);
답변 1
예스스탁 예스스탁 답변
2011-05-03 11:51:00
안녕하세요
예스스탁입니다.
청산식 모두 올바르게 작성하셨습니다.
다른부분에 문법 오류가 있으니 수정하시기 바랍니다.
ccountif는 최근 N개봉안에 조건이 몇번 만족했는지를 계산하는 함수입니다.
countif(H > var1,10) >= 1로 처리했으므로 의도에 맞게 수정하시기 바랍니다.
input : L2(10),TSvalue(0.5);
var : Hvalue(0),Lvalue(0);
if C < O and value1 == 1 And countif(H > var1,10) >= 1 Then
Sell("s",AtLimit,C+PriceScale);
SetStopLoss(PriceScale*L2,PointStop);
if marketposition()==1 then{
hvalue=highest(h,barssinceentry+1);
exitlong("trailstop_el",atstop,hvalue-tsvalue);
if hvalue >= EntryPrice+0.5 Then
ExitLong("bx",AtStop,EntryPrice-0.3);
}
if MarketPosition()==-1 then {
lvalue=lowest(l,barssinceentry+1);
exitshort("trailstop_es",atstop,lvalue+tsvalue);
if lvalue<=EntryPrice-0.5 Then
ExitShort("sx",AtStop,EntryPrice+0.3);
}
즐거운 하루되세요
> 족구마왕 님이 쓴 글입니다.
> 제목 : 이렇게 하는게 맞는건가요?
> if C < O and
value1 == 1 And
countif(H > var1)
Sell("s",AtLimit,C+PriceScale)
SetStopLoss(PriceScale*L2,PointStop);
if marketposition()==1 then{
hvalue=highest(h,barssinceentry+1);
exitlong("trailstop_el",atstop,hvalue-tsvalue);
if highest(H,BarsSinceEntry)>=EntryPrice+0.5 Then
ExitLong("bx",AtStop,EntryPrice-0.3);
}
if MarketPosition()==-1 then {
lvalue=lowest(l,barssinceentry+1);
exitshort("trailstop_es",atstop,lvalue+tsvalue);
if Lowest(L,BarsSinceEntry)<=EntryPrice-0.5 Then
ExitShort("sx",AtStop,EntryPrice+0.3);
다음글