답변완료
문의 드립니다.
1)
Plot1((DayClose(1)+DayOpen(1))/2);
위 수식이
전일종가와 시가를 가져와 평균값을 그리는 지표라고 하셨는데
그러면 위 수식처럼 한시간봉과 4시간봉도 각각 따로 만들어주세요.
2)
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// ~~ © Zeiierman {
//@version=5
indicator("Dynamic Price Oscillator (Zeiierman)", precision=0)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ 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", inline="",tooltip=t1)
smoothFactor = input.int(5, "Smoothing Factor", minval=1,group="Dynamic Price Oscillator", inline="",tooltip=t2)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Function to calculate True Range {
trueRange(h, l, c) =>
tr1 = h - l
tr2 = math.abs(h - c[1])
tr3 = math.abs(l - c[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)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ 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))
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")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
트레이딩뷰 지표인데 예스로 좀 바꿔주세요.
2024-07-30
1204
글번호 182022
지표
답변완료
수정부탁드립니다.
하이켄하시로변경부탁드립니다.
var: Period초(2),선두께초(2),색상두께초(30),색상두께초1(90),초두께(1);
Var:상승색초(Orange), 하락색초(Lime);
Var:j초(0),T초(0);
Var: date11초(0),date12초(0),time11초(0),time12초(0),TL초1(0),TL초(0),
date21초(0),date22초(0),time21초(0),time22초(0),
date31초(0),date32초(0),time31초(0),time32초(0),tx초(0),tx초1(0),TL초4(0);
Array:HiVal초[20](0),LoVal초[20](0),HiBar초[20](0),LoBar초[20](0);
Array:r초[7](0),fr초[7](0),TL초2[7](0),TL초3[7](0),tx초2[7](0),tx초3[7](0);
var : box초(0),box1초(0);
For j초 = 0 To 19
{
HiBar초[j초] = HiBar초[j초] + 1;
LoBar초[j초] = LoBar초[j초] + 1;
}
if crossup(c,highest(H,Period초)[1]) Then
T초 = 1;
if CrossDown(c,Lowest(L,Period초)[1]) Then
T초 = -1;
If T초 == -1 Then
{
If T초[1] != -1 Then
{
For j초 = 18 DownTo 0
{
LoVal초[j초+1] = LoVal초[j초];
LoBar초[j초+1] = LoBar초[j초];
//ZZ[j초+1] = ZZ[j초];
}
LoVal초[0] = L;
LoBar초[0] = 0;
//ZZ[0] = L;
date11초 = date[HiBar초[0]];
time11초 = stime[HiBar초[0]];
Value11 = HiVal초[0];
date12초 = date[LoBar초[0]];
time12초 = stime[LoBar초[0]];
Value12 = LoVal초[0];
date21초 = date[HiBar초[0]];
time21초 = stime[HiBar초[0]];
date22초 = date[0];
time22초 = stime[0];
for j초 = 0 to 6
{
fr초[j초] = LoVal초[1] + ((HiVal초[0] - LoVal초[1]) * r초[j초]);
}
Box_SetEnd(box초,date11초,time11초,Value11);//실시간 후행할결우 //적용
box초 = box_new(date11초,time11초,Value11,date12초,time12초,Value12);
Box_SetColor(box초,하락색초);
// Box_SetFill(box초,true,색상두께초1);//색상삭제
Box_SetSize(box초,1);
// TL초 = TL_New(date11초,time11초,Value11,date12초,time12초,Value12);
TL_SetColor(TL초,하락색초);
tL_SetSize(TL초,초두께);
}
If LoVal초[0] > L Then
{
LoVal초[0] = L;
LoBar초[0] = 0;
//ZZ[0] = L;
date12초 = date[LoBar초[0]];
time12초 = stime[LoBar초[0]];
Value12 = LoVal초[0];
date22초 = date[0];
time22초 = stime[0];
Box_SetEnd(box초,date12초,time12초,Value12); //후행시간
// TL_SetEnd(TL초,date12초,time12초,Value12);
}
Box_SetEnd(box초,NextBarSdate,NextBarStime,Value12); //실시간 후행할결우 //적용
}
If T초 == 1 Then
{
If T초[1] != 1 Then
{
For j초 = 18 DownTo 0
{
HiVal초[j초+1] = HiVal초[j초];
HiBar초[j초+1] = HiBar초[j초];
//ZZ[j초+1] = ZZ[j초];
}
HiVal초[0] = H;
HiBar초[0] = 0;
//ZZ[0] = H;
date11초 = date[LoBar초[0]];
time11초 = stime[LoBar초[0]];
Value11 = LoVal초[0];
date12초 = date[HiBar초[0]];
time12초 = stime[HiBar초[0]];
Value12 = HiVal초[0];
date31초 = date[LoBar초[0]];
time31초 = stime[LoBar초[0]];
date32초 = date[0];
time32초 = stime[0];
for j초 = 0 to 5
{
fr초[j초] = LoVal초[0] + ((HiVal초[1] - LoVal초[0]) * r초[j초]);
}
Box_SetEnd(box초,date11초,time11초,Value11); //실시간 후행할결우 //적용
box초 = box_new(date11초,time11초,Value11,date12초,time12초,Value12);
Box_SetColor(box초,상승색초);
// Box_SetFill(box초,true,색상두께초);//색상삭제
Box_SetSize(box초,1);
// TL초 = TL_New(date11초,time11초,Value11,date12초,time12초,Value12);
TL_SetColor(TL초,상승색초);
tL_SetSize(TL초,초두께);
// TL_SetDrawMode(TL초,0);
}
If HiVal초[0] < H Then
{
HiVal초[0] = H;
HiBar초[0] = 0;
//ZZ[0] = H;
date12초 = date[HiBar초[0]];
time12초 = stime[HiBar초[0]];
Value12 = HiVal초[0];
TL_SetEnd(TL초1, date12초,time12초,Value12);
date32초 = date[0];
time32초 = stime[0];
Box_SetEnd(box초,date12초,time12초,Value12);//후행시간
// TL_SetEnd(TL초,date12초,time12초,Value12);
}
Box_SetEnd(box초,NextB
2024-07-29
487
글번호 182019
강조
답변완료
문의드립니다
input : jawLength(13),jawOffset(8);
input : teethLength(8),teethOffset(5);
input : lipsLength(5),lipsOffset(3);
var : hl2(0),jaw(0),teeth(0),lips(0);
hl2 = (h+l)/2;
jaw = 0;
if IsNaN(jaw[1]) == true Then
jaw = ma(hl2,jawLength);
Else
jaw = (jaw[1]*(jawLength-1) + hl2)/jawLength;
teeth = 0;
if IsNaN(teeth[1]) == true Then
teeth = ma(hl2,teethLength);
Else
teeth = (teeth[1]*(teethLength-1) + hl2)/teethLength;
lips = 0;
if IsNaN(lips[1]) == true Then
lips = ma(hl2,lipsLength);
Else
lips = (lips[1]*(lipsLength-1) + hl2)/lipsLength;
plot1(jaw,"jaw",BLUE);
plot2(teeth,"teeth",RED);
plot3(lips,"lips",GREEN);
FixPlotShift(1,jawOffset);
FixPlotShift(2,teethOffset);
FixPlotShift(3,lipsOffset);
수고 많으십니다
문의 드릴 내용은 위 지표로 시스템 수식 부탁드립니다
위 지표는 캔들 보다 선행하는 선이 3개가 있는데
1번
선행하는 3개 선이 정배열 때 매수진입 매도청산
역배열 때 매도진입 매수청산
하루100틱 익절시 매매종료
하루100틱 손실시 매매종료
2번
lips가 teeth를 상향 돌파시 매수진입 매도청산
lips가 teeth를 하향 돌파시 매도진입 매수청산
하루100틱 익절시 매매종료
하루100틱 손실시 매매종료
이런 시스템을 부탁드립니다
항상 감사드립니다
2024-07-29
526
글번호 182017
시스템