예스스탁
예스스탁 답변
2020-01-14 10:18:35
안녕하세요
예스스탁입니다.
진입횟수에 문제가 있었습니다.
아래식으로 이용하시기 바랍니다.
input : BBP(20),dv(2),매매횟수(2);
var : mav(0),bbup(0),BBdn(0),BBmd(0),entry(0);
BBmd = ma(C,BBP);
BBup = BollBandUp(BBP,dv);
BBdn = BollBandDown(BBP,dv);
if (sdate != sdate[1] and stime >= 101500) or
(sdate == sdate[1] and stime >= 101500 and stime[1] < 101500) Then
entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if stime >= 101500 and stime < 170000 then
{
if entry < 매매횟수 and L > bbup Then
sell("s",AtMarket);
if entry < 매매횟수 and H < bbdn Then
buy("b",AtMarket);
if MarketPosition == 1 and Crossup(C,bbmd) Then
ExitLong("bx",AtMarket);
if MarketPosition == -1 and Crossdown(C,bbmd) Then
ExitShort("sx",AtMarket);
}
SetStopEndofday(170000);
즐거운 하루되세요
> 흰둥이아빠 님이 쓴 글입니다.
> 제목 : 함수요청
> 안녕하세요?
아래 글번호 65633번 재질문입니다.
작성주신 스크립트를 한투에 적용해보면
HSIF20 3분봉상
1월 13일 10:24분봉의 저가가 볼린저밴드 상단 위에 위치하였으나
매도신호가 생성되지 않습니다.
===================================================================================
항셍지수선물 3분봉으로 거래를 하고자 하는데 T장(10:15~17:30)에서만 생성하고자 합니다.
해당봉의 저가가 볼린저밴드 상단 위에 위치해 있으면 익봉 시가 매도
해당봉의 고가가 볼린저밴드 하단 아래에 위치해 있으면 익봉 시가 매수
진입 후 종가가 볼린저밴드 중심선(20ma)을 크로스하면 익봉 시가에 청산
진입 기준으로 매매횟수가 최대 2회까지이며
17시에 시간청산하고자 합니다.
input : BBP(20),dv(2),매매횟수(2);
var : mav(0),bbup(0),BBdn(0),BBmd(0),entry(0);
BBmd = ma(C,BBP);
BBup = BollBandUp(BBP,dv);
BBdn = BollBandDown(BBP,dv);
if (sdate != sdate[1] and stime >= 101500) or
(sdate != sdate[1] and stime >= 101500 and stime[1] < 101500) Then
entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if stime >= 101500 and stime < 170000 then
{
if entry < 매매횟수 and L > bbup Then
sell("s",AtMarket);
if entry < 매매횟수 and H < bbdn Then
buy("b",AtMarket);
if MarketPosition == 1 and Crossup(C,bbmd) Then
ExitLong("bx",AtMarket);
if MarketPosition == -1 and Crossdown(C,bbmd) Then
ExitShort("sx",AtMarket);
}
SetStopEndofday(170000);