답변완료
30mbo 관련 수식 질문드립니다.
input : starttime(090000),endtime(092959);
If sTime >=093000 and sTime < 145000 and
CrossUp(C,TimeHigh(starttime,endtime)) Then
buy();
If sTime >=093000 and sTime < 145000 and
CrossUp(C,TimeLow(starttime,endtime)) Then
Sell();
if sTime == 145000 Then {
ExitLong();
ExitShort();
}
예스스탁 예제로 나온 3mbo전략으로 해외선물에 적용해봤는대요 장시작 시간과 마감 시간이 틀려서 그런지 뭔가 안맞는거 같습니다.
번거로우시겠지만 다음 조건으로 수식 작성 도움좀 부탁드립니다.
1. 매수던 매도던 1일 1회 진입으로 한정.
2. 채널 형성시간 조절 가능하게끔. (예 30분봉일 경우 채널 형성시간 0930~1030 , 40분
봉 일경우 0740~0820 등)
수식 부탁드립니다.
수고하세요!!
2020-03-09
176
글번호 136725
시스템
답변완료
수식 부탁드립니다.
안녕하세요.
게시판 답변중 보게된 지표식인데 라인갯수를 늘리려고합니다.
n을 n1, n2, .... 이렇게 6개정도 추가했으면 좋겠습니다.
제가 해보다가 라인이 엉뚱하게 생기는거 같아 부탁드립니다.
감사합니다.
---------------------------------
input : n(100);
var : TL(0);
var1 = DayHigh-daylow;
if bdate != bdate[1] Then
TL_Delete(TL);
if bdate != bdate[1] and var1 >= PriceScale*n or
(bdate == bdate[1] and var1 >= PriceScale*n and var1[1] < PriceScale*n) Then
{
if (bdate != bdate[1] and C > O) or
(bdate == bdate[1] and DayHigh > DayHigh[1]) Then
{
var2 = h;
TL = TL_New(sdate,stime,var2,NextBarSdate,NextBarStime,var2);
TL_SetColor(TL,RED);
}
Else
{
var2 = L;
TL = TL_New(sdate,stime,var2,NextBarSdate,NextBarStime,var2);
TL_SetColor(TL,BLUE);
}
}
Else
TL_SetEnd(TL,NextBarSdate,NextBarStime,var2);
2020-03-09
181
글번호 136707
지표
답변완료
수정 부탁드립니다
안녕하세요?
아래의 두가지 수식이 하루 매매횟수가 맞질않습니다.
외부변수에서 1회로 설정해 놓아도 여러번 거래되는날이 많네요.
수정부탁드립니다.
감사합니다.
[1]
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
input : P1(5),P2(20);
var : entry(0),mav1(0),mav2(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
#영업일 변경
if bdate != bdate[1] Then
entry = 0;
#포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if mav1 > mav2 and #정배열
entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매수나 무포지션 상태
C[1] == O[1]+매도양봉틱수*PriceScale and #1봉전종가가 1봉전시가+매도양봉틱수 이상
C[0] == O[0]-매도음봉틱수*PriceScale Then #현재봉 종가가 1봉전시가-매도음봉틱수 이하
sell("s");
if mav1 < mav2 and #역배열
entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매도나 무포지션 상태
C[1] == O[1]-매수음봉틱수*PriceScale and #1봉전종가가 1봉전시가-매수음봉틱수 이하
C[0] == O[0]+매수양봉틱수*PriceScale Then #현재봉 종가가 1봉전시가+매수양봉틱수 이상
buy("b");
#매수진입 후 손절되면 매도로 스위칭
if MarketPosition == 1 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
#매도진입 후 손절되면 매수로 스위칭
if MarketPosition == -1 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
#목표수익 설정
SetStopProfittarget(PriceScale*익절틱수,PointStop);
[2]
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
var : entry(0);
#영업일 변경
if bdate != bdate[1] Then
entry = 0;
#포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매수나 무포지션 상태
C[1] == O[1]+매도양봉틱수*PriceScale and #1봉전종가가 1봉전시가+매도양봉틱수 이상
C[0] == O[0]-매도음봉틱수*PriceScale Then #현재봉 종가가 1봉전시가-매도음봉틱수 이하
sell("s");
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매도나 무포지션 상태
C[1] == O[1]-매수음봉틱수*PriceScale and #1봉전종가가 1봉전시가-매수음봉틱수 이하
C[0] == O[0]+매수양봉틱수*PriceScale Then #현재봉 종가가 1봉전시가+매수양봉틱수 이상
buy("b");
#매수진입 후 손절되면 매도로 스위칭
if MarketPosition == 1 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
#매도진입 후 손절되면 매수로 스위칭
if MarketPosition == -1 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
#목표수익 설정
SetStopProfittarget(PriceScale*익절틱수,PointStop);
2020-03-09
188
글번호 136693
시스템
답변완료
수식문의
키움수식을 예스수식으로 변경 부탁드립니다.
MACD 0선 상향돌파
CrossUp(MACD(shortPeriod,longPeriod),0)
CrossDown(MACD(shortPeriod,longPeriod),0)
MACD-sig와 골든크로스
CrossUp(MACD(shortPeriod,longPeriod),eavg(MACD(shortPeriod,longPeriod),sigPeriod))
CrossDown(MACD(shortPeriod,longPeriod),eavg(MACD(shortPeriod,longPeriod),sigPeriod))
2020-03-09
284
글번호 136691
시스템
답변완료
문의드립니다.
// Inputs
mac = ma(close,2)
mal = ma(low,4)
mah = ma(high,5)
// Calculations
short = (mac - mah)>= (mal-mac)
long = (mac - mah)
neut = (mal- mac) > ( mac - mah)
// plot indicator
plot(mac-mah, color = red,linewidth = 2)
plot(mal-mac, color = red, linewidth = 2)
barcolor(long ? red :red)
barcolor(neut ? yellow :na)
수식 변환과 이 수식에 기준선 1.5 추가 부탁드릴 수 있을까요
감사합니다.
2020-03-09
293
글번호 136690
지표