답변완료
문의 드립니다
아래 수식어에 추가로 부탁드립니다.
5선,30선 골든크로스 이후 sell 진입금지 및 5선,30선 골든크로스에서 기존 sell신호 청산
5선,30선 데드크로스 이후 buy 진입금지 및 5선,30선 데드크로스에서 기존 buy신호 청산
input : StartTime(120000),EndTime(50000);
input : 익절틱수(40000),손절틱수(10000),진입횟수(20);
var : Tcond(False),entry(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
var1 = SwingHigh(1, H, 3, 1, 50);
var2 = SwingHigh(1, L, 3, 1, 50);
if crossup(c, var1) then{
buy();
exitshort();
}
if crossdown(c, var2) then{
sell();
exitlong();
}
2025-04-14
237
글번호 190075
시스템
답변완료
수정 부탁드립니다.
안녕하세요?
수식작성 감사드립니다.
아래 수식에 당일 고가가 상한가 간 종목을 대상으로 하고 싶습니다.
추가해주시면 감사하겠습니다.^.^
if CrossDown(C,DayHigh(0)-(DayHigh(0)-DayOpen)*0.15) Then
Buy("b1",OnClose,Def,Floor(1000000/c));
if CrossDown(C,DayHigh(0)-(DayHigh(0)-DayOpen)*0.15) Then
Buy("b2",OnClose,Def,Floor(1000000/c));
if CrossDown(C,DayHigh(0)-(DayHigh(0)-DayOpen)*0.15) Then
Buy("b3",OnClose,Def,Floor(1000000/c));
if MarketPosition == 1 Then
{
if CurrentContracts == MaxContracts Then
ExitLong("bx1",AtLimit,AvgEntryPrice*1.3,"",Floor(MaxContracts*0.5),1);
Else
ExitLong("bx2",AtLimit,AvgEntryPrice*1.6,"",Floor(MaxContracts*0.5),1);
}
2025-04-14
254
글번호 190074
시스템
답변완료
지표 문의 드립니다.
// ~~ Tooltips
t1 = "Defines the lookback period for the oscillator and Bollinger Bands calculation. Increasing this value will consider a longer history, potentially smoothing out the oscillator and making the Bollinger Bands wider, leading to fewer signals. Decreasing this value will make the oscillator more sensitive to recent price changes, and the Bollinger Bands will become narrower, possibly increasing the number of signals."
t2 = "Determines how much the oscillator's calculation is smoothed. A higher smoothing factor reduces noise and makes the oscillator's line smoother, which may help in identifying the dominant trend more clearly but can delay signal generation. A lower smoothing factor makes the oscillator more responsive to recent price movements, which can be beneficial for short-term trading strategies but may increase the risk of false signals."
// ~~ Inputs
length = input.int(33, "Length", minval=1, group="Dynamic Price Oscillator", tooltip=t1)
smoothFactor = input.int(5, "Smoothing Factor", minval=1, group="Dynamic Price Oscillator", tooltip=t2)
// ~~ Function to calculate True Range
trueRange(high, low, close) =>
tr1 = high - low
tr2 = math.abs(high - close[1])
tr3 = math.abs(low - close[1])
math.max(tr1, tr2, tr3)
// ~~ Function to calculate Bollinger Bands
bollingerBands(src, length, mult) =>
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
[upper, lower]
// ~~ Adjusted Price based on True Range
volAdjPrice = ta.ema(trueRange(high, low, close), length)
// ~~ Price calculation
priceChange = close - close[length]
priceDelta = close - volAdjPrice
oscillator = ta.ema(math.avg(priceDelta, priceChange), smoothFactor)
// ~~ Bollinger Bands on Oscillator
[bbHigh, bbLow] = bollingerBands(oscillator, length * 5, 1)
[bbHighExp, bbLowExp] = bollingerBands(oscillator, length * 5, 2)
mean = math.avg(bbHighExp, bbLowExp)
// ~~ Middle Lines
middleHighMean = (bbHigh + mean) / 2
middleMeanLow = (mean + bbLow) / 2
// ~~ Plot
p1 = plot(oscillator, "Dynamic Price Oscillator", color=color.rgb(227, 161, 54))
plot(mean, "Dynamic Mean", color=color.new(#f7cb85, 0))
p2 = plot(bbHigh, "Bollinger High", color=color.new(#089981, 60))
p3 = plot(bbHighExp, "Expanded Bollinger High", color=color.new(#089981, 0))
p4 = plot(bbLow, "Bollinger Low", color=color.new(#f23645, 60))
p5 = plot(bbLowExp, "Expanded Bollinger Low", color=color.new(#f23645, 0))
plot(middleHighMean, "Middle High-Mean", color=color.new(#0099cc, 40))
plot(middleMeanLow, "Middle Mean-Low", color=color.new(#cc9900, 40))
fill(p1, p2, oscillator > bbHigh ? color.new(#089981, 80) : na, "Oscillator Above Bollinger High")
fill(p1, p3, oscillator > bbHighExp ? color.new(#089981, 80) : na, "Oscillator Above Expanded Bollinger High")
fill(p1, p4, oscillator < bbLow ? color.new(#f23645, 80) : na, "Oscillator Below Bollinger Low")
fill(p1, p5, oscillator < bbLowExp ? color.new(#f23645, 80) : na, "Oscillator Below Expanded Bollinger Low")
트레이딩뷰 지표인데 예스로 좀 바꿔주세요.
2025-04-13
299
글번호 190070
지표