커뮤니티
19398 번에서요
2011-06-30 01:25:45
645
글번호 40336
/*1.제가 착각한것 같습니다 ㅏ
2.메시지로그 를 찍어보니 전혀 다른 가격들이 나와서 cross down 이 작동할수 없더라 구요
3. 진입후 이익이 줄면서 전체 이익의 1/2 부근에 도달하면 청산할려고 한건데
이런식도 가능할까요?
*/
if marketposition == 1 then
{
if H == Highest(H, barssinceentry) then
var1 = c;
if crossdown (H,var1) and crossdown(c, positionprofit*1/2)then
exitlong("",AtStop,EntryPrice+t);
}
- 1. 제가 착각한것 같습니다.gif (0.04 MB)
답변 1
예스스탁 예스스탁 답변
2011-06-30 13:38:07
안녕하세요
예스스탁입니다.
진입이후 이익이 최고이익에서 절반 감소하면 청산은 아래와 같습니다.
if marketposition == 1 then
ExitLong("",AtStop,Highest(H, barssinceentry)-(Highest(H, barssinceentry)-EntryPrice)/2);
if marketposition == -1 then
ExitShort("",AtStop,Lowest(L, barssinceentry)-(EntryPrice-Lowest(L,BarsSinceEntry))/2);
즐거운 하루되세요
> 기초부터다시 님이 쓴 글입니다.
> 제목 : 19398 번에서요
> /*1.제가 착각한것 같습니다 ㅏ
2.메시지로그 를 찍어보니 전혀 다른 가격들이 나와서 cross down 이 작동할수 없더라 구요
3. 진입후 이익이 줄면서 전체 이익의 1/2 부근에 도달하면 청산할려고 한건데
이런식도 가능할까요?
*/
if marketposition == 1 then
{
if H == Highest(H, barssinceentry) then
var1 = c;
if crossdown (H,var1) and crossdown(c, positionprofit*1/2)then
exitlong("",AtStop,EntryPrice+t);
}
이전글