커뮤니티
수식 부탁드려요~
2018-12-05 12:24:03
179
글번호 124153
종목: 해외선물 크루드 오일
스케일: 5분봉
진입후 청산이 되지 않을때 당일 청산하게 부탁드림니다.
===== 진입 청산 조건 ====
매수진입은 봉완성시 진입
매수 청산은 조건만족시
손절 청산은 조건만족시
==============================================================================
질문 2
위식과 비슷한 컨셉인데요.. Y 값을 일봉기준 20일동안 고점-저점으로 하는 수식도 첨부 부탁드리겠습니다. 활용은 5분봉차트에서 진행 할겁니다.
자꾸 부탁드려서 죄송합니다. 트레일링스탑에 검증과 실제의 괴리로 맨붕이라..ㅠㅠ
답변 1
예스스탁 예스스탁 답변
2018-12-05 11:44:53
안녕하세요
예스스탁입니다.
1
input : 고저체크시작(80000),고저체크종료(120000),k(0.5),N(4);
var : T(0),bars(0),HH(0),LL(0);
if (sdate != sdate[1] and stime >= 고저체크시작) or
(sdate == sdate[1] and stime >= 고저체크시작 and stime[1] < 고저체크시작) Then
{
T = 1;
HH = H;
LL = L;
}
if (sdate != sdate[1] and stime >= 고저체크종료) or
(sdate == sdate[1] and stime >= 고저체크종료 and stime[1] < 고저체크종료) Then
{
T = 2;
bars = 0;
}
if T == 1 then
{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
}
if T == 2 then
{
bars = bars+1;
if bars >= n and HH-LL >= k and countif(C > HH,n) == n and crossup(c[n-1],hh[n-1]) Then
buy("B");
if bars >= n and HH-LL >= k and countif(C < LL,n) == n and CrossDown(c[n-1],ll[n-1]) Then
sell("S");
}
if MarketPosition == 1 then
{
ExitLong("bl",AtStop,EntryPrice-PriceScale*20);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-PriceScale*8);
}
if MarketPosition == -1 Then
{
ExitShort("sl",AtStop,EntryPrice+PriceScale*20);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*8);
}
2
input : P(20),k(0.5),N(4);
var : T(0),bars(0),HH(0),LL(0),cnt(0);
hh = DayHigh(1);
ll = daylow(1);
for cnt = 1 to P
{
if DayHigh(cnt) > hh Then
hh = DayHigh(cnt);
if DayLow(cnt) < ll Then
ll = DayLow(cnt);
}
if bdate != bdate[1] Then
bars = 0;
bars = bars+1;
if HH-LL >= k and countif(C > HH,n) == n and crossup(c[n-1],hh[n-1]) Then
buy("B");
if HH-LL >= k and countif(C < LL,n) == n and CrossDown(c[n-1],ll[n-1]) Then
sell("S");
if MarketPosition == 1 then
{
ExitLong("bl",AtStop,EntryPrice-PriceScale*20);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-PriceScale*8);
}
if MarketPosition == -1 Then
{
ExitShort("sl",AtStop,EntryPrice+PriceScale*20);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then
ExitShort("sx",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*8);
}
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 수식 부탁드려요~
> 종목: 해외선물 크루드 오일
스케일: 5분봉
진입후 청산이 되지 않을때 당일 청산하게 부탁드림니다.
===== 진입 청산 조건 ====
매수진입은 봉완성시 진입
매수 청산은 조건만족시
손절 청산은 조건만족시
==============================================================================
질문 2
위식과 비슷한 컨셉인데요.. Y 값을 일봉기준 20일동안 고점-저점으로 하는 수식도 첨부 부탁드리겠습니다. 활용은 5분봉차트에서 진행 할겁니다.
자꾸 부탁드려서 죄송합니다. 트레일링스탑에 검증과 실제의 괴리로 맨붕이라..ㅠㅠ
다음글
이전글