커뮤니티
부탁드립니다
2016-12-19 13:54:51
95
글번호 105066
var : RR(0),tx(0);
var1 = ma(c,10);
var2 = ma(O,10);
var3 = min(var1,var2);
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and C > O and C > var1 Then
buy("b");
if MarketPosition == 1 Then{
exitlong("bx",AtStop,var3-PriceScale*0);
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*5));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H,NumToStr(RR*5,0)+"틱");
Text_SetStyle(tx,2,2);
}
}
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and C < O and C < var1 Then
sell("s");
if MarketPosition == -1 Then{
ExitShort("sx",AtStop,var3+PriceScale*0);
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*5));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H,NumToStr(RR*5,0)+"틱");
Text_SetStyle(tx,2,2);
}
}
위 수식에서 손절은 그냥 두고 익절 수식을 추가 하고 싶은데 가능한가요 매수 신호 진입 후 최대 수익 대비 30% 밀릴시 익절 청산 신호 또는 최대수익 대비 지정 틱수 밀릴시 청산 신호 부탁드립니다
답변 1
예스스탁 예스스탁 답변
2016-12-19 16:12:11
안녕하세요
예스스탁입니다.
input : X(5),Y(30);
var : RR(0),tx(0);
var1 = ma(c,10);
var2 = ma(O,10);
var3 = min(var1,var2);
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and C > O and C > var1 Then
buy("b");
if MarketPosition == 1 Then{
exitlong("bx",AtStop,var3-PriceScale*0);
#매수진입이후 최고가 대비 X틱 하락하면 청산
exitlong("btr1",AtStop,highest(H,BarsSinceEntry)-PriceScale*X);
#매수진입이후 최고가 대비 Y% 수익감소하면 청산
exitlong("btr2",AtStop,highest(H,BarsSinceEntry)-(highest(h,BarsSinceEntry)-EntryPrice)*(Y/100));
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*5));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H,NumToStr(RR*5,0)+"틱");
Text_SetStyle(tx,2,2);
}
}
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and C < O and C < var1 Then
sell("s");
if MarketPosition == -1 Then{
ExitShort("sx",AtStop,var3+PriceScale*0);
#매도진입이후 최저가 대비 X틱 하락하면 청산
ExitShort("str1",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*X);
#매도진입이후 최저가 대비 Y% 수익감소하면 청산
ExitShort("str2",AtStop,Lowest(L,BarsSinceEntry)+(EntryPrice-lowest(L,BarsSinceEntry))*(Y/100));
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*5));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H,NumToStr(RR*5,0)+"틱");
Text_SetStyle(tx,2,2);
}
}
즐거운 하루되세요
> 아이아띠 님이 쓴 글입니다.
> 제목 : 부탁드립니다
> var : RR(0),tx(0);
var1 = ma(c,10);
var2 = ma(O,10);
var3 = min(var1,var2);
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and C > O and C > var1 Then
buy("b");
if MarketPosition == 1 Then{
exitlong("bx",AtStop,var3-PriceScale*0);
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*5));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H,NumToStr(RR*5,0)+"틱");
Text_SetStyle(tx,2,2);
}
}
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and C < O and C < var1 Then
sell("s");
if MarketPosition == -1 Then{
ExitShort("sx",AtStop,var3+PriceScale*0);
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*5));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H,NumToStr(RR*5,0)+"틱");
Text_SetStyle(tx,2,2);
}
}
위 수식에서 손절은 그냥 두고 익절 수식을 추가 하고 싶은데 가능한가요 매수 신호 진입 후 최대 수익 대비 30% 밀릴시 익절 청산 신호 또는 최대수익 대비 지정 틱수 밀릴시 청산 신호 부탁드립니다
다음글