답변완료
수식문의
수고많으십니다.
항상 빠른 답변 갑사드립니다.
제가 실력이 없어서 다른 수식을 짜집기 한 것인데 차트와 잘 맞지 않습니다.
잘못된 곳이 있으면 수정 부탁드립니다.
저의 의도는 TEMA이평이
1. 2봉 연속 상승 시 매수진입
2. 2봉 연속 하락시 매수청산/ 매도진입 입니다.
3. 수정시 연속봉수도 변수 가능하게 부탁드립니다.
그리고 단순 이평으로도 수식 부탁드립니다.
//장 운용시간: 09:00~15:10 이후 진입금지/ 15:30 강제청산
//2봉 연속 상승시 매수/2봉 연속 하락시 매수청산
//2봉 연속 하락시 매도/2봉 연속 상승시 매도청산
input : StartTime(90000),EndTime(151000),LENGTH(5);
var : Tcond(false),TEMA(0),T(0);
TEMA = (3 * Ema(c,LENGTH)) - (3 * Ema(Ema(c,LENGTH),LENGTH)) +
(Ema(Ema(Ema(c,LENGTH),LENGTH),LENGTH));
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
//SetStopTrailing(1,3,PointStop,0); //최소 3 포인트 수익 이후에 1 포인트 수익 감소하면 청산
//SetStoploss(2,PointStop); // 2 point 손실 시 청산
TEMA = ma(c,LENGTH);
if TEMA > TEMA[1] Then
T = 1;
if TEMA < TEMA[1] Then
T = -1;
if Tcond == true Then
{
if MarketPosition <= 0 and
CountIf(T == 1,2) == 2 Then
Buy("b");
if MarketPosition >= 0 and
CountIf(T == -1,2) == 2 Then
Sell("s");
if MarketPosition == 1 and CountIf(T == -1,2) == 2 Then
ExitLong("bx");
if MarketPosition == -1 and CountIf(T == 1,2) == 2 Then
ExitShort("sx");
}
SetStopEndofday(153000);
수고하세요
2025-07-08
189
글번호 192351
시스템
답변완료
10분 시간좀 요청 드림니다.
ㅇ 더운 날씨에 수고 많습니다.
ㅇ 07시 장 시작 부터 10분 단위로 알람을 설정 할려고 하는데요
아래 수식 했더니 안되내요....
10분 단위로 소리음 나올수 있도록 부탁 좀 드림니다.
혹시 10분은 변수(N)로 부탁 드리고
작성시 시간이 오래 걸리면 셈풀만 부탁 드림니다.
## 아래 수식
var : TL1(0),TL2(0);
if stime >= 125800 and stime <= 130000 Then
{
//고가+1틱에서~9999999까지
TL1 = TL_New(sDate,sTime,H+PriceScale*5,sDate,sTime,9999999);
TL_SetColor(TL1,Rgb(150,150,150));
TL_SetSize(TL1,4);
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
//저가-1틱에서~0까지
TL2 = TL_New(sDate,sTime,L-PriceScale*5,sDate,sTime,0);
TL_SetColor(TL2,Rgb(150,150,150));
TL_SetSize(TL2,4);
}
##==========================================================================================
##
//var : TL1(0),TL2(0);
if stime >= 130800 and stime <= 131000 Then
{
//고가+1틱에서~9999999까지
TL1 = TL_New(sDate,sTime,H+PriceScale*5,sDate,sTime,9999999);
TL_SetColor(TL1,Rgb(150,150,150));
TL_SetSize(TL1,4);
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
//저가-1틱에서~0까지
TL2 = TL_New(sDate,sTime,L-PriceScale*5,sDate,sTime,0);
TL_SetColor(TL2,Rgb(150,150,150));
TL_SetSize(TL2,4);
}
##==========================================================================================
##
//var : TL1(0),TL2(0);
if stime >= 131800 and stime <= 132000 Then
{
//고가+1틱에서~9999999까지
TL1 = TL_New(sDate,sTime,H+PriceScale*5,sDate,sTime,9999999);
TL_SetColor(TL1,Rgb(150,150,150));
TL_SetSize(TL1,4);
PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav");
//저가-1틱에서~0까지
TL2 = TL_New(sDate,sTime,L-PriceScale*5,sDate,sTime,0);
TL_SetColor(TL2,Rgb(150,150,150));
TL_SetSize(TL2,4);
}
##==========================================================================================
##==========================================================================================
ㅇ 매번 많은 도움 고맙습니다. 수고 하십시요.
2025-07-09
184
글번호 192343
지표
답변완료
오류인지 확인 부탁드립니다
안녕하세요 담당자님
해당 시스템을 60/120/180/240분봉에 적용하는 경우 2018.10~2019년에 거래가 전혀 안되는 시기가 있습니다. 그 외 시간봉은 괜찮습니다 (일봉, 360분봉 등)
로직이나 가격 움직임을 봤을때 거래가 되어야하는데, 한번 확인 부탁드립니다. 감사합니다.
Input:Period(10);
Vars:ll(0),hh(0);
ll = lowest(L,Period);
hh = highest(H,Period);
If MarketPosition == 0 and CrossUp(C,hh[1]) Then Buy("Buy",AtMarket,DEf,1);
// STOP LOSS
input:PTMult(1);
var:AT(0);
AT = ATR(14);
If MarketPosition == 1 and
Close >= (EntryPrice - (PTMult*AT[BarsSinceEntry]))
Then ExitLong("PT",AtMarket);
// PROFIT TAKING
Input:PT(1);
If MarketPosition == 1 Then SetStopProfittarget(PT,PercentStop);
2025-07-08
177
글번호 192336
시스템
답변완료
수식문의드려요
안녕하세요. 만기일 관련해서 필요한 지표를 찾아보던중 답변된 내용이 있어
해당수식을 사용해보았는데, 만기일에 선표시는 잘되나 각만기일에 해당하는 고저폭을
계산하는 부분이 제대로 되지않아 해당부분을 수정해주셨으면 좋겠습니다.
옵션만기일, 선물만기일, 위클리만기일에서 해당 구간의 최고값과 최저값의 폭을 표시
할 수 있도록 수정해주세요.
그리고 두번째로 첨부하는 코드는 잔존만기일 계산인데, 이것을 분기별 3째주 금요일을 기준으로 계산되게 수정부탁드립니다.
------------------- 1번 코드 ---------------------
var : month(0),nday(0),week(0);
var : OX(False),OH(0),OL(0),OTL(0),OTX(0);
var : FX(false),FH(0),FL(0),FTL(0),FTX(0);
var : WOX(False),WOH(0),WOL(0),WOTL(0),WOTX(0);
month = int(date/100)-int(date/10000)*100;
nday = date - int(date/100)*100;
Week = DayOfWeek(date);
#옵션만기
if nday >= 8 and nday <= 14 and week == 4 Then
{
OX = true;
}
Else
OX = False;
if Bdate != Bdate[1] Then
{
if OX == False and OX[1] == true Then
{
OH = h;
OL = L;
}
}
if OH > 0 and H > OH Then
OH = H;
if OL > 0 and L < OL Then
OL = L;
if OX == true and sTime >= 150000 and sTime[1] < 150000 then
{
OTL = TL_New(sDate,sTime,0,sDate,sTime,9999999);
TL_SetColor(OTL,RED);
OTX = Text_New(sDate,sTime,H,NumToStr(OH-OL,2));
Text_SetColor(OTX,Red);
Text_SetStyle(OTX,2,1);
}
#선물만기
if Month%3 == 0 and nday >= 8 and nday <= 14 and week == 4 Then
{
FX = true;
}
Else
FX = false;
if Bdate != Bdate[1] Then
{
if FX == False and FX[1] == true Then
{
FH = h;
FL = L;
}
}
if FH > 0 and H > FH Then
FH = H;
if FL > 0 and L < FL Then
FL = L;
if FX == true and sTime >= 150000 and sTime[1] < 150000 then
{
FTL = TL_New(sDate,sTime,0,sDate,sTime,9999999);
TL_SetColor(FTL,BLUE);
FTX = Text_New(sDate,sTime,H,NumToStr(FH-FL,2));
Text_SetColor(FTX,BLUE);
Text_SetStyle(FTX,2,1);
}
#위클리옵션만기
if OX == False and week == 4 Then
{
WOX = true;
}
Else
WOX = false;
if Bdate != Bdate[1] Then
{
if WOX == False and WOX[1] == true Then
{
WOH = h;
WOL = L;
}
}
if WOH > 0 and H > WOH Then
WOH = H;
if WOL > 0 and L < WOL Then
WOL = L;
if WOX == true and sTime >= 150000 and sTime[1] < 150000 then
{
WOTL = TL_New(sDate,sTime,0,sDate,sTime,9999999);
TL_SetColor(WOTL,Green);
WOTX = Text_New(sDate,sTime,H,NumToStr(WOH-WOL,2));
Text_SetColor(WOTX,Green);
Text_SetStyle(WOTX,2,1);
}
------------------2번 코드 ------------------------
Var : Year(0),Month(0),ndate1(0),ndate2(0);
var : cnt(0),count1(0),count2(0);
var : XD1(0),XD2(0),Xdate(0),remain(0);
Year = Floor(sDate / 10000)*10000;
month = Floor(FracPortion(sdate/10000)*100)*100;
ndate1 = year+month+1;
if Month+100 <= 1200 Then
ndate2 = year+(month+100)+1;
Else
ndate2 = (year+10000)+100+1;
count1 = 0;
count2 = 0;
for cnt = 0 to 15
{
if dayofweek(ndate1+cnt) == 4 Then
{
count1 = count1+1;
if count1 == 2 Then
{
XD1 = ndate1+cnt;
}
}
if dayofweek(ndate2+cnt) == 4 Then
{
count2 = count2+1;
if count2 == 2 Then
{
XD2 = nDate2+cnt;
}
}
}
if sDate <= XD1 Then
{
Xdate = XD1;
}
Else
{
Xdate = XD2;
}
if Xdate > 0 Then
{
remain = DateToJulian(Xdate)-DateToJulian(sDate);
Plot1(remain);
}
2025-07-07
293
글번호 192332
지표
답변완료
수식 부탁드립니다
다음 트레이딩뷰 수식을 아무리 변환해도 이상하게 표시되어 부탁드리게 되었씁니다. 미리 감사드립니다.
//@version=5
indicator('Chandelier Exit[everget]', shorttitle='CE', overlay=true)
var string calcGroup = 'Calculation'
length = input.int(title='ATR Period', defval=22, group=calcGroup)
mult = input.float(title='ATR Multiplier', step=0.1, defval=3.0, group=calcGroup)
useClose = input.bool(title='Use Close Price for Extremums', defval=true, group=calcGroup)
var string visualGroup = 'Visuals'
showLabels = input.bool(title='Show Buy/Sell Labels', defval=true, group=visualGroup)
highlightState = input.bool(title='Highlight State', defval=true, group=visualGroup)
var string alertGroup = 'Alerts'
awaitBarConfirmation = input.bool(title="Await Bar Confirmation", defval=true, group=alertGroup)
atr = mult * ta.atr(length)
longStop = (useClose ? ta.highest(close, length) : ta.highest(length)) - atr
longStopPrev = nz(longStop[1], longStop)
longStop := close[1] > longStopPrev ? math.max(longStop, longStopPrev) : longStop
shortStop = (useClose ? ta.lowest(close, length) : ta.lowest(length)) + atr
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := close[1] < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
var int dir = 1
dir := close > shortStopPrev ? 1 : close < longStopPrev ? -1 : dir
var color longColor = color.green
var color shortColor = color.red
var color longFillColor = color.new(color.green, 90)
var color shortFillColor = color.new(color.red, 90)
var color textColor = color.new(color.white, 0)
longStopPlot = plot(dir == 1 ? longStop : na, title='Long Stop', style=plot.style_linebr, linewidth=2, color=color.new(longColor, 0))
buySignal = dir == 1 and dir[1] == -1
plotshape(buySignal ? longStop : na, title='Long Stop Start', location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(longColor, 0))
plotshape(buySignal and showLabels ? longStop : na, title='Buy Label', text='Buy', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(longColor, 0), textcolor=textColor)
shortStopPlot = plot(dir == 1 ? na : shortStop, title='Short Stop', style=plot.style_linebr, linewidth=2, color=color.new(shortColor, 0))
sellSignal = dir == -1 and dir[1] == 1
plotshape(sellSignal ? shortStop : na, title='Short Stop Start', location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(shortColor, 0))
plotshape(sellSignal and showLabels ? shortStop : na, title='Sell Label', text='Sell', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(shortColor, 0), textcolor=textColor)
midPricePlot = plot(ohlc4, title='', style=plot.style_circles, linewidth=0, display=display.none, editable=false)
longStateFillColor = highlightState ? dir == 1 ? longFillColor : na : na
shortStateFillColor = highlightState ? dir == -1 ? shortFillColor : na : na
fill(midPricePlot, longStopPlot, title='Long State Filling', color=longStateFillColor)
fill(midPricePlot, shortStopPlot, title='Short State Filling', color=shortStateFillColor)
2025-07-07
251
글번호 192330
지표