안녕하세요?
아래 글번호 71584번 재질문입니다.
어제의 시세데이터는 금일 신호와 독립적이어야 합니다.
따라서 금일 시세로만 당일의 매매신호를 생성하고 싶습니다
즉 당일 9시 1분 완성봉을 봉카운트 1개로 시작하여 고점 저점을 비교하자합니다.
스크립트 수정 요청드립니다.
감사합니다.
----------------------------------------------------------------------------------------
input : nn(1),mm(2),진입횟수(1);
var : entry(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and entry < 진입횟수 and L > H[nn] and L > H[mm] Then
Buy("b",AtMarket);
if MarketPosition >= 0 and entry < 진입횟수 and H < L[nn] and H < L[mm] Then
Sell("s",AtMarket);
if MarketPosition == 1 and C < L[nn] and C < L[mm] Then
ExitLong("bx",AtMarket);
if MarketPosition == -1 and C > H[nn] and C > H[mm] Then
ExitShort("sx",AtMarket);
if MarketPosition != 0 and sTime == 152000 Then
{
ExitLong();
ExitShort();
}
답변 1
예스스탁
예스스탁 답변
2021-03-24 15:35:04
안녕하세요
예스스탁입니다.
input : nn(1),mm(2),진입횟수(1);
var : entry(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and entry < 진입횟수 and L > H[nn] and L > H[mm] and Bdate[nn] == Bdate and Bdate[mm] == Bdate Then
Buy("b",AtMarket);
if MarketPosition >= 0 and entry < 진입횟수 and H < L[nn] and H < L[mm] and Bdate[nn] == Bdate and Bdate[mm] == Bdate Then
Sell("s",AtMarket);
if MarketPosition == 1 and C < L[nn] and C < L[mm] and Bdate[nn] == Bdate and Bdate[mm] == Bdate Then
ExitLong("bx",AtMarket);
if MarketPosition == -1 and C > H[nn] and C > H[mm] and Bdate[nn] == Bdate and Bdate[mm] == Bdate Then
ExitShort("sx",AtMarket);
if MarketPosition != 0 and sTime == 152000 Then
{
ExitLong();
ExitShort();
}
즐거운 하루되세요
> 흰둥이아빠 님이 쓴 글입니다.
> 제목 : 함수요청
> 안녕하세요?
아래 글번호 71584번 재질문입니다.
어제의 시세데이터는 금일 신호와 독립적이어야 합니다.
따라서 금일 시세로만 당일의 매매신호를 생성하고 싶습니다
즉 당일 9시 1분 완성봉을 봉카운트 1개로 시작하여 고점 저점을 비교하자합니다.
스크립트 수정 요청드립니다.
감사합니다.
----------------------------------------------------------------------------------------
input : nn(1),mm(2),진입횟수(1);
var : entry(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and entry < 진입횟수 and L > H[nn] and L > H[mm] Then
Buy("b",AtMarket);
if MarketPosition >= 0 and entry < 진입횟수 and H < L[nn] and H < L[mm] Then
Sell("s",AtMarket);
if MarketPosition == 1 and C < L[nn] and C < L[mm] Then
ExitLong("bx",AtMarket);
if MarketPosition == -1 and C > H[nn] and C > H[mm] Then
ExitShort("sx",AtMarket);
if MarketPosition != 0 and sTime == 152000 Then
{
ExitLong();
ExitShort();
}