예스스탁
예스스탁 답변
2020-06-23 15:49:46
안녕하세요
예스스탁입니다.
var : mav(0),bi(0),b(0),hh(0),bc(0),si(0),s(0),ll(0),sc(0);
mav = ma(C,60);
if crossup(c,mav) Then
{
bi = index;
B = 1;
hh = h;
bc = c;
}
if CrossDown(c,mav) Then
{
si = index;
S = 1;
ll = l;
sc = c;
}
if B == 1 Then
{
if h > hh Then
hh = h;
if index == bi+60 and hh >= bc+PriceScale*100 Then
B = 2;
if index <= bi+60 and c < mav Then
B = 0;
}
if b == 2 then
{
if abs(L-mav) <= PriceScale*10 and
countif(C>O,2) == 2 and countif(C<O,2)[2] == 2 Then
{
b = 3;
buy("b");
}
if L < mav-PriceScale*20 Then
B = 0;
if countif(L < mav,10) == 10 Then
B = 0;
}
if MarketPosition == 1 Then
{
B = 0;
exitlong("bx",AtStop,O[BarsSinceEntry+1]);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*30 and highest(H,BarsSinceEntry) < EntryPrice+PriceScale*50 Then
ExitLong("btr1",AtStop,EntryPrice);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then
ExitLong("btr2",AtStop,highest(H,BarsSinceEntry)+(highest(H,BarsSinceEntry)-EntryPrice)*0.5);
}
if s == 1 Then
{
if l < ll Then
ll = l;
if index == si+60 and ll <= sc-PriceScale*100 Then
s = 2;
if index <= si+60 and c > mav Then
s = 0;
}
if s == 2 then
{
if abs(h-mav) <= PriceScale*10 and
countif(C<O,2) == 2 and countif(C>O,2)[2] == 2 Then
{
s = 3;
sell("s");
}
if h > mav+PriceScale*20 Then
s = 0;
if countif(h > mav,10) == 10 Then
s = 0;
}
if MarketPosition == -1 Then
{
s = 0;
ExitShort("sx",AtStop,O[BarsSinceEntry+1]);
if Lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*30 and Lowest(l,BarsSinceEntry) > EntryPrice-PriceScale*50 Then
ExitShort("str1",AtStop,EntryPrice);
if Lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then
ExitShort("str2",AtStop,Lowest(l,BarsSinceEntry)+(EntryPrice-Lowest(l,BarsSinceEntry))*0.5);
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 매수 :
60 이평선을 돌파 후에 60봉을 지날 때까지 종가가 60 이평선을 깨지 않으며
돌파후에 최고값이 100틱 이상이면 매수조건 A 가 충족되고 매수조건 A 가 충족된 상태에서
이후에 봉의 최저가가 다시 하향되어서
60 이평값-10틱 ~ 60 이평값 + 10틱 근처사이에 오면 매수조건 B가 충족되고
연속 음봉 후에 연속 양봉이 생기면 매수합니다.
즉 매수조건 A 과 매수조건 B 가 만족하고 연속 음봉 후에 연속 양봉이 생기면 매수합니다.
매수조건 A는 충족된 후에 매수청산시 초기화하고 또 60 이평선 아래로 20틱 이상 하향하거나
60 이평선 아래로 10봉 이상 봉수가 늘어나면 초기화 합니다.
매수시 연속 음봉 후의 연속 양봉의 최초 양봉의 시가를 손절가로 하고
매수 후 현재가가 손절가를 하향 이탈하면 손절합니다.
매수 후 30틱 이상 수익나면 매수가를 본절가로 놓고 현재가가 하향헤서 본절가를
건드리면 본절 청산합니다.
매수 후 50틱 수익 나면 (매수후 수익이 줄어 ) 최고 수익의 절반이 되면 추적 이익 청산 합니다.
매도 : 매수와 반대 논리로 수식을 부탁드립니다.