답변완료
같은 질문을 여러번 드려서 죄송합니다
if MarketPosition == 1 Then
{
if C < lowest(L,15)[BarsSinceEntry] Then
ExitLong("bx1");
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*틱1 Then
ExitLong("bx2",AtStop,EntryPrice+수익틱1*PriceScale);
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*틱2 Then
ExitLong("bx3",AtStop,EntryPrice+수익틱2*PriceScale);
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*틱3 Then
ExitLong("bx4",AtStop,EntryPrice+수익틱3*PriceScale);
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*틱4 Then
ExitLong("bx5",AtStop,EntryPrice+수익틱4*PriceScale);
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*틱5 Then
ExitLong("bx6",AtStop,EntryPrice+수익틱5*PriceScale);
ExitLong("bx7",AtLimit,EntryPrice+최종완청틱 *PriceScale);
}
if MarketPosition == -1 Then
{
if C > Highest(H,15)[BarsSinceEntry] Then
ExitShort("sx1");
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*틱1 Then
ExitShort("sx2",AtStop,EntryPrice+수익틱1*PriceScale);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*틱2 Then
ExitShort("sx3",AtStop,EntryPrice+수익틱2*PriceScale);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*틱3 Then
ExitShort("sx4",AtStop,EntryPrice+수익틱3*PriceScale);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*틱4 Then
ExitShort("sx5",AtStop,EntryPrice+수익틱4*PriceScale);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*틱5 Then
ExitShort("sx6",AtStop,EntryPrice+수익틱5*PriceScale);
ExitShort("sx7",AtLimit,EntryPrice+최종완청틱 *PriceScale);
}
매수 매도 손절 문제
매도 수익문제
매수는 정상
최송완정문제
이렇게 확인좀 부탁합니다 중간 중간에 기호로 변경해도 정답이 없네요
손절 --- 진입봉 기준 이전 15봉중에서 매도는 최고가 매수는 최저가 이탈시 손절입니다
청산 --- 50틱 수익나고 내려오면 10틱 챙기자 이런 식입니다
꼼꼼이좀 봐주세요
참 손절보다 다음 신호가 나오면 신호가 우선입니다
손절도 외부 변수로 가능하면 부탁합니다
2021-03-11
849
글번호 147012
시스템
답변완료
Re : 지표 문의드립니다
아래와 같이 수고스런 답변주셔서 대단히 감사드립니다.
한번만 더 요청을 드립니다.
일봉의 2일이평과 5일이평도 추가하고 싶습니다.
번거롭지만 꼭 부탁드립니다.
감사합니다 꾸벅
안녕하세요
예스스탁입니다.
input : ntime1(2),P1(60),P2(120);
input : ntime2(30);
var : S1(0),D1(0),TM(0),TF1(0),cnt(0),TF2(0);
var : sum1(0),mav1(0),sum2(0),mav2(0);
Array : CC[200](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%ntime1;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 199
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
#plot1(mav1,"이평1");
}
if CC[P2-1] > 0 then
{
sum2 = 0;
for cnt = 0 to P2-1
{
sum2 = sum2+CC[cnt];
}
mav2 = sum2/P2;
#plot2(mav2,"이평2");
}
TF2 = TM%ntime2;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then
{
if mav1 > 0 Then
var1 = mav1;
if mav2 > 0 Then
var2 = mav2;
}
if var1 > 0 Then
Plot3(var1);
if var2 > 0 Then
Plot4(var2);
}
즐거운 하루되세요
> 포보스 님이 쓴 글입니다.
> 제목 : 지표 문의드립니다
> 틱챠트에서
2분봉챠트의 60이평과 120이평값을 30분단위로 가로선으로 표기하고 싶습니다.
마치 당일 중심선 그려나가듯이 말이죠.
어려운 부탁인줄 아오나 꼭 부탁드립니다.
감사합니다.
2021-03-11
845
글번호 147011
지표
답변완료
수식부탁드립니다.
안녕하세요
제가 설명이 부족했습니다.
선물 수식
매수식
if MarketPosition == 0 and OpenD(0)< Close and crossup(ma5.ma20) then buy;
if crossdown(c,OpenD(0) then ExitLong;
매도식
if MarketPosition == 0 and OpenD(0)> Close and crossdown(ma5,ma20) then sell;
if crossup(c,OpenD(0) then Exitshort;
옵션수식 (data2는 선물지수)
콜
if data2(OpenD(0)< Close) and data2(crossup(ma5.ma20)) then buy;
if crossdown(data2(c),data2(OpenD(0)) then ExitLong;
풋
if data2(OpenD(0)> Close) and data2(crossdown(ma5,ma20)) then buy;
if crossup(data2(c),data2(OpenD(0))) then Exitshort;
위와 같이 data2의 같은 선물지수의 신호를 가지고 옵션을 매수 하는 경우를 말씀 드린사항 입니다.
옵션은 종목 매수만 하는것이지 신호에 전혀 영항을 주지 않습니다.
이 경우 콜과 풋에 동시에 진입하는 경우를 제외 하는 수식이 있을까요?
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 부탁 드립니다,
> 안녕하세요
예스스탁입니다.
문의하신 내용은 구현이 가능하지 않습니다.
MarketPosition은 차트 신호상 포지션 상태입니다.
랭귀지의 모든 포지션 함수는 차트 신호상 포지션과 관계된 내용입니다.
실제 계좌의 내용을 리턴하지 않습니다.
시스템은 차트에 적용되면 각 시스템별로 독립적으로 구동이 됩니다.
다른 차트에 적용된 시스템의 신호상태를 알수 없습니다.
즐거운 하루되세요
> orfeu 님이 쓴 글입니다.
> 제목 : 수식 부탁 드립니다,
> 안녕하세요.
선물로 매수, 매도식식을 만들었는데, 옵션에 적용하다보니 궁금한사항이 있습니다.
선물 수식
매수식
if MarketPosition == 0 and OpenD(0)< Close and crossup(ma5.ma20) then buy;
if crossdown(c,OpenD(0) then ExitLong;
매도식
if MarketPosition == 0 and OpenD(0)> Close and crossdown(ma5,ma20) then sell;
if crossup(c,OpenD(0) then Exitshort;
위 수식을 매수는 콜옵션에, 매도는 풋 옵션에 적용하려고 하면
선물수식에서 매수중에는 매도로 진입안되고, 매도중에는 매수가 진입안되게 하였는데
콜옵션에 단순히 위 매수식을 넣고, 풋옵션에 단순히 위 매도식을 넣으면,
서로의 진입 여부가 확인 되지않아
콜과 풋에 동시에 진입하는 경우가 발생 합니다.
condition 함수를 사용하면 동시 진입이 안되게 할수 있을것 같은데
정확히 모르겠습니다.
수식 부탁 드립니다.
2021-03-11
947
글번호 147010
시스템
답변완료
청산 후 재진입 수식
안녕하세요 ^^ 청산후 재진입 수식에 대한 질문입니다
청산후 2개봉 이후에 재진입을 하고싶은데 청산직후에 바로 진입이 들어가고 있습니다.
진입수식에 barssinceexit(1) > 2 를 넣으면 매매신호가 전혀 발생하지 않네요
var : mp(0);
if mp == 0 and mp[1] <> 0 then recnt = 1;
if mp == 0 then recnt = recnt + 1;
if mp <> 0 then recnt = 0;
또는 진입수식에 recnt > 1을 넣어도 청산후 재진입이 바로 되고 있습니다. 방법 좀 알려주시면 감사하겠습니다 ^^
아래 수식 참고해주십쇼 ^^
input : Highest_(10), Lowest_(10),TARGET(60);
var : pl(0),mp(0),recnt(0),p(0),pp(0);
p = IFf(CountIf(CrossDown(c,Ema(c,60)),10) >= 1,20,0);
if MarketPosition == 0 and h < Ema(c,60) Then Sell("s",AtStop,Lowest(l,Lowest_)- 20 -p );
if MarketPosition == -1 Then begin
if BarsSinceEntry < 3 Then ExitShort("es1",AtStop,Lowest(l,BarsSinceEntry) + 20);
else ExitShort("es",AtStop,Ema(c,60)+10);
End;
SetStopTrailing(20,100,PointStop);
2021-03-11
758
글번호 147009
시스템