커뮤니티
수식 부탁드립니다.
2010-08-23 13:40:54
797
글번호 31777
아래와 같은 수식에
--- 강제청산(목표수익달성)후 같은신호 계속발생 제거식---
당일청산 시스템이구요.
매수(매도청산)와 매도(매수청산)가 함께 나오는 시스템입니다.
매수후 이익달성이면 같은 매수식에서 계속 같은 신호는 나지못하고요...
매도신호가 나오면 새로운 진입신호(매도신호)가 나오는것이구요.
이 매도 신호가 끝나고 다시 매수가 나오면 그대로 매수 신호가 나게하는겁니다.
이 조건만으로 아래의 제 수식에 덛입혀주십시요.
.
저의 수식
Input : Period(20), shortPeriod(5), longperiod(20), ;
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If ma(c,period) >= ma(c[1],period) and c>=o Then
{
Buy();
}
# 매도/매수청산
If ma(c,period) <= ma(c[1],period) and c<=o Then
{
Sell();
}
이상입니다.
부탁드립니다
답변 1
예스스탁 예스스탁 답변
2010-08-24 09:51:00
안녕하세요
예스스탁입니다.
Input : Period(20), shortPeriod(5), longperiod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If (EntryDate != sdate and ExitDate(1) != sdate) Then{
if ma(c,period) >= ma(c[1],period) and c>=o Then
Buy("b1");
If ma(c,period) <= ma(c[1],period) and c<=o Then
Sell("s1");
}
If (ExitDate(1) == sdate) Then{
if (MarketPosition != 0 or (MarketPosition == 0 and IsExitName("stopProfittarget",1) == false)) Then{
if ma(c,period) >= ma(c[1],period) and c>=o Then
Buy("b2");
If ma(c,period) <= ma(c[1],period) and c<=o Then
Sell("s2");
}
if (MarketPosition == 0 and IsExitName("stopProfittarget",1) == true) Then{
if MarketPosition(1) == -1 and ma(c,period) >= ma(c[1],period) and c>=o Then
Buy("b3");
If MarketPosition(1) == 1 and ma(c,period) <= ma(c[1],period) and c<=o Then
Sell("s3");
}
}
즐거운 하루되세요
> 산천초목 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 아래와 같은 수식에
--- 강제청산(목표수익달성)후 같은신호 계속발생 제거식---
당일청산 시스템이구요.
매수(매도청산)와 매도(매수청산)가 함께 나오는 시스템입니다.
매수후 이익달성이면 같은 매수식에서 계속 같은 신호는 나지못하고요...
매도신호가 나오면 새로운 진입신호(매도신호)가 나오는것이구요.
이 매도 신호가 끝나고 다시 매수가 나오면 그대로 매수 신호가 나게하는겁니다.
이 조건만으로 아래의 제 수식에 덛입혀주십시요.
.
저의 수식
Input : Period(20), shortPeriod(5), longperiod(20), ;
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If ma(c,period) >= ma(c[1],period) and c>=o Then
{
Buy();
}
# 매도/매수청산
If ma(c,period) <= ma(c[1],period) and c<=o Then
{
Sell();
}
이상입니다.
부탁드립니다