커뮤니티
수식 문의 드립니다.
2012-01-16 06:37:52
584
글번호 46620
챠트에 전략이 실행되면 진입가격과 청산가격을 알려주고 진입하는 바의 색깔을 바꿔주는 트레이드스테이션 로직입니다.
아래 수식을 예스트레이더에서 적용되게 변환 부탁드립니다. 그럼 수고하세요^^
그냥 진입가격과 청산가격을 시스템이 적용된 차트의 신호 아래 표시되게 로직을 작성해 주셔도 됩니다.
input : tradingcost(50000); {tradingcost = slippage + commision}
var: entryflag(0),entryreverseflag(0);
if barnumber = 1 then cleardebug;
if i_marketposition = 1 then entryreverseflag = 1;
if i_marketposition = -1 then entryreverseflag = -1;
if i_marketposition = 0 then entryflag = 0;
if i_marketposition = 0 and entryflag[1] <> entryflag then entryflag = 1;
if i_marketposition <> 0 and entryreverseflag[1] <> entryreverseflag then entryflag = -1;
If i_marketposition <> 0 and entryflag <= 0 then begin
value1 = Text_New(Date,time,high,numtostr(i_avgentryprice,2));
value2 = I_avgentryprice;
value3 = i_closedEquity;
value4 = i_marketposition;
entryflag = 1;
end;
If i_marketposition = 0 and entryflag = 1 then begin
value1 = Text_New(Date,time,high,numtostr(value2 + (i_closedEquity - value3 + tradingcost) * value4/bigpointvalue,2));
entryflag = 0;
end;
if i_marketposition = 1 then begin
plot1(high, "mp", red, default, 1);
plot2(Low, "mp2", red, default, 1);
end
else if i_marketposition = -1 then begin
plot1(high, "mp", blue, default, 1);
plot2(Low, "mp2", blue, default, 1);
end
else begin
noplot(1);
noplot(2);
end;
답변 1
예스스탁 예스스탁 답변
2012-01-16 11:26:56
안녕하세요
예스스탁입니다.
올려주신 식은 예스랭귀지로 변환하여 사용하실 수 없습니다.
예스랭귀지의 지표편집창에는 시스템과 관련된 함수는 사용할 수 없고
시스템편집창에서는 plot명령어를 사용할 수 없어
변환이 가능하지 않습니다.
즐거운 하루되세요
> 무명 님이 쓴 글입니다.
> 제목 : 수식 문의 드립니다.
> 챠트에 전략이 실행되면 진입가격과 청산가격을 알려주고 진입하는 바의 색깔을 바꿔주는 트레이드스테이션 로직입니다.
아래 수식을 예스트레이더에서 적용되게 변환 부탁드립니다. 그럼 수고하세요^^
그냥 진입가격과 청산가격을 시스템이 적용된 차트의 신호 아래 표시되게 로직을 작성해 주셔도 됩니다.
input : tradingcost(50000); {tradingcost = slippage + commision}
var: entryflag(0),entryreverseflag(0);
if barnumber = 1 then cleardebug;
if i_marketposition = 1 then entryreverseflag = 1;
if i_marketposition = -1 then entryreverseflag = -1;
if i_marketposition = 0 then entryflag = 0;
if i_marketposition = 0 and entryflag[1] <> entryflag then entryflag = 1;
if i_marketposition <> 0 and entryreverseflag[1] <> entryreverseflag then entryflag = -1;
If i_marketposition <> 0 and entryflag <= 0 then begin
value1 = Text_New(Date,time,high,numtostr(i_avgentryprice,2));
value2 = I_avgentryprice;
value3 = i_closedEquity;
value4 = i_marketposition;
entryflag = 1;
end;
If i_marketposition = 0 and entryflag = 1 then begin
value1 = Text_New(Date,time,high,numtostr(value2 + (i_closedEquity - value3 + tradingcost) * value4/bigpointvalue,2));
entryflag = 0;
end;
if i_marketposition = 1 then begin
plot1(high, "mp", red, default, 1);
plot2(Low, "mp2", red, default, 1);
end
else if i_marketposition = -1 then begin
plot1(high, "mp", blue, default, 1);
plot2(Low, "mp2", blue, default, 1);
end
else begin
noplot(1);
noplot(2);
end;
다음글
이전글