예스스탁
예스스탁 답변
2020-12-22 14:53:54
안녕하세요
예스스탁입니다.
신호발생 후 시장가등 주문가격은 랭귀지 안에서 처리를 할 수 없습니다.
실제 주문가격은 설정창에서만 설정 가능합니다.
익절, 손절 신호식만 추가해 드립니다. 도움을 드리지 못해 죄송합니다.
input : 익절틱수(12),손절틱수(16);
var : xClose(0),xOpen(0),xHigh(0),xLow(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 > xOpen and xOpen == xLow Then
Buy("b");
if MarketPosition == 1 Then
{
if CountIf(xClose < xOpen,2) == 2 Then
ExitLong("bx");
}
if xClose < xOpen and xOpen == xhigh Then
Sell("s");
if MarketPosition == -1 Then
{
if CountIf(xClose > xOpen,2) == 2 Then
ExitShort("sx");
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 밤의마법사 님이 쓴 글입니다.
> 제목 : 진입 후 손절과 익절을 수식에 넣고 싶은데...
> 안녕하세요.
참고로 요청드린 수식 감사드립니다.
아래의 수식에서 매도나 매수 진입 시 아래의 손절/익절 조건을 수식에 넣을 수 있는 방법도 있을까요?
. 12틱 이익 후 익절 조건 : 현재가 -2호가 (매수 진입 후 청산 시) / 현재가 +2호가 (매도 진입 후 청산 시)
. 16틱 손실 후 손절 조건 : 시장가 청산
===== 작성해 주신 수식 =====
var : xClose(0),xOpen(0),xHigh(0),xLow(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 > xOpen and xOpen == xLow Then
Buy("b");
if MarketPosition == 1 Then
{
if CountIf(xClose < xOpen,2) == 2 Then
ExitLong("bx");
}
if xClose < xOpen and xOpen == xhigh Then
Sell("s");
if MarketPosition == -1 Then
{
if CountIf(xClose > xOpen,2) == 2 Then
ExitShort("sx");