커뮤니티
수식요청
2017-04-28 09:41:08
150
글번호 109236
# 진입
1) 아래식에서는 지속적인 진입이 이루어 집니다.
MACDO2>0 and MACDV1>0 and mav1>mav2 의 3개의 조건이 만족시 매수진입이 한번만 이루어지게 해주세요
MACDO2<0 and MACDV1<0 and mav1<mav2 의 3개의 조건이 만족시 매도진입이 한번만 이루어지게 해주세요
2) 조건 추가: Data2의 MACD02 > 0 에서 이전 값보다 커졌을 때만 매수대응
Data2의 MACD02 < 0 에서 이전 값보다 작아졌을 때만 매도대응
3)전략화면상 MACD>0, MACD<0 상태를 구분하기위해 배경색이나 세로선으로 나놀수있나요?
#청산
1)아래 청산식에서 진입후 손절: 진입가 -15틱이 포함되어 있는지 확인부탁드립니다.
또한 진입후 청산 단계별로 수식이 맞는지 확인부탁드립니다.
매수 후
손절: 진입가 -15틱
Psar가격 상향 돌파 1차 신호시 손절값: 진입가
Psar가격 상향 돌파 2차 신호시 손절값: Psar 1차 상향돌파 신호값
PSar가격 상향 돌파 3차 신호시 손절값: Psar 2차 상향돌파 신호값
Psar가격 상항 돌파 4차 신호시 손절값: Psar 3차 상향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
매도후 (매수후 동일 로직)
손절: 진입가 -15틱
Psar가격 하향 돌파 1차 신호시 손절값: 진입가
Psar가격 하향 돌파 2차 신호시 손절값: Psar 1차 하돌파 신호값
PSar가격 하향 돌파 3차 신호시 손절값: Psar 2차 하향돌파 신호값
Psar가격 하항 돌파 4차 신호시 손절값: Psar 3차 하향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
감사드립니다.
------------------------------------------------------------------------
식
input : short(12),long(26),sig(9),P1(10),P2(30),af(0.02),maxaf(0.2);
var : MACDO1(0,data1),MACDO2(0,data2),Mjavascript:OnWrite();ACDV1(0,data1);
var : mav1(0,data1),mav2(0,data1),Psar(0,data1);
var : cnt1(0,data1),cnt2(0,data1),v1(0,data1);
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
if MACDO2 > 0 and MACDV1 > 0 and mav1 > mav2 Then
buy();
if MACDO2 < 0 and MACDV1 < 0 and mav1 < mav2 Then
sell();
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then
ExitLong("BXX",AtStop,highest(H,BarsSinceEntry)-PriceScale*5);
if crossup(c,Psar) Then{
cnt1 = cnt1+1;
v1 = c;
}
if cnt1 == 0 Then
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*30);
if cnt1 == 1 Then
ExitLong("Bx1",AtStop,EntryPrice);
if cnt1 >= 2 Then
ExitLong("Bx2",AtStop,V1);
}
Else
cnt1 = 0;
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then
ExitShort("Sxx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*5);
if CrossDown(c,Psar) Then{
cnt2 = cnt2+1;
v1 = c;
}
if cnt2 == 0 Then
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
if cnt2 == 1 Then
ExitShort("Sx1",AtStop,EntryPrice);
if cnt2 >= 2 Then
ExitShort("Sx2",AtStop,V1);
}
Else
cnt2 = 0;
답변 3
예스스탁 예스스탁 답변
2017-04-28 11:48:19
안녕하세요
예스스탁입니다.
1.
input : short(12),long(26),sig(9),P1(10),P2(30),af(0.02),maxaf(0.2);
var : MACDO1(0,data1),MACDO2(0,data2),MACDV1(0,data1);
var : mav1(0,data1),mav2(0,data1),Psar(0,data1);
var : cnt1(0,data1),cnt2(0,data1),v1(0,data1);
var : Bcond(false,data1),Scond(false,data1);
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
Bcond = MACDO2 > 0 and MACDV1 > 0 and mav1 > mav2 and MACDO2 > MACDO2[1];
Scond = MACDO2 < 0 and MACDV1 < 0 and mav1 < mav2 and MACDO2 < MACDO2[1];
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then
ExitLong("BXX",AtStop,highest(H,BarsSinceEntry)-PriceScale*5);
if crossup(c,Psar) Then{
cnt1 = cnt1+1;
v1 = c;
}
if cnt1 == 0 Then
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*30);
if cnt1 == 1 Then
ExitLong("Bx1",AtStop,EntryPrice);
if cnt1 >= 2 Then
ExitLong("Bx2",AtStop,V1);
}
Else
cnt1 = 0;
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then
ExitShort("Sxx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*5);
if CrossDown(c,Psar) Then{
cnt2 = cnt2+1;
v1 = c;
}
if cnt2 == 0 Then
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
if cnt2 == 1 Then
ExitShort("Sx1",AtStop,EntryPrice);
if cnt2 >= 2 Then
ExitShort("Sx2",AtStop,V1);
}
Else
cnt2 = 0;
2
예스랭귀지에는 바탕화면자체를 변경하는 기능은 없습니다.
비슷하게 보시기 위해서는 지표의 채우기기능을 이용해
처리해볼수는 있고 사용자분이 지표속성과 기본차트속성에서
여러가지 설정을 하셔야 합니다.
2-1
아래지표식을 작성 후 문법검증(f4) 후에
f5키를 누르시면 지표속성이 나타납니다.
input : short(12),long(26),sig(9);
var : MACDv1(0,data1);
MACDV1 = data1(MACD(short,long));
if MACDV1 > 0 Then{
plot1(9999999,"라인1");
plot2(0,"라인2");
}
Else{
plot1(0,"라인1");
plot2(9999999,"라인2");
}
2-2
지표속성창의 Y축표시탭에서 Y축을 가격으로 지정
지표속성창의 차트표시탭에서 그래프는 모두 일자그래프로 지정
지표속성창의 차트표시탭의 하단에서 채우기 클릭하고
첨부된 그림과 같이 지정 후 완료
2-3
지표를 차트에 적용하기 전에
차트의 기본차트속성에서 Y축을 화면(기본차트)로 지정 후 지표를 적용
기본차트속성은 차트에서 봉을 마우스로 더블클릭하면 나타납니다.
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 수식요청
> # 진입
1) 아래식에서는 지속적인 진입이 이루어 집니다.
MACDO2>0 and MACDV1>0 and mav1>mav2 의 3개의 조건이 만족시 매수진입이 한번만 이루어지게 해주세요
MACDO2<0 and MACDV1<0 and mav1<mav2 의 3개의 조건이 만족시 매도진입이 한번만 이루어지게 해주세요
2) 조건 추가: Data2의 MACD02 > 0 에서 이전 값보다 커졌을 때만 매수대응
Data2의 MACD02 < 0 에서 이전 값보다 작아졌을 때만 매도대응
3)전략화면상 MACD>0, MACD<0 상태를 구분하기위해 배경색이나 세로선으로 나놀수있나요?
#청산
1)아래 청산식에서 진입후 손절: 진입가 -15틱이 포함되어 있는지 확인부탁드립니다.
또한 진입후 청산 단계별로 수식이 맞는지 확인부탁드립니다.
매수 후
손절: 진입가 -15틱
Psar가격 상향 돌파 1차 신호시 손절값: 진입가
Psar가격 상향 돌파 2차 신호시 손절값: Psar 1차 상향돌파 신호값
PSar가격 상향 돌파 3차 신호시 손절값: Psar 2차 상향돌파 신호값
Psar가격 상항 돌파 4차 신호시 손절값: Psar 3차 상향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
매도후 (매수후 동일 로직)
손절: 진입가 -15틱
Psar가격 하향 돌파 1차 신호시 손절값: 진입가
Psar가격 하향 돌파 2차 신호시 손절값: Psar 1차 하돌파 신호값
PSar가격 하향 돌파 3차 신호시 손절값: Psar 2차 하향돌파 신호값
Psar가격 하항 돌파 4차 신호시 손절값: Psar 3차 하향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
감사드립니다.
------------------------------------------------------------------------
식
input : short(12),long(26),sig(9),P1(10),P2(30),af(0.02),maxaf(0.2);
var : MACDO1(0,data1),MACDO2(0,data2),Mjavascript:OnWrite();ACDV1(0,data1);
var : mav1(0,data1),mav2(0,data1),Psar(0,data1);
var : cnt1(0,data1),cnt2(0,data1),v1(0,data1);
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
if MACDO2 > 0 and MACDV1 > 0 and mav1 > mav2 Then
buy();
if MACDO2 < 0 and MACDV1 < 0 and mav1 < mav2 Then
sell();
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then
ExitLong("BXX",AtStop,highest(H,BarsSinceEntry)-PriceScale*5);
if crossup(c,Psar) Then{
cnt1 = cnt1+1;
v1 = c;
}
if cnt1 == 0 Then
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*30);
if cnt1 == 1 Then
ExitLong("Bx1",AtStop,EntryPrice);
if cnt1 >= 2 Then
ExitLong("Bx2",AtStop,V1);
}
Else
cnt1 = 0;
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then
ExitShort("Sxx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*5);
if CrossDown(c,Psar) Then{
cnt2 = cnt2+1;
v1 = c;
}
if cnt2 == 0 Then
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
if cnt2 == 1 Then
ExitShort("Sx1",AtStop,EntryPrice);
if cnt2 >= 2 Then
ExitShort("Sx2",AtStop,V1);
}
Else
cnt2 = 0;
라떼처럼
2017-04-28 12:06:02
청산식에서
진입도면 손절가: 진입가-15틱 이 수식에포함되어있나요?
포함되지 않은거 같아서요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식요청
> 안녕하세요
예스스탁입니다.
1.
input : short(12),long(26),sig(9),P1(10),P2(30),af(0.02),maxaf(0.2);
var : MACDO1(0,data1),MACDO2(0,data2),MACDV1(0,data1);
var : mav1(0,data1),mav2(0,data1),Psar(0,data1);
var : cnt1(0,data1),cnt2(0,data1),v1(0,data1);
var : Bcond(false,data1),Scond(false,data1);
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
Bcond = MACDO2 > 0 and MACDV1 > 0 and mav1 > mav2 and MACDO2 > MACDO2[1];
Scond = MACDO2 < 0 and MACDV1 < 0 and mav1 < mav2 and MACDO2 < MACDO2[1];
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then
ExitLong("BXX",AtStop,highest(H,BarsSinceEntry)-PriceScale*5);
if crossup(c,Psar) Then{
cnt1 = cnt1+1;
v1 = c;
}
if cnt1 == 0 Then
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*30);
if cnt1 == 1 Then
ExitLong("Bx1",AtStop,EntryPrice);
if cnt1 >= 2 Then
ExitLong("Bx2",AtStop,V1);
}
Else
cnt1 = 0;
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then
ExitShort("Sxx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*5);
if CrossDown(c,Psar) Then{
cnt2 = cnt2+1;
v1 = c;
}
if cnt2 == 0 Then
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
if cnt2 == 1 Then
ExitShort("Sx1",AtStop,EntryPrice);
if cnt2 >= 2 Then
ExitShort("Sx2",AtStop,V1);
}
Else
cnt2 = 0;
2
예스랭귀지에는 바탕화면자체를 변경하는 기능은 없습니다.
비슷하게 보시기 위해서는 지표의 채우기기능을 이용해
처리해볼수는 있고 사용자분이 지표속성과 기본차트속성에서
여러가지 설정을 하셔야 합니다.
2-1
아래지표식을 작성 후 문법검증(f4) 후에
f5키를 누르시면 지표속성이 나타납니다.
input : short(12),long(26),sig(9);
var : MACDv1(0,data1);
MACDV1 = data1(MACD(short,long));
if MACDV1 > 0 Then{
plot1(9999999,"라인1");
plot2(0,"라인2");
}
Else{
plot1(0,"라인1");
plot2(9999999,"라인2");
}
2-2
지표속성창의 Y축표시탭에서 Y축을 가격으로 지정
지표속성창의 차트표시탭에서 그래프는 모두 일자그래프로 지정
지표속성창의 차트표시탭의 하단에서 채우기 클릭하고
첨부된 그림과 같이 지정 후 완료
2-3
지표를 차트에 적용하기 전에
차트의 기본차트속성에서 Y축을 화면(기본차트)로 지정 후 지표를 적용
기본차트속성은 차트에서 봉을 마우스로 더블클릭하면 나타납니다.
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 수식요청
> # 진입
1) 아래식에서는 지속적인 진입이 이루어 집니다.
MACDO2>0 and MACDV1>0 and mav1>mav2 의 3개의 조건이 만족시 매수진입이 한번만 이루어지게 해주세요
MACDO2<0 and MACDV1<0 and mav1<mav2 의 3개의 조건이 만족시 매도진입이 한번만 이루어지게 해주세요
2) 조건 추가: Data2의 MACD02 > 0 에서 이전 값보다 커졌을 때만 매수대응
Data2의 MACD02 < 0 에서 이전 값보다 작아졌을 때만 매도대응
3)전략화면상 MACD>0, MACD<0 상태를 구분하기위해 배경색이나 세로선으로 나놀수있나요?
#청산
1)아래 청산식에서 진입후 손절: 진입가 -15틱이 포함되어 있는지 확인부탁드립니다.
또한 진입후 청산 단계별로 수식이 맞는지 확인부탁드립니다.
매수 후
손절: 진입가 -15틱
Psar가격 상향 돌파 1차 신호시 손절값: 진입가
Psar가격 상향 돌파 2차 신호시 손절값: Psar 1차 상향돌파 신호값
PSar가격 상향 돌파 3차 신호시 손절값: Psar 2차 상향돌파 신호값
Psar가격 상항 돌파 4차 신호시 손절값: Psar 3차 상향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
매도후 (매수후 동일 로직)
손절: 진입가 -15틱
Psar가격 하향 돌파 1차 신호시 손절값: 진입가
Psar가격 하향 돌파 2차 신호시 손절값: Psar 1차 하돌파 신호값
PSar가격 하향 돌파 3차 신호시 손절값: Psar 2차 하향돌파 신호값
Psar가격 하항 돌파 4차 신호시 손절값: Psar 3차 하향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
감사드립니다.
------------------------------------------------------------------------
식
input : short(12),long(26),sig(9),P1(10),P2(30),af(0.02),maxaf(0.2);
var : MACDO1(0,data1),MACDO2(0,data2),Mjavascript:OnWrite();ACDV1(0,data1);
var : mav1(0,data1),mav2(0,data1),Psar(0,data1);
var : cnt1(0,data1),cnt2(0,data1),v1(0,data1);
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
if MACDO2 > 0 and MACDV1 > 0 and mav1 > mav2 Then
buy();
if MACDO2 < 0 and MACDV1 < 0 and mav1 < mav2 Then
sell();
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then
ExitLong("BXX",AtStop,highest(H,BarsSinceEntry)-PriceScale*5);
if crossup(c,Psar) Then{
cnt1 = cnt1+1;
v1 = c;
}
if cnt1 == 0 Then
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*30);
if cnt1 == 1 Then
ExitLong("Bx1",AtStop,EntryPrice);
if cnt1 >= 2 Then
ExitLong("Bx2",AtStop,V1);
}
Else
cnt1 = 0;
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then
ExitShort("Sxx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*5);
if CrossDown(c,Psar) Then{
cnt2 = cnt2+1;
v1 = c;
}
if cnt2 == 0 Then
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
if cnt2 == 1 Then
ExitShort("Sx1",AtStop,EntryPrice);
if cnt2 >= 2 Then
ExitShort("Sx2",AtStop,V1);
}
Else
cnt2 = 0;
예스스탁 예스스탁 답변
2017-04-28 12:43:57
안녕하세요
예스스탁입니다.
현재 진입하면 30틱 손절
이후 파라볼릭 돌파/이탈에 따라 값이 조정됩니다.
최초 설정을 15틱으로 하고자 하시면
수식내 bx0,sx0처산의 *30을 *15로 숫자만 변경하시면 됩니다.
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*15);
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : Re : Re : 수식 요청
> 청산식에서
진입도면 손절가: 진입가-15틱 이 수식에포함되어있나요?
포함되지 않은거 같아서요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식요청
> 안녕하세요
예스스탁입니다.
1.
input : short(12),long(26),sig(9),P1(10),P2(30),af(0.02),maxaf(0.2);
var : MACDO1(0,data1),MACDO2(0,data2),MACDV1(0,data1);
var : mav1(0,data1),mav2(0,data1),Psar(0,data1);
var : cnt1(0,data1),cnt2(0,data1),v1(0,data1);
var : Bcond(false,data1),Scond(false,data1);
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
Bcond = MACDO2 > 0 and MACDV1 > 0 and mav1 > mav2 and MACDO2 > MACDO2[1];
Scond = MACDO2 < 0 and MACDV1 < 0 and mav1 < mav2 and MACDO2 < MACDO2[1];
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then
ExitLong("BXX",AtStop,highest(H,BarsSinceEntry)-PriceScale*5);
if crossup(c,Psar) Then{
cnt1 = cnt1+1;
v1 = c;
}
if cnt1 == 0 Then
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*30);
if cnt1 == 1 Then
ExitLong("Bx1",AtStop,EntryPrice);
if cnt1 >= 2 Then
ExitLong("Bx2",AtStop,V1);
}
Else
cnt1 = 0;
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then
ExitShort("Sxx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*5);
if CrossDown(c,Psar) Then{
cnt2 = cnt2+1;
v1 = c;
}
if cnt2 == 0 Then
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
if cnt2 == 1 Then
ExitShort("Sx1",AtStop,EntryPrice);
if cnt2 >= 2 Then
ExitShort("Sx2",AtStop,V1);
}
Else
cnt2 = 0;
2
예스랭귀지에는 바탕화면자체를 변경하는 기능은 없습니다.
비슷하게 보시기 위해서는 지표의 채우기기능을 이용해
처리해볼수는 있고 사용자분이 지표속성과 기본차트속성에서
여러가지 설정을 하셔야 합니다.
2-1
아래지표식을 작성 후 문법검증(f4) 후에
f5키를 누르시면 지표속성이 나타납니다.
input : short(12),long(26),sig(9);
var : MACDv1(0,data1);
MACDV1 = data1(MACD(short,long));
if MACDV1 > 0 Then{
plot1(9999999,"라인1");
plot2(0,"라인2");
}
Else{
plot1(0,"라인1");
plot2(9999999,"라인2");
}
2-2
지표속성창의 Y축표시탭에서 Y축을 가격으로 지정
지표속성창의 차트표시탭에서 그래프는 모두 일자그래프로 지정
지표속성창의 차트표시탭의 하단에서 채우기 클릭하고
첨부된 그림과 같이 지정 후 완료
2-3
지표를 차트에 적용하기 전에
차트의 기본차트속성에서 Y축을 화면(기본차트)로 지정 후 지표를 적용
기본차트속성은 차트에서 봉을 마우스로 더블클릭하면 나타납니다.
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 수식요청
> # 진입
1) 아래식에서는 지속적인 진입이 이루어 집니다.
MACDO2>0 and MACDV1>0 and mav1>mav2 의 3개의 조건이 만족시 매수진입이 한번만 이루어지게 해주세요
MACDO2<0 and MACDV1<0 and mav1<mav2 의 3개의 조건이 만족시 매도진입이 한번만 이루어지게 해주세요
2) 조건 추가: Data2의 MACD02 > 0 에서 이전 값보다 커졌을 때만 매수대응
Data2의 MACD02 < 0 에서 이전 값보다 작아졌을 때만 매도대응
3)전략화면상 MACD>0, MACD<0 상태를 구분하기위해 배경색이나 세로선으로 나놀수있나요?
#청산
1)아래 청산식에서 진입후 손절: 진입가 -15틱이 포함되어 있는지 확인부탁드립니다.
또한 진입후 청산 단계별로 수식이 맞는지 확인부탁드립니다.
매수 후
손절: 진입가 -15틱
Psar가격 상향 돌파 1차 신호시 손절값: 진입가
Psar가격 상향 돌파 2차 신호시 손절값: Psar 1차 상향돌파 신호값
PSar가격 상향 돌파 3차 신호시 손절값: Psar 2차 상향돌파 신호값
Psar가격 상항 돌파 4차 신호시 손절값: Psar 3차 상향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
매도후 (매수후 동일 로직)
손절: 진입가 -15틱
Psar가격 하향 돌파 1차 신호시 손절값: 진입가
Psar가격 하향 돌파 2차 신호시 손절값: Psar 1차 하돌파 신호값
PSar가격 하향 돌파 3차 신호시 손절값: Psar 2차 하향돌파 신호값
Psar가격 하항 돌파 4차 신호시 손절값: Psar 3차 하향돌파 신호값
30틱 이상 상승시 최고값대비 -5틱 청산
감사드립니다.
------------------------------------------------------------------------
식
input : short(12),long(26),sig(9),P1(10),P2(30),af(0.02),maxaf(0.2);
var : MACDO1(0,data1),MACDO2(0,data2),Mjavascript:OnWrite();ACDV1(0,data1);
var : mav1(0,data1),mav2(0,data1),Psar(0,data1);
var : cnt1(0,data1),cnt2(0,data1),v1(0,data1);
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
MACDV1 = data1(MACD(short,long));
MACDO1 = data1(MACD_OSC(short,long,sig));
MACDO2 = data2(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
Psar = data1(sar(af,maxaf));
if MACDO2 > 0 and MACDV1 > 0 and mav1 > mav2 Then
buy();
if MACDO2 < 0 and MACDV1 < 0 and mav1 < mav2 Then
sell();
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then
ExitLong("BXX",AtStop,highest(H,BarsSinceEntry)-PriceScale*5);
if crossup(c,Psar) Then{
cnt1 = cnt1+1;
v1 = c;
}
if cnt1 == 0 Then
ExitLong("Bx0",AtStop,EntryPrice-PriceScale*30);
if cnt1 == 1 Then
ExitLong("Bx1",AtStop,EntryPrice);
if cnt1 >= 2 Then
ExitLong("Bx2",AtStop,V1);
}
Else
cnt1 = 0;
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then
ExitShort("Sxx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*5);
if CrossDown(c,Psar) Then{
cnt2 = cnt2+1;
v1 = c;
}
if cnt2 == 0 Then
ExitShort("Sx0",AtStop,EntryPrice+PriceScale*30);
if cnt2 == 1 Then
ExitShort("Sx1",AtStop,EntryPrice);
if cnt2 >= 2 Then
ExitShort("Sx2",AtStop,V1);
}
Else
cnt2 = 0;