커뮤니티
조합
2019-04-18 17:03:39
226
글번호 127963
////
이것을 조합하니 않되네요
- 아이디어는 1분봉 교차때 3 계약 사고 청산은 3분봉 으로 하나는 90틱에 10틱 스탑트레일링
하나는 40틱에 10틱 스탑트레일일 나머지는 한계약은 교차시 , 스탑트레일링이 오지 않으면 교차시 , 손절은 14틱 ..
- 매도도 3계약 , 매도청산도 같은 방법 ..
1분봉 차트에 동일종목으로 3분봉 데이타를 참조데이타로 추가하고
식 적용하셔야 합니다.
1
var : XClose1(0,data1),Xopen1(0,data1),Xhigh1(0,data1),Xlow1(0,data1);
var : XClose2(0,data2),Xopen2(0,data2),Xhigh2(0,data2),Xlow2(0,data2);
var : idx(0,data2);
xClose1 = data1((Open+High+Low+Close)/4);
xOpen1 = data1((Open[1] + Close[1])/2);
xHigh1 = data1(Max(High, xOpen1, xClose1));
xLow1 = data1(Min(Low, xOpen1, xClose1));
xClose2 = data2((Open+High+Low+Close)/4);
xOpen2 = data2((Open[1] + Close[1])/2);
xHigh2 = data2(Max(High, xOpen2, xClose2));
xLow2 = data2(Min(Low, xOpen2, xClose2));
if MarketPosition == 0 and xClose1 > xOpen1 Then
{
buy("b",OnClose,def,3);
idx = data2(index);
}
if MarketPosition >= 1 and xClose2 < xOpen2 and data2(index) > idx Then
{
idx = data2(index);
exitlong("bx",OnClose,def,"",1,2);
}
2
atstop,atlimit은 지정한 가겨과 현재가를 비교해 즉시 신호를 발생하는 내용입니다.
지정한 가격과 기본종목의 현재가하고만 비교합니다.
손절은 변경해 드릴 내용이 없고 트레일링스탑만 수익체크만 data2를 참고하게 변경해 드립니다.
input : n(20);
var : h2(0,data1),L2(0,data1);
h2 = data2(h);
l2 = data2(l);
if MarketPosition == 1 Then
{
ExitLong("bx",AtStop,EntryPrice-PriceScale*n);
if highest(H2,BarsSinceEntry) >= EntryPrice+PriceScale*40 Then
ExitLong("bp1",AtStop,highest(H2,BarsSinceEntry)-PriceScale*10,"",1,1);
if highest(H2,BarsSinceEntry) >= EntryPrice+PriceScale*90 Then
ExitLong("bp2",AtStop,highest(H2,BarsSinceEntry)-PriceScale*10,"",1,1);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtStop,EntryPrice+PriceScale*n);
if Lowest(L2,BarsSinceEntry) <= EntryPrice-PriceScale*40 Then
ExitShort("sp1",AtStop,Lowest(L2,BarsSinceEntry)+PriceScale*10,"",1,1);
if Lowest(L2,BarsSinceEntry) <= EntryPrice-PriceScale*90 Then
ExitShort("sp2",AtStop,Lowest(L2,BarsSinceEntry)+PriceScale*10,"",1,1);
}
답변 1
예스스탁 예스스탁 답변
2019-04-19 17:38:15
> 구다이전설 님이 쓴 글입니다.
> 제목 : 조합
> ////
이것을 조합하니 않되네요
- 아이디어는 1분봉 교차때 3 계약 사고 청산은 3분봉 으로 하나는 90틱에 10틱 스탑트레일링
하나는 40틱에 10틱 스탑트레일일 나머지는 한계약은 교차시 , 스탑트레일링이 오지 않으면 교차시 , 손절은 14틱 ..
- 매도도 3계약 , 매도청산도 같은 방법 ..
1분봉 차트에 동일종목으로 3분봉 데이타를 참조데이타로 추가하고
식 적용하셔야 합니다.
1
var : XClose1(0,data1),Xopen1(0,data1),Xhigh1(0,data1),Xlow1(0,data1);
var : XClose2(0,data2),Xopen2(0,data2),Xhigh2(0,data2),Xlow2(0,data2);
var : idx(0,data2);
xClose1 = data1((Open+High+Low+Close)/4);
xOpen1 = data1((Open[1] + Close[1])/2);
xHigh1 = data1(Max(High, xOpen1, xClose1));
xLow1 = data1(Min(Low, xOpen1, xClose1));
xClose2 = data2((Open+High+Low+Close)/4);
xOpen2 = data2((Open[1] + Close[1])/2);
xHigh2 = data2(Max(High, xOpen2, xClose2));
xLow2 = data2(Min(Low, xOpen2, xClose2));
if MarketPosition == 0 and xClose1 > xOpen1 Then
{
buy("b",OnClose,def,3);
idx = data2(index);
}
if MarketPosition >= 1 and xClose2 < xOpen2 and data2(index) > idx Then
{
idx = data2(index);
exitlong("bx",OnClose,def,"",1,2);
}
2
atstop,atlimit은 지정한 가겨과 현재가를 비교해 즉시 신호를 발생하는 내용입니다.
지정한 가격과 기본종목의 현재가하고만 비교합니다.
손절은 변경해 드릴 내용이 없고 트레일링스탑만 수익체크만 data2를 참고하게 변경해 드립니다.
input : n(20);
var : h2(0,data1),L2(0,data1);
h2 = data2(h);
l2 = data2(l);
if MarketPosition == 1 Then
{
ExitLong("bx",AtStop,EntryPrice-PriceScale*n);
if highest(H2,BarsSinceEntry) >= EntryPrice+PriceScale*40 Then
ExitLong("bp1",AtStop,highest(H2,BarsSinceEntry)-PriceScale*10,"",1,1);
if highest(H2,BarsSinceEntry) >= EntryPrice+PriceScale*90 Then
ExitLong("bp2",AtStop,highest(H2,BarsSinceEntry)-PriceScale*10,"",1,1);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtStop,EntryPrice+PriceScale*n);
if Lowest(L2,BarsSinceEntry) <= EntryPrice-PriceScale*40 Then
ExitShort("sp1",AtStop,Lowest(L2,BarsSinceEntry)+PriceScale*10,"",1,1);
if Lowest(L2,BarsSinceEntry) <= EntryPrice-PriceScale*90 Then
ExitShort("sp2",AtStop,Lowest(L2,BarsSinceEntry)+PriceScale*10,"",1,1);
}
다음글
이전글