커뮤니티
시스템문의드립니다.
2018-10-24 22:52:01
237
글번호 123015
시스템문의드립니다.
항상감사드립니다.
- 1. 240분봉_20일선_5일선CP.PNG (0.13 MB)
답변 1
예스스탁 예스스탁 답변
2018-10-25 14:14:55
안녕하세요
예스스탁입니다.
신호발생 내용만 작성해서 드립니다.
업무상 작성해 보는데 시간이 많이 소모되는 내용은 저희가 답변드리기 어렵습니다.
데이터표시나 엑셀데이터 추출은 이후 사용자분이 추가해 보셔야 합니다.
input : starttime1(090000),endtime1(150000);
input : starttime2(150000),endtime2(030000);
input : vol(2); //진입수량
input : Switch(1); //스위칭 0이면 가능,1이면 불가
input : 손절틱수(30),익절틱수(60);
input : 당일손실횟수(5),당일수익횟수(10);
var : Tcond(false),mav1(0),mav2(0),T(0);
var : Lcnt(0),Pcnt(0),손실횟수(0),수익횟수(0);
if (sdate != sdate[1] and stime >= starttime1) or
(sdate == sdate[1] and stime >= starttime1 and stime[1] < starttime1) then
{
Tcond = true;
Lcnt = 0;
Pcnt = 0;
}
if (sdate != sdate[1] and stime >= endtime1) or
(sdate == sdate[1] and stime >= endtime1 and stime[1] < endtime1) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx1");
if MarketPosition == -1 Then
ExitLong("Sx1");
}
if (sdate != sdate[1] and stime >= starttime2) or
(sdate == sdate[1] and stime >= starttime2 and stime[1] < starttime2) then
{
Tcond = true;
Lcnt = 0;
Pcnt = 0;
}
if (sdate != sdate[1] and stime >= endtime2) or
(sdate == sdate[1] and stime >= endtime2 and stime[1] < endtime2) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx2");
if MarketPosition == -1 Then
ExitLong("Sx2");
}
if TotalTrades > TotalTrades[1] then
{
if PositionProfit(1) < 0 Then
Lcnt = Lcnt+1;
if PositionProfit(1) > 0 Then
Pcnt = Pcnt+1;
}
if MarketPosition == 0 Then
{
손실횟수 = Lcnt;
수익횟수 = Pcnt;
}
Else
{
if PositionProfit(0) > 0 Then
수익횟수 = Lcnt+1;
if PositionProfit(0) < 0 Then
손실횟수 = Lcnt-1;
}
mav1 = ma(C,5);
mav2 = ma(C,20);
if mav2 > mav2[1] Then
T = 1;
if mav2 < mav2[1] Then
T = -1;
if MarketPosition == 0 Then
{
if T == 1 and NextBarOpen < mav2 Then
buy("b",AtStop,NextBarOpen+PriceScale*1);
}
if MarketPosition == -1 and switch == 0 Then
{
if T == 1 and NextBarOpen < mav2 Then
{
if Lcnt < 손실횟수 and Pcnt < 수익횟수 Then
buy("sb",AtStop,NextBarOpen+PriceScale*1);
Else
ExitShort("sx",AtStop,NextBarOpen+PriceScale*1);
}
}
if MarketPosition == 0 Then
{
if T == -1 and NextBarOpen > mav2 Then
sell("s",AtStop,NextBarOpen-PriceScale*1);
}
if MarketPosition == 1 and switch == 0 Then
{
if T == -1 and NextBarOpen > mav2 Then
{
if Lcnt < 손실횟수 and Pcnt < 수익횟수 Then
sell("bs",AtStop,NextBarOpen-PriceScale*1);
Else
ExitLong("bx",AtStop,NextBarOpen-PriceScale*1);
}
}
SetStopLoss(PriceScale*손절틱수,PointStop);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
즐거운 하루되세요
> 리나이 님이 쓴 글입니다.
> 제목 : 시스템문의드립니다.
> 시스템문의드립니다.
항상감사드립니다.
다음글
이전글