The following critical lines of the original WWV_LB script determine when a wave reverses, both the true and the confirmation point:mov = close>close ? 1 : close<close ? -1 : 0
trend= ( mov != 0) and ( mov != mov) ? mov : nz (trend)
isTrending = rising(close, trendDetectionLength) or falling(close, trendDetectionLength)
wave=(trend != nz (wave)) and isTrending ? trend : nz (wave) These original script lines are replicated in lines 62 to 65 of my script and are used to define wave reversal bars and wave reversal confirmation bars. The original WWV_LB script does not track potential or actual bars. The information can be extracted and tracked from the original script and then used to plot the actual reversal bars. This allows the to be tracked from the actual/true bars.Instead of "trendDetectionLength" I have inserted "Trend Detection Length" in the dialogue boxes. You can of course change the descriptor to what you wish by editing script line 33 to the original term or whatever you wish. You might also wish to set the default to the value "2" as per the original script. I have set the default to "3".
If you use a dark background I suggest you edit script line 4 from blackr=black to something such as blackr=yellow The values are shown in a vertical column of 3 numbers. Given the limitations of Pinescript Version 3 relative to V4, they are plotted at the point where the wave reversal is confirmed as opposed to the true . The lines plot the true . The plot location of numbers could be improved in Pinescript Version 4. I explain below why I have not published the Pinescript version 4 scripThe values plotted on the chart are calculated to be relative numbers. The script is limited to showing only three numbers vertically. Only the highest three values of a number are shown. For example, if the highest recent pip value is 12,345 only the first 3 numerals would be displayed ie 123. But suppose there is a recent value of 691. It would not be helpful to display 691 if the other wave size is shown as 123. To give the appropriate relative value the script will show a value of 7 instead of 691. This informs you of the relative magnitude of the values. This is done automatically within the script. There is likely no need to manually override the automatically calculated value. I will create a video that demonstrates the manual override method.
Should you update to Pinescript version 4? You could but if you do you will need to change the "plotchar" criteria since this script will exceed the 64 plot limit when converted to version 4. Version 4 would also allow the zigzags lines to be straight lines. However, the 50 label and line plot limit (Pinescript calls this resource sparing feature "garbage collection") significantly truncates the screen available information provided on screen. This algo optionally allows the plotting of zigzags as calculated by the original WWV_LB script. Toggling between the two script versions allows you to see the plot differences. I have also made some modifications to the original WWV_LB histogram script to adjust the .This script should be used in conjunction with the "WWV_LB fix histogram jayy" shown in the panel below the main screen. Here is a link to the original LazyBear histogram script which can be used for comparison. The differences are subtle, however, the histograms will regularly be different by a bar or two:
The lowest panel has the original LazyBear WWV_LB script for comparison. All three scripts have been set to a Trend Detection Length of 3.
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.