lonestar108

WaveTrend with Crosses [LazyBear]

99739 просмотров
15554
LazyBear's wavetrend oscillator enhanced with wavetrend cross visualization on the indicator as well as with bar color highlights.
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Хотите использовать этот скрипт на графике?
//
// @author LazyBear
//
// If you use this code in its original/modified form, do drop me a note. 
//
study(title="WaveTrend with Crosses [LazyBear]", shorttitle="WT_CROSS_LB")
n1 = input(10, "Channel Length")
n2 = input(21, "Average Length")
obLevel1 = input(60, "Over Bought Level 1")
obLevel2 = input(53, "Over Bought Level 2")
osLevel1 = input(-60, "Over Sold Level 1")
osLevel2 = input(-53, "Over Sold Level 2")
 
ap = hlc3 
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)
 
wt1 = tci
wt2 = sma(wt1,4)

plot(0, color=gray)
plot(obLevel1, color=red)
plot(osLevel1, color=green)
plot(obLevel2, color=red)
plot(osLevel2, color=green)

plot(wt1, color=green)
plot(wt2, color=red)
plot(wt1-wt2, color=blue, style=area, transp=80)
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 3)
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 2)
barcolor(cross(wt1, wt2) ? (wt2 - wt1 > 0 ? aqua : yellow) : na)

Комментарии

Hi Lonestar, this is a really good version of the existing lazybear one. I see you also added a purple/violet wave in the center, indicating the space between the green and red line. What is the meaning of this in terms of trading, according to you?
+216 Ответить
@gtrolo, Good question - it's been eight years since I wrote the script and I want to say buying/ selling momentum? I'm here also to shamelessly plug my project on the Fantom network: bitgem.co - NFT 'gems' with issuance controlled through artificial scarcity. You don't buy em - you stake em, and when you receive one, the staking price increases for the next guy :) come check us out!
+4 Ответить
Does anyone know what the yellow and blue in the center of candles means?
+102 Ответить
DepaFx jfeste512
@jfeste512, I think trend change can be expected
+13 Ответить
@DepaFx, @jfeste512 yellow one LONG position starts, blue one SHORT position starts.. Buy and Sell points
+24 Ответить
mohamadzg2 jfeste512
@jfeste512,
look at the position of the candle itself , when it come in the down or up trend , after the yellow candle almost change the trend .
+3 Ответить
cvinay64 jfeste512
@jfeste512, according to my understanding they are probable buy and sell indicators (respectively) but with confirmation of following next candle.
Ответить
Couple small changes. Removed the default colouring and titled each section for easier alerts. Also added an option to set an alert when the wavetrend is reversing.

n1 = input(10, "Channel Length")
n2 = input(21, "Average Length")
obLevel1 = input(60, "Over Bought Level 1")
obLevel2 = input(53, "Over Bought Level 2")
osLevel1 = input(-60, "Over Sold Level 1")
osLevel2 = input(-53, "Over Sold Level 2")

ap = hlc3
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)

wt1 = tci
wt2 = sma(wt1,4)

plot(0, title="Zero Line")
plot(obLevel1, title="Overbought Lv.1")
plot(obLevel2, title="Overbought Lv.2")
plot(osLevel1, title="Oversold Lv.1")
plot(osLevel2, title="Oversold Lv.2")

plot(wt1, title="WT Bull Line")
plot(wt2, title="WT Bear Line")
plot(wt1-wt2, style=area, transp=80, title="Histo")
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 3, title="WT Crossing Outline")
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 2, title="WT Crossing Dots")

// Set Alerts for Bull/Bear Cross
wtCross = cross(wt1, wt2)
alertcondition(wtCross, title="Wave Trend Crossing", message="Wave Trend Crossing")
+60 Ответить
Jayosilia monnicore
@monnicore, amazing job, do you think it can work well on a daily and also 5 minutes chart? Best
+47 Ответить
monnicore Jayosilia
@Jayosilia, Thanks. It all depends on how you use it, I don't think I would let it be my true entry/exit signal... rather, it adds confluence to my system.
+9 Ответить