답변완료
매도와 동시에 매수 진입이 안됩니다.
처음 매도 신호에서 매도 주문이 나가서 보유중이다가 두번째 나오는 매수 신호에서 처음 나왔던 매도 포지션이 정리되고 주문이 끝났습니다.
제가 예상한것과 시스템 성능보고서에 나온것도 같은 내용이지만 두번째 나오는 매수 신호에서 매도포지션이 정리됨과 동시에 매수 포지션 주문이 나가는것이었습니다.
피라미딩은 허용안함 주문 시작 신호는 진입신호에 둔 상태였습니다.
피라미딩과 주문 시작 신호의 문제일까요? 아니면수식의 문제일까요?
수식은 아래와 같습니다.
input : a(9), length(3),크기(15);
var : truehighv(0),TrueLowv(0),TrueRangev(0),xatr(0),nLoss(0),src(0) ;
var : xClose(0),xOpen(0),xHigh(0),xLow(0);
var : xATRTrailingStop(0),poss(0), emav(0), ab(False), be(False),tx(0) ;
var : dir(0) ;
if index == 0 then
{
xOpen = open;
xClose = (O+H+L+C)/4;
xHigh = MaxList( high, xOpen, xClose);
xLow = MinList( low, xOpen,xClose);
}
else
{
xClose = (O+H+L+C)/4;
xOpen = (xOpen [1] + xClose [1])/2 ;
xHigh = MaxList(High, xOpen, xClose) ;
xLow = MinList(Low, xOpen, xClose) ;
}
////////
If xClose[1] > xHigh then
TrueHighv = xClose[1];
else
TrueHighv = xHigh;
If xClose[1] < xLow then
TrueLowv = xClose[1];
else
TrueLowv = xLow;
TrueRangev = TrueHighv - TrueLowv;
xatr = ma(TrueRangev,length);
nLoss = a * xatr ;
##########
src = xClose ;
xATRTrailingStop = 0.0 ;
xATRTrailingStop = iff(src > xATRTrailingStop[1] and src[1] > xATRTrailingStop[1],
max(xATRTrailingStop[1], src - nLoss),
iff(src < xATRTrailingStop[1] and src[1] < xATRTrailingStop[1],
min(xATRTrailingStop[1],src + nLoss),
iff(src > xATRTrailingStop[1], src - nLoss, src + nLoss)));
poss = 0 ;
poss = iff(src[1] < xATRTrailingStop[1] and src > xATRTrailingStop[1], 1,
iff(src[1] > xATRTrailingStop[1] and src < xATRTrailingStop[1], -1, poss[1])) ;
emav = ema(src,1);
if crossup(emav, xATRTrailingStop) Then
ab = true ;
Else
ab = False;
if crossup(xATRTrailingStop, emav) Then
be = true ;
Else
be = False;
////////////
dir = iff(src > xATRTrailingStop and ab == true , 1 ,iff( src < xATRTrailingStop and be == true , -1 , dir));
if dir == 1 and dir[1] == -1
Then
{
Buy();
}
if dir == -1 and dir[1] == 1
Then
{
Sell();
}
2024-01-11
880
글번호 175625
시스템
답변완료
지표식 재문의
잘 만들어서 적용을 했습니다만.. 현재봉에서는 숫자가 나오지 않는게 맞는것인지요?
확인차 문의드립니다.
----------------------------------------------
안녕하세요
예스스탁입니다.
input : P(5);
var : tx(0);
var1 = ma(C,P);
Var2 = var1-c;
Plot1(var1,"이평");
tx = text_new(sDate,sTime,var1,NumToStr(Var2,2));
Text_SetStyle(tx,2,1);
Text_SetSize(tx,12);
Text_SetColor(tx,Black);
즐거운 하루되세요
> 한글나라 님이 쓴 글입니다.
> 제목 : 수식 문의드립니다.
> 항상 감사드립니다.
5 이평을 차트에 띄우고 (ma(c,5)- c)의 값을 5이평 위에 글자크기 조절할 수 있게 매주기마다
보이게 하는 지표를 만들고 싶습니다.
2024-01-11
940
글번호 175624
지표
답변완료
강조식으로부탁드립니다.
input: ATRLength20(100), ATRMult20(3.6);
vars: ATR20(0), avg20(0), dn20(0), up20(0), trend20(1), flag20(0), flagh20(0), qqq20(0);
ATR20 = ATR(ATRLength20) * ATRMult20;
avg20 = (High + Low)/2;
up20 = avg20 + ATR20;
dn20 = avg20 - ATR20;
if close > up20[1] then trend20 = 1;
else if close < dn20[1] then trend20 = -1;
if trend20 < 0 and trend20[1] > 0 then flag20 = 1; else flag20 = 0;
if trend20 > 0 and trend20[1] < 0 then flagh20 = 1; else flagh20 = 0;
if trend20 > 0 and dn20 < dn20[1] then dn20 = dn20[1];
if trend20 < 0 and up20 > up20[1] then up20 = up20[1];
if flag20 == 1 then up20 = avg20 + ATR20;
if flagh20 == 1 then dn20 = avg20 - ATR20;
if trend20 == 1 then qqq20 = dn20; else qqq20 = up20;
Plot20(qqq20,"qqq20",iff(trend20 == 1,Tomato, Black));
2024-01-10
1332
글번호 175605
강조
답변완료
문의 드립니다....
일봉상 1번,2번라인 돌파 및 유지 종목 검색식 부탁드립니다(지표조건 변경가능하게부탁)
1번----------------------------------------
AA=abs((H-L)/H*100);
Condition=
AA > multiple and
C<O and
O>C(1)*(1+gap/100) and
V>eavg(V(1), 기간)*몇배;
valuewhen(1, Condition, H)
지표조건
multiple : 10
gap : 0.1
기간 : 20
몇배 : 3
2번-----------------------------------
조건 = Highest(H, L기간+R기간+1)==H(R기간);
Valuewhen(1, 조건, H(R기간),1)
지표조건
L기간 : 15
R기간 : 12
2024-01-10
948
글번호 175602
종목검색
답변완료
수고하십니다.
분봉에서는 검색이 되는데 일봉에서는 안되네요..
종목검색으로 잘 부탁 드립니다.
max(BBandsUp(20,2))<min(BBandsdown(20,2))*1.01
or
max(BBandsUp(20,2))<min(BBandsdown(20,2))*1.02
&& c>BBandsc(20,2)
&& crossup(c,BBandsup(20,2))
&& v>v(1)*2
&& c>predayclose()
&& dayopen()<c
&& C*1.04 >= dayhigh()
&& h(1)<BBandsup(20,2)
and time >= 090300 and time <= 152000
2024-01-10
971
글번호 175601
종목검색