커뮤니티
이익실현
2011-06-22 10:32:00
552
글번호 40008
안녕하세요
1.
식에서 SetStopTrailing(0.05,0.5포인트에서~ 최고2포인트 이익실현표현식)은 어떻게되는지요
2.매수후 매도신호시 (즉1개약진입후 다음 매도매수 신호시 청산만되지 다시 매도진입이 안되네요).
If (stime > 91000 and stime < 113000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if BarsSinceExit(1) > 1 then {
if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) and MarketPosition == 0 Then
buy("매수");
if MarketPosition == 1 Then
sell("반대매도",AtStop,L[BarsSinceEntry]-0.3-PriceScale);
if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("매도");
if MarketPosition == -1 Then
buy("반대매수",AtStop,H[BarsSinceEntry]+0.7+PriceScale);
}
}
답변 1
예스스탁 예스스탁 답변
2011-06-22 15:01:07
안녕하세요
예스스탁입니다.
1.
풀어서 작성하셔야 합니다.
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+0.5 and highest(H,BarsSinceEntry) <= EntryPrice+2.0 Then
exitlong("bx",AtStop,Highest(H,BarsSinceEntry)-0.05);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-0.5 and Lowest(L,BarsSinceEntry) >= EntryPrice-2.0 Then
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)+0.05);
}
2.
반대방향 진입식이
if BarsSinceExit(1) > 1 then {
와 같이 묶여 있어 청산후에나 발동하게 되어 있었습니다.
따로 분리해야 합니다.
If (stime > 91000 and stime < 113000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if BarsSinceExit(1) > 1 then {
if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) and MarketPosition == 0 Then
buy("매수");
if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("매도");
}
if MarketPosition == 1 Then
sell("반대매도",AtStop,L[BarsSinceEntry]-0.3-PriceScale);
if MarketPosition == -1 Then
buy("반대매수",AtStop,H[BarsSinceEntry]+0.7+PriceScale);
}
즐거운 하루되세요
> 외국인 님이 쓴 글입니다.
> 제목 : 이익실현
> 안녕하세요
1.
식에서 SetStopTrailing(0.05,0.5포인트에서~ 최고2포인트 이익실현표현식)은 어떻게되는지요
2.매수후 매도신호시 (즉1개약진입후 다음 매도매수 신호시 청산만되지 다시 매도진입이 안되네요).
If (stime > 91000 and stime < 113000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if BarsSinceExit(1) > 1 then {
if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) and MarketPosition == 0 Then
buy("매수");
if MarketPosition == 1 Then
sell("반대매도",AtStop,L[BarsSinceEntry]-0.3-PriceScale);
if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("매도");
if MarketPosition == -1 Then
buy("반대매수",AtStop,H[BarsSinceEntry]+0.7+PriceScale);
}
}
다음글
이전글