Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Weis Wave Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
maljester
Posted : Sunday, September 17, 2017 7:15:19 PM
Platinum Customer Platinum Customer

Joined: 1/30/2005
Posts: 135

This is an old topic but I would like to address it again.

I converted the following to RealCode 

// @author LazyBear 
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study("Weis Wave Volume [LazyBear]", shorttitle="WWV_LB")
trendDetectionLength=input(2)
showDistributionBelowZero=input(false, type=bool)
mov = close>close[1] ? 1 : close<close[1] ? -1 : 0
trend= (mov != 0) and (mov != mov[1]) ? mov : nz(trend[1])
isTrending = rising(close, trendDetectionLength) or falling(close, trendDetectionLength) //abs(close-close[1]) >= dif
wave=(trend != nz(wave[1])) and isTrending ? trend : nz(wave[1])
vol=wave==wave[1] ? (nz(vol[1])+volume) : volume
up=wave == 1 ? vol : 0
dn=showDistributionBelowZero ? (wave == 1 ? 0 : wave == -1 ? -vol : vol) : (wave == 1 ? 0 : vol)
plot(up, style=histogram, color=green, linewidth=3)
plot(dn, style=histogram, color=red, linewidth=3)
 
My RealCode
'# TrendLength = UserInput.Integer = 2
Static mov As Single
Static prevmov As Single
Static trend As Single
Static prevtrend As Single
Static isTrending As Single
Static wave As Single
Static prevwave As Single
Static vol As Single
 
If isFirstBar Then
     mov = 0
     prevmov = 0
     trend = 0
     prevtrend = 0
     isTrending = 0
     wave = 0
     prevwave = 0
     vol = 0
End If
'mov = close>close[1] ? 1 : close<close[1] ? -1 : 0
If price.close > price.Close(1) Then
     mov = 1
Else If price.close < price.close(1) Then
     mov = -1
Else
     mov = 0
End If
'trend= (mov != 0) and (mov != mov[1]) ? mov : nz(trend[1])
If mov <> 0 And mov <> prevmov Then
     trend = mov
Else
     trend = prevtrend
End If
'isTrending = rising(close, trendDetectionLength) or falling(close, trendDetectionLength)
If price.close > price.close(1) AndAlso price.Close(1) > price.Close(2) _
     Or price.close < price.Close(1) AndAlso price.close(1) < price.Close(2) Then
     isTrending = 1
Else
     isTrending = 0
End If
'wave = (trend != nz(wave[1])) and isTrending ? trend : nz(wave[1])
If trend <> prevwave AndAlso isTrending = 1 Then
     wave = trend
Else
     wave = prevwave
End If
'vol = wave==wave[1] ? (nz(vol[1])+volume) : volume
If wave = prevwave Then
     vol += volume.value
Else
     vol = volume.value
End If
If wave = 1 Then
     plot = vol
Else
     plot = -vol
End If
prevmov = mov
prevtrend = trend
prevwave = wave
 
This version has down volume displayed below 0, because I did not know how to set 2 different plot colors in the indicator RealCode.  I set the plot to Bar in the edit window for the indicator and the Paint Scheme in the edit window.  I like how this version matches to price movement.
 
My question - is this version of Weis Wave possible in TC2000 V17?
 

  

Bruce_L
Posted : Monday, September 18, 2017 11:30:23 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I have not been able to figure out a way to do so.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.