커뮤니티
문의드립니다
2017-10-11 22:26:24
154
글번호 113307
@문의1) *식1 참조, 첨부파일 참조
아래식은 첨부 그림에서와 같이 시작시간 후 진입 조건이 되면 바로 진입이 됩니다
(시작시간 전 Crossup(mav2,mav3) 된 상태에서 조건이 만족 됨)
시작 시간 전 Crossup/down(mav2,mav3) 조건은 무시하고 셋팅 시작 시간 이후의 cross up/down(mav2,mav3) 이 되면 진입이 되도록 수정 요청드립니다
@문의2) *식2 참조
청산 식에서 파라볼릭 신호에 의한 청산이 이루어 지지 않았습니다.
60틱 이상이 된후 파라볼릭 신호에 의해 청산이 되어야하는데 60이하로 다시 상승된 상태에서 파라볼릭 신호가 발생하여 청산이 안된듯 합니다.
60이상이 한번이라도 되면 파라볼릭 신호에 의해 청산이 되도록 수정 요청드립니다.
***식1)
input : short(12),long(26),sig(9),P1(3),P2(30),P3(120);
input : 시작시간(223000), 종료시간(050000);
input : 진입회수(1);
var : mav1(0,data1),mav2(0,data1),mav3(0,data1);
var : Tcond(False,data1),Bcount(0,data1),Scount(0,data1);
var : MACDO2(0,data2), MACDV2(0,data2);
var : BH(0,data1),SL(0,data1);
MACDO2 = data2(MACD_OSC(short,long,sig));
MACDV2 = data2(MACD(short,long));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
mav3 = data1(ma(c,P3));
if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
Bcount = 0;
Scount = 0;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
}
//진입회수
if MarketPosition != MarketPosition[1] and MarketPosition == 1 Then
Bcount = Bcount+1;
if MarketPosition != MarketPosition[1] and MarketPosition == -1 Then
Scount = Scount+1;
//진입
if Tcond == true Then{
if Bcount < 진입회수 and MACDO2 > MACDO2[1] and MACDV2 > MACDV2[1] and crossup(mav2,mav3) Then buy("Buy");
if Scount < 진입회수 and MACDO2 < MACDO2[1] and MACDV2 < MACDV2[1] and CrossDown(mav2,mav3) Then sell("Sell");
}
//청산1
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if BH >= EntryPrice+PriceScale*30 and BH < EntryPrice+PriceScale*40 Then
ExitLong("B익절1",AtStop,BH-PriceScale*10);
if BH >= EntryPrice+PriceScale*40 Then
ExitLong("B익절2",AtStop,BH-PriceScale*5);
ExitLong("B손절",AtStop,EntryPrice-PriceScale*30);
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if SL <= EntryPrice-PriceScale*301 and SL > EntryPrice-PriceScale*40 Then
ExitShort("S익절1",AtStop,SL+PriceScale*101);
if SL <= EntryPrice-PriceScale*40 Then
ExitShort("S익절2",AtStop,sL+PriceScale*5);
ExitShort("S손절",AtStop,EntryPrice+PriceScale*30);
}
if 종료시간 <= sTime and sTime < 시작시간 then {
if MarketPosition == 1 then{
ExitLong("B장종료");
}
if MarketPosition == -1 then{
ExitShort("S장종료");
}
}
***식2)
input : short(12),long(26),sig(9),P1(3),P2(30),P3(120);
input : af(0.02),maxaf(0.2);
input : 시작시간(110000), 종료시간(150000);
input : 진입회수(1);
var : mav1(0,data1),mav2(0,data1),mav3(0,data1);
var : Tcond(False,data1),Bcount(0,data1),Scount(0,data1);
var : MACDO2(0,data2), MACDO1(0,data1);
var : BH(0,data1), SL(0,data1);
var : para(0,data1);
MACDO2 = data2(MACD_OSC(short,long,sig));
MACDO1 = data1(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
mav3 = data1(ma(c,P3));
para = data1(sar(af,maxaf));
if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
Bcount = 0;
Scount = 0;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
}
//진입회수
if MarketPosition != MarketPosition[1] and MarketPosition == 1 Then
Bcount = Bcount+1;
if MarketPosition != MarketPosition[1] and MarketPosition == -1 Then
Scount = Scount+1;
//진입
if Tcond == true Then{
if Bcount < 진입회수 and MACDO2 > MACDO2[1] and crossup(mav2,mav3) Then buy("Buy");
if Scount < 진입회수 and MACDO2 < MACDO2[1] and CrossDown(mav2,mav3) Then sell("Sell");
}
//청산2
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if BH >= EntryPrice+PriceScale*40 and BH < EntryPrice+PriceScale*60 Then
ExitLong("B익절1",AtStop,BH-PriceScale*20);
if BH >= EntryPrice+PriceScale*60 and CrossDown(C,para) Then
ExitLong("B익절Pa");
ExitLong("B손절",AtStop,EntryPrice-PriceScale*40);
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if SL <= EntryPrice-PriceScale*40 and SL > EntryPrice-PriceScale*60 Then
ExitShort("S익절1",AtStop,SL+PriceScale*20);
if SL <= EntryPrice-PriceScale*60 and CrossUp(C,para) Then
ExitShort("S익절Pa");
ExitShort("S손절",AtStop,EntryPrice+PriceScale*40);
}
if 종료시간 <= sTime or sTime < 시작시간 then {
if MarketPosition == 1 then{
ExitLong("B장종료");
}
if MarketPosition == -1 then{
ExitShort("S장종료");
}
}
- 1. 20171010_230732.jpg (0.10 MB)
답변 1
예스스탁 예스스탁 답변
2017-10-12 16:37:51
안녕하세요
예스스탁입니다
2개 내용 모두 식을 수정해 드릴부분이 없습니다.
수식 내용 독해하시기 바랍니다.
1.
if Tcond == true Then{
if Bcount < 진입회수 and MACDO2 > MACDO2[1] and MACDV2 > MACDV2[1] and crossup(mav2,mav3) Then buy("Buy");
if Scount < 진입회수 and MACDO2 < MACDO2[1] and MACDV2 < MACDV2[1] and CrossDown(mav2,mav3) Then sell("Sell");
}
수식1은 진입자체가 현재봉에서
crossup(mav2,mav3),CrossDown(mav2,mav3)이 발생해야 신호가 발생합니다.
이전 cross된 상태여부로 체크하지 않습니다.
2
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if BH >= EntryPrice+PriceScale*40 and BH < EntryPrice+PriceScale*60 Then
ExitLong("B익절1",AtStop,BH-PriceScale*20);
if BH >= EntryPrice+PriceScale*60 and CrossDown(C,para) Then
ExitLong("B익절Pa");
ExitLong("B손절",AtStop,EntryPrice-PriceScale*40);
}
매수진입후 최고가(BH)가 진입가보다 60틱 이상 크고 파라볼릭 하향이탈하면 청산(B익절Pa)
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if SL <= EntryPrice-PriceScale*40 and SL > EntryPrice-PriceScale*60 Then
ExitShort("S익절1",AtStop,SL+PriceScale*20);
if SL <= EntryPrice-PriceScale*60 and CrossUp(C,para) Then
ExitShort("S익절Pa");
ExitShort("S손절",AtStop,EntryPrice+PriceScale*40);
}
매수진입후 최저가(BL)가 진입가대비 60틱 이상 작고 파라볼릭 상향돌파하면 청산(S익절Pa)
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 문의드립니다
> @문의1) *식1 참조, 첨부파일 참조
아래식은 첨부 그림에서와 같이 시작시간 후 진입 조건이 되면 바로 진입이 됩니다
(시작시간 전 Crossup(mav2,mav3) 된 상태에서 조건이 만족 됨)
시작 시간 전 Crossup/down(mav2,mav3) 조건은 무시하고 셋팅 시작 시간 이후의 cross up/down(mav2,mav3) 이 되면 진입이 되도록 수정 요청드립니다
@문의2) *식2 참조
청산 식에서 파라볼릭 신호에 의한 청산이 이루어 지지 않았습니다.
60틱 이상이 된후 파라볼릭 신호에 의해 청산이 되어야하는데 60이하로 다시 상승된 상태에서 파라볼릭 신호가 발생하여 청산이 안된듯 합니다.
60이상이 한번이라도 되면 파라볼릭 신호에 의해 청산이 되도록 수정 요청드립니다.
***식1)
input : short(12),long(26),sig(9),P1(3),P2(30),P3(120);
input : 시작시간(223000), 종료시간(050000);
input : 진입회수(1);
var : mav1(0,data1),mav2(0,data1),mav3(0,data1);
var : Tcond(False,data1),Bcount(0,data1),Scount(0,data1);
var : MACDO2(0,data2), MACDV2(0,data2);
var : BH(0,data1),SL(0,data1);
MACDO2 = data2(MACD_OSC(short,long,sig));
MACDV2 = data2(MACD(short,long));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
mav3 = data1(ma(c,P3));
if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
Bcount = 0;
Scount = 0;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
}
//진입회수
if MarketPosition != MarketPosition[1] and MarketPosition == 1 Then
Bcount = Bcount+1;
if MarketPosition != MarketPosition[1] and MarketPosition == -1 Then
Scount = Scount+1;
//진입
if Tcond == true Then{
if Bcount < 진입회수 and MACDO2 > MACDO2[1] and MACDV2 > MACDV2[1] and crossup(mav2,mav3) Then buy("Buy");
if Scount < 진입회수 and MACDO2 < MACDO2[1] and MACDV2 < MACDV2[1] and CrossDown(mav2,mav3) Then sell("Sell");
}
//청산1
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if BH >= EntryPrice+PriceScale*30 and BH < EntryPrice+PriceScale*40 Then
ExitLong("B익절1",AtStop,BH-PriceScale*10);
if BH >= EntryPrice+PriceScale*40 Then
ExitLong("B익절2",AtStop,BH-PriceScale*5);
ExitLong("B손절",AtStop,EntryPrice-PriceScale*30);
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if SL <= EntryPrice-PriceScale*301 and SL > EntryPrice-PriceScale*40 Then
ExitShort("S익절1",AtStop,SL+PriceScale*101);
if SL <= EntryPrice-PriceScale*40 Then
ExitShort("S익절2",AtStop,sL+PriceScale*5);
ExitShort("S손절",AtStop,EntryPrice+PriceScale*30);
}
if 종료시간 <= sTime and sTime < 시작시간 then {
if MarketPosition == 1 then{
ExitLong("B장종료");
}
if MarketPosition == -1 then{
ExitShort("S장종료");
}
}
***식2)
input : short(12),long(26),sig(9),P1(3),P2(30),P3(120);
input : af(0.02),maxaf(0.2);
input : 시작시간(110000), 종료시간(150000);
input : 진입회수(1);
var : mav1(0,data1),mav2(0,data1),mav3(0,data1);
var : Tcond(False,data1),Bcount(0,data1),Scount(0,data1);
var : MACDO2(0,data2), MACDO1(0,data1);
var : BH(0,data1), SL(0,data1);
var : para(0,data1);
MACDO2 = data2(MACD_OSC(short,long,sig));
MACDO1 = data1(MACD_OSC(short,long,sig));
mav1 = data1(ma(c,P1));
mav2 = data1(ma(c,P2));
mav3 = data1(ma(c,P3));
para = data1(sar(af,maxaf));
if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
Bcount = 0;
Scount = 0;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
}
//진입회수
if MarketPosition != MarketPosition[1] and MarketPosition == 1 Then
Bcount = Bcount+1;
if MarketPosition != MarketPosition[1] and MarketPosition == -1 Then
Scount = Scount+1;
//진입
if Tcond == true Then{
if Bcount < 진입회수 and MACDO2 > MACDO2[1] and crossup(mav2,mav3) Then buy("Buy");
if Scount < 진입회수 and MACDO2 < MACDO2[1] and CrossDown(mav2,mav3) Then sell("Sell");
}
//청산2
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if BH >= EntryPrice+PriceScale*40 and BH < EntryPrice+PriceScale*60 Then
ExitLong("B익절1",AtStop,BH-PriceScale*20);
if BH >= EntryPrice+PriceScale*60 and CrossDown(C,para) Then
ExitLong("B익절Pa");
ExitLong("B손절",AtStop,EntryPrice-PriceScale*40);
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if SL <= EntryPrice-PriceScale*40 and SL > EntryPrice-PriceScale*60 Then
ExitShort("S익절1",AtStop,SL+PriceScale*20);
if SL <= EntryPrice-PriceScale*60 and CrossUp(C,para) Then
ExitShort("S익절Pa");
ExitShort("S손절",AtStop,EntryPrice+PriceScale*40);
}
if 종료시간 <= sTime or sTime < 시작시간 then {
if MarketPosition == 1 then{
ExitLong("B장종료");
}
if MarketPosition == -1 then{
ExitShort("S장종료");
}
}
다음글
이전글