커뮤니티
글번호 52952번 추가질문
2017-04-20 13:57:45
175
글번호 108987
안녕하세요?
언제나 감사드립니다.
글번호 52952번 추가 질문드립니다.
답변주신 스크립트에 각 구문에 구체적인 주석으로 요청드립니다.
Input : Period( 5 );
Vars : MP( 0 ), Buycount( 0 ), Sellcount( 0 ), totalprofit( 0 ),Month(0);
var : V0(0),V1(0),v50(0);
MP = Marketposition;
V0 = date%100;
V1 = dayofweek(date);
month = int(date/100)-int(date/10000)*100;
If Mod(Month, 3) == 0 and V0 >= 8 and V0 <= 14 and V1 == 4
Then
Begin
If stime == 144000 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(143000);
End
Else
Begin
If stime == 151500 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(150000);
End;
If date <> date[1] Then
Begin
Sellcount = 0;
Buycount = 0;
End;
Condition1 = time > 090000 And time < 150000;
condition2 = CrossUp(Close, Average(Close, period));
If Sellcount == 0
Then
Begin
If MP == 0 And condition1 and condition2 And Buycount < 2
Then
Begin
Buy("B1");
Buycount = Buycount + 1 ;
End;
Input : B1(0.7), B2(-1.6);
If Condition1 Then
Begin
If PositionProfit < B2 Then ExitLong("매수 손절");
If PositionProfit > B1 Then Sell("역추세");
End;
Input : X1(2.3), X2(-0.9);
If MP == -1 Then
Begin
If PositionProfit > X1 Then ExitShort("역추세 익절");
If PositionProfit < X2 Then ExitShort("역추세 손절");
End;
Input : bse(50);
If MP == 1 And BarsSinceEntry == bse then
Begin
Sell("S1");
End;
End;
Input : totalv(-2.1), bse2(20), ppf(-0.6);
If mp == 0 And totalprofit < totalv And Buycount >= 2 And Sellcount == 0
Then
Begin
Sell("S2");
Sellcount = 1;
End;
If IsEntryName("역추세") == true and barssinceentry < bse2 And PositionProfit < ppf then Buy("B2");
답변 1
예스스탁 예스스탁 답변
2017-04-21 11:25:57
안녕하세요
예스스탁입니다.
Input : Period( 5 );
Vars : MP( 0 ), Buycount( 0 ), Sellcount( 0 ), totalprofit( 0 ),Month(0);
var : V0(0),V1(0),v50(0);
MP = Marketposition; #포지션상태
V0 = date%100; #일수
V1 = dayofweek(date);#요일
month = int(date/100)-int(date/10000)*100;#월
#선물 만기일이면 3,6,9,12월 2번째 목요일
If Mod(Month, 3) == 0 and V0 >= 8 and V0 <= 14 and V1 == 4 Then Begin
#1440분에 totalprofit총손익 저장
If stime == 144000 Then
v50 = NetProfit;
#당일발생 수익
totalprofit = NetProfit - v50 + PositionProfit;
#14시 30분에 당일청산
SetStopEndofday(143000);
End
Else Begin #만기일이 아니면
If stime == 151500 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
#15시 청산
SetStopEndofday(150000);
End;
#날빠 변경되면 횟수 초기화
If date <> date[1] Then
Begin
Sellcount = 0;
Buycount = 0;
End;
#9시~15시 사이이면 true, 아니면 false
Condition1 = time > 090000 And time < 150000;
#종가가 이평 상향돌파하면 true 아니면 false
condition2 = CrossUp(Close, ma(Close, period));
#당일 매도카운트가 0일때
If Sellcount == 0 Then Begin
#무포지션이고 Condition1,Condition2가 true이고 매수카운트는 2미만일대 매수진입
If MP == 0 And condition1 and condition2 And Buycount < 2 Then Begin
Buy("B1");
#매수카운트 1증가
Buycount = Buycount + 1 ;
End;
Input : B1(0.7), B2(-1.6);
#Condition1만족하고
If Condition1 Then begin
#Condition1만족하고 손익이 b2이하이면 매수포지션 청산
If PositionProfit < B2 Then ExitLong("매수 손절");
#Condition1만족하고 손익이 b1이상이면 매도로 스위칭
If PositionProfit > B1 Then Sell("역추세");
End;
Input : X1(2.3), X2(-0.9);
#매수진입후
If MP == -1 Then Begin
#손익이 X1이상이면 매도포지션 청산
If PositionProfit > X1 Then ExitShort("역추세 익절");
#손익이 X2이하이면 매도포지션 청산
If PositionProfit < X2 Then ExitShort("역추세 손절");
End;
Input : bse(50);
#매수 후 bse번재 봉에서 매도로 스위칭
If MP == 1 And BarsSinceEntry == bse then Begin
Sell("S1");
End;
End;
Input : totalv(-2.1), bse2(20), ppf(-0.6);
#무포지션이고 당일손익이 totalv이하이고 매수카누트가 2이상이고 매도카운트는 0이면 매도로 진입
If mp == 0 And totalprofit < totalv And Buycount >= 2 And Sellcount == 0 Then Begin
Sell("S2");
#매도카운트는 1
Sellcount = 1;
End;
#역추세라는 이름으로 진입중이고 진입이후 bse2봉이 경과하지 안고 손익이 ppf미만이면 매수
If IsEntryName("역추세") == true and barssinceentry < bse2 And PositionProfit < ppf then Buy("B2");
즐거운 하루되세요
> 통큰베팅 님이 쓴 글입니다.
> 제목 : 글번호 52952번 추가질문
> 안녕하세요?
언제나 감사드립니다.
글번호 52952번 추가 질문드립니다.
답변주신 스크립트에 각 구문에 구체적인 주석으로 요청드립니다.
Input : Period( 5 );
Vars : MP( 0 ), Buycount( 0 ), Sellcount( 0 ), totalprofit( 0 ),Month(0);
var : V0(0),V1(0),v50(0);
MP = Marketposition;
V0 = date%100;
V1 = dayofweek(date);
month = int(date/100)-int(date/10000)*100;
If Mod(Month, 3) == 0 and V0 >= 8 and V0 <= 14 and V1 == 4
Then
Begin
If stime == 144000 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(143000);
End
Else
Begin
If stime == 151500 Then v50 = NetProfit;
totalprofit = NetProfit - v50 + PositionProfit;
SetStopEndofday(150000);
End;
If date <> date[1] Then
Begin
Sellcount = 0;
Buycount = 0;
End;
Condition1 = time > 090000 And time < 150000;
condition2 = CrossUp(Close, Average(Close, period));
If Sellcount == 0
Then
Begin
If MP == 0 And condition1 and condition2 And Buycount < 2
Then
Begin
Buy("B1");
Buycount = Buycount + 1 ;
End;
Input : B1(0.7), B2(-1.6);
If Condition1 Then
Begin
If PositionProfit < B2 Then ExitLong("매수 손절");
If PositionProfit > B1 Then Sell("역추세");
End;
Input : X1(2.3), X2(-0.9);
If MP == -1 Then
Begin
If PositionProfit > X1 Then ExitShort("역추세 익절");
If PositionProfit < X2 Then ExitShort("역추세 손절");
End;
Input : bse(50);
If MP == 1 And BarsSinceEntry == bse then
Begin
Sell("S1");
End;
End;
Input : totalv(-2.1), bse2(20), ppf(-0.6);
If mp == 0 And totalprofit < totalv And Buycount >= 2 And Sellcount == 0
Then
Begin
Sell("S2");
Sellcount = 1;
End;
If IsEntryName("역추세") == true and barssinceentry < bse2 And PositionProfit < ppf then Buy("B2");