커뮤니티
분할매도 문의드립니다.
2010-01-20 15:44:51
764
글번호 27573
안녕하세요. 항상 도와주셔서 감사드립니다.
예전에 도와주신 덕분에, 분할매수는 알겠는데..분할매도도 알려주시면 넘 감사하겠습니다. ^^
아래에 예를 썼는데요, 20일선이 양(음)반전하면 (원본+수익누적액)*20% 로 5번 나누어 진입하고, 음반전하면 한번에 청산하는 내용입니다.
문의드리고자 하는 내용은
(1) 청산도 진입과 같이 5번에 걸쳐서 하는 방법
(2) 분할매도 중 다시 매수 진입할 경우, 원본+수익누적액 한도 유지 입니다.
감사합니다.
Inputs: capital(10000000), Period(20);
Variables: value1(0);
Var1 = int(capital+NetProfit)*0.2;
var2 = int(int(var1/C)/10)*10;
Value1 = MA(C, period);
# 매수
If value1 >= value1[1] then
{
Buy("b",onclose,def,var2);
}
# 매수청산
If Value1 < Value1[1] then
{
ExitLong();
}
# 매도
If Value2 < Value2[1] Then
{
Sell("s",onclose,def,var2);
}
# 매도청산
If Value2 >= Value2[1] Then
{
ExitShort();
}
답변 1
예스스탁 예스스탁 답변
2010-01-21 09:49:52
안녕하세요
예스스탁입니다.
inputs: capital(10000000), Period(20);
Variables: value1(0);
Var1 = int(capital+NetProfit)*0.2;
var2 = int(int(var1/C)/10)*10;
Value1 = MA(C, period);
# 매수
If MarketPosition != 1 and value1 >= value1[1] then
Buy("b1",onclose,def,var2);
If MarketPosition == 1 and CurrentEntries == 1 and value1 >= value1[1] then
Buy("b2",onclose,def,var2);
If MarketPosition == 1 and CurrentEntries == 2 and value1 >= value1[1] then
Buy("b3",onclose,def,var2);
If MarketPosition == 1 and CurrentEntries == 3 and value1 >= value1[1] then
Buy("b4",onclose,def,var2);
If MarketPosition == 1 and CurrentEntries == 4 and value1 >= value1[1] then
Buy("b5",onclose,def,var2);
# 매수청산
if MarketPosition == 1 Then{
If Value1 < Value1[1] and CurrentEntries == 1 then
ExitLong("bx1",OnClose,def,"b1");
If Value1 < Value1[1] and CurrentEntries == 2 then
ExitLong("bx2",OnClose,def,"b2");
If Value1 < Value1[1] and CurrentEntries == 3 then
ExitLong("bx3",OnClose,def,"b3");
If Value1 < Value1[1] and CurrentEntries == 4 then
ExitLong("bx4",OnClose,def,"b4");
If Value1 < Value1[1] and CurrentEntries == 5 then
ExitLong("bx5",OnClose,def,"b5");
}
# 매도
If MarketPosition != -1 and Value2 < Value2[1] Then
Sell("s1",onclose,def,var2);
If MarketPosition == -1 and CurrentEntries == 1 and Value2 < Value2[1] Then
Sell("s2",onclose,def,var2);
If MarketPosition == -1 and CurrentEntries == 2 and Value2 < Value2[1] Then
Sell("s3",onclose,def,var2);
If MarketPosition == -1 and CurrentEntries == 3 and Value2 < Value2[1] Then
Sell("s4",onclose,def,var2);
If MarketPosition == -1 and CurrentEntries == 4 and Value2 < Value2[1] Then
Sell("s5",onclose,def,var2);
# 매도청산
if MarketPosition == -1 Then{
If Value2 >= Value2[1] and CurrentEntries == 1 Then
ExitShort("sx1",OnClose,def,"s1");
If Value2 >= Value2[1] and CurrentEntries == 2 Then
ExitShort("sx2",OnClose,def,"s2");
If Value2 >= Value2[1] and CurrentEntries == 3 Then
ExitShort("sx3",OnClose,def,"s3");
If Value2 >= Value2[1] and CurrentEntries == 4 Then
ExitShort("sx4",OnClose,def,"s4");
If Value2 >= Value2[1] and CurrentEntries == 5 Then
ExitShort("sx5",OnClose,def,"s5");
}
즐거운 하루되세요
> 매직포뮬라 님이 쓴 글입니다.
> 제목 : 분할매도 문의드립니다.
> 안녕하세요. 항상 도와주셔서 감사드립니다.
예전에 도와주신 덕분에, 분할매수는 알겠는데..분할매도도 알려주시면 넘 감사하겠습니다. ^^
아래에 예를 썼는데요, 20일선이 양(음)반전하면 (원본+수익누적액)*20% 로 5번 나누어 진입하고, 음반전하면 한번에 청산하는 내용입니다.
문의드리고자 하는 내용은
(1) 청산도 진입과 같이 5번에 걸쳐서 하는 방법
(2) 분할매도 중 다시 매수 진입할 경우, 원본+수익누적액 한도 유지 입니다.
감사합니다.
Inputs: capital(10000000), Period(20);
Variables: value1(0);
Var1 = int(capital+NetProfit)*0.2;
var2 = int(int(var1/C)/10)*10;
Value1 = MA(C, period);
# 매수
If value1 >= value1[1] then
{
Buy("b",onclose,def,var2);
}
# 매수청산
If Value1 < Value1[1] then
{
ExitLong();
}
# 매도
If Value2 < Value2[1] Then
{
Sell("s",onclose,def,var2);
}
# 매도청산
If Value2 >= Value2[1] Then
{
ExitShort();
}
다음글
이전글