커뮤니티
질문있습니다.
2012-01-02 12:38:50
373
글번호 46205
안녕하세요.
22208글에 당일 매수하게 되면 그 날은 트레일링 스탑이 작동하지 않도록 하게 도움을 주셨는데요. 적용해보니까 매수매도신호가 뜨질 않네요.
이 식인데 혹시 문제가 있나 봐주셨으면 합니다.
Input : period(20), j(0);
Condition1 = ExitDate(1) == sdate and IsExitName("StopTrailing",1) == True;
# 매수/매도청산
if Condition1 == true and c>=MA(c,period)+2*std(c,period) Then
{
buy();
}
# 매도/매수청산
If c<=MA(c,period)-2*std(c,period) or c<=highest(c,period)-j*atr(period) Then
{
ExitLong();
}
SetStopTrailing(4,10,PercentStop,0);
새해 복 많이 받으세요.
답변 1
예스스탁 예스스탁 답변
2012-01-02 17:20:58
안녕하세요
예스스탁입니다.
진입식에 condition1 == true를 condition1 == false로 변경하셔야 합니다.
또한 해당 식은 하나의 봉에서 진입과 청산조건이 동시에 만족할 수 있는 식입니다.
동시에 발생하지 않게 처리도 같이 했습니다.
Input : period(20), j(0);
Condition1 = ExitDate(1) == sdate and IsExitName("StopTrailing",1) == True;
if Condition1 == false and MarketPosition == 0 and c >= MA(c,period)+2*std(c,period) Then
buy();
if MarketPosition == 1 then{
If c <= MA(c,period)-2*std(c,period) or c <= highest(c,period)-j*atr(period) Then
ExitLong();
}
SetStopTrailing(4,10,PercentStop,0);
즐거운 하루되세요
> 신디 님이 쓴 글입니다.
> 제목 : 질문있습니다.
> 안녕하세요.
22208글에 당일 매수하게 되면 그 날은 트레일링 스탑이 작동하지 않도록 하게 도움을 주셨는데요. 적용해보니까 매수매도신호가 뜨질 않네요.
이 식인데 혹시 문제가 있나 봐주셨으면 합니다.
Input : period(20), j(0);
Condition1 = ExitDate(1) == sdate and IsExitName("StopTrailing",1) == True;
# 매수/매도청산
if Condition1 == true and c>=MA(c,period)+2*std(c,period) Then
{
buy();
}
# 매도/매수청산
If c<=MA(c,period)-2*std(c,period) or c<=highest(c,period)-j*atr(period) Then
{
ExitLong();
}
SetStopTrailing(4,10,PercentStop,0);
새해 복 많이 받으세요.
다음글
이전글