예스스탁
예스스탁 답변
2023-04-19 18:39:26
안녕하세요
예스스탁입니다.
1
input : short(12),long(26),sig(9);
var : macdv(0),macds(0);
macdv = macd(short,long);
macds = ema(macdv,sig);
if Bdate != Bdate[1] Then
{
var1 = 0;
Var2 = 0;
}
Condition1 = macdv > 0 and macds > 0 and CrossDown(macdv,macds);
Condition2 = macdv < 0 and macds < 0 and CrossUp(macdv,macds);
if Condition1 == true Then
{
var1 = var1+1;
if var1 == 3 Then
Sell("s",AtMarket);
}
if MarketPosition == -1 and Condition2 == true Then
ExitShort("sx",AtMarket);
if Condition2 == true Then
{
var2 = var2+1;
if var2 == 3 Then
Buy("b",AtMarket);
}
if MarketPosition == 1 and Condition1 == true Then
ExitLong("bx",AtMarket);
SetStopEndofday(152000);
2
input : short(12),long(26),sig(9);
var : macdv(0),macds(0);
macdv = macd(short,long);
macds = ema(macdv,sig);
if Bdate != Bdate[1] Then
{
var1 = 0;
Var2 = 0;
}
Condition1 = macdv > 0 and macds > 0 and CrossDown(macdv,macds);
Condition2 = macdv < 0 and macds < 0 and CrossUp(macdv,macds);
if Condition1 == true Then
{
var1 = var1+1;
if var1 == 3 Then
Sell("s",AtMarket);
}
if MarketPosition == -1 and Condition2 == true and
CountIf(Condition2==true,BarsSinceEntry) == 3 Then
ExitShort("sx",AtMarket);
if Condition2 == true Then
{
var2 = var2+1;
if var2 == 3 Then
Buy("b",AtMarket);
}
if MarketPosition == 1 and Condition1 == true and
CountIf(Condition1 ==true,BarsSinceEntry) == 3 Then
ExitLong("bx",AtMarket);
SetStopEndofday(152000);
즐거운 하루되세요
> 흰둥이아빠 님이 쓴 글입니다.
> 제목 : 함수요청
> 안녕하세요?
아래의 전략에 대해 스크립트 작성 요청드립니다.
국내선물 5분봉으로 일중거래를 하고자 합니다.
[1]
Macd와 시그널이 모두 0보다 크고 Macd가 시그널을 하향돌파 하되(Macd 오실레이터 0전환) 당일 누적으로 세번째 교차하면 익봉 시가에 매도
Macd와 시그널이 모두 0보다 작고 Macd가 시그널을 상향돌파 하되(Macd 오실레이터 0전환) 당일 누적으로 세번째 교차하면 익봉 시가에 매수
매도 진입 후 Macd와 시그널이 모두 0보다 작고 Macd가 시그널을 상향돌파 하면(Macd 오실레이터 0전환) 익봉 시가에 매도청산
매수 진입 후 Macd와 시그널이 모두 0보다 크고 Macd가 시그널을 하향돌파 하면(Macd 오실레이터 0전환) 익봉 시가에 매수청산
매수든 매도든 진입기준으로 최대 1회입니다.
15시 20분 강제청산입니다.
[2]
Macd와 시그널이 모두 0보다 크고 Macd가 시그널을 하향돌파 하되(Macd 오실레이터 0전환) 당일 누적으로 세번째 교차하면 익봉 시가에 매도
Macd와 시그널이 모두 0보다 작고 Macd가 시그널을 상향돌파 하되(Macd 오실레이터 0전환) 당일 누적으로 세번째 교차하면 익봉 시가에 매수
매도진입 후 Macd와 시그널이 모두 0보다 작고 Macd가 시그널을 상향돌파 하되(Macd 오실레이터 0전환) 진입 이후에 세번째 교차하면 익봉 시가에 매도청산
매수진입 후Macd와 시그널이 모두 0보다 크고 Macd가 시그널을 하향돌파 하되(Macd 오실레이터 0전환) 진입 이후에 세번째 교차하면 익봉 시가에 매수청산
매수든 매도든 진입기준으로 최대 1회입니다.
15시 20분 강제청산입니다.