Variant Of Weis Wave

Hi i am trying to script something similar to the Weis Wave. Article attached

https://weisonwyckoff.com/weis-wave/

The variant of this is i am trying to use a Gann Swing Chart overlay as the starting and end points. The script attached is initiating accumulation of volume from the signal start but is not switching at signal end.

Any assistance would be very much appreciated.

R1 = GANNSWING(SWINGCOUNT=2, DEFAULT=SwingStart);

R2 = GANNSWING(SWINGCOUNT=2, DEFAULT=SwingEnd);

c1 = SWITCH(R1, R2); c1_on = c1 and (OFFSET(c1, OFFSET=1) <= 0);

ACCSINCESIGNAL(VOL() , c1_on)

Screenshot attached

Cheers Kim

 

2nd attempt please refer screenshot. ist show view shows Volume Data for Spy is being pulled to chart but volume for swings is not being aggregated. Must be a simple fix any ideas will be appreciated

R1 = GANNSWING(SWINGCOUNT=2, DEFAULT=SwingStart);

R2 = GANNSWING(SWINGCOUNT=2, DEFAULT=SwingEnd);

c1 = SWITCH(R1, R2); c1_on = c1 and (OFFSET(c1, OFFSET=1) <= 0);

V1 = GETDATA(CODE=DI6T.Z:IQFeed);

ACCSINCESIGNAL(V1, c1_on);

Hi Kim,
That was an interesting challenge you set. It’s sort-of like something I’d been thinking about to having a shot at it.
As I understood your requirements you wanted to aggregate the volume for each up and down swing of a Gann 2-Bar Swing Chart.
The following chart shows the results of the script included below:
20181201 Volume Between Gann Swings Here’s the script:

// Volume Between Gann Swings
GS =GANNSWING(DEFAULT=SwingList, USECLUSTERS=False, USEBREAKOUT=False, SWINGCOUNT=2);
GSStart= SWINGSTART(GS);
GSEnd = SWINGEND(GS);
Rng = GSStart-GSEnd;
// Down Swings bars
Sig1 = if((TIMESINCESIGNAL(GSStart) > 0 and Rng > 0) , 1, 0);
Sig2 = IF(TIMESINCESIGNAL(GSEnd) < 1 and Rng < 0, 1, 0) ;
Sig3= If(Sig1 or Sig2, 1, 0);
// Up Swing Bars
Sig4 = if((TIMESINCESIGNAL(GSStart) > 0 and Rng < 0), 1, 0);
Sig5= IF(TIMESINCESIGNAL(GSEnd) < 1 and Rng > 0, 1, 0) ;
Sig6= If(Sig4 or Sig5, 1, 0);
// Plot the Down trend Volume
Plot1 = If(Sig3, ACCSINCESIGNAL(Vol(), Sig1), 0) ;
Plot1.Colour = Red;
Plot1.Plotstyle = Histogram;
Plot1.LineWidth = 5;
Plot1.LineStyle = Solid;
// Plot the Down trend Volume
Plot2 = If(Sig6, ACCSINCESIGNAL(Vol(), Sig4), 0) ;
Plot2.Colour = Green;
Plot2.Plotstyle = Histogram;
Plot2.LineWidth = 5;
Plot2.LineStyle = Solid;

++++++++++++++++++++++++++
Hope that was what you were trying to do.
Cheers
Trevor
The Auld Tyma from
Auld Tyma Data Logo 3

Hi Trevor thanks so much for your help, that's exactly what i was trying to do. I didn't realise it was that easy to define the range.

Regarding the Signals i have very limited experience coding and none a boolean result. I am assuming that's what they are. Are there any relevant articles

you could point me to as i would like to try grey matter permitting to get a better handle on it. Thanks again

Hi Kim,

Glad it is the sort of result you were after. Defining the swing range is easy. What proved very challenging was aggregating the volume from the first bar after the SwingStart Bar (Top or Bottom) and including the SwingEnd Bar (Bottom or Top). I didn't what to count the bar at the turning point bar twice.

I have noted that my script produces anomalous results when there is:

  • a 1 Bar Counter Trend, eg 1 Up Bar in a string of Down Bars that results in a swing in the Gann Swing Chart, and vice versa in an Up trend, and also
  • at outside bars.

I suspect the issue is that the Gann Swing Starts and Ends get too close together for the TimeSinceSignals to do their magic, but I haven't dreamt up a fix for that. Fortunately it probably is not too significant on Daily Bar charts with 1 and 2 Bar Gann Swing Overlay, but become very significant on Weekly Bar Charts where, depending in the market, a large number of 1 Bar Counter Trends may be evident.

As for Optuma Scripting assistance search the Optuma Knowledge Base for all the articles on scripting. If you haven't worked through them already, I'd strongly suggest you study the Optuma Scripting Courses - they are FREE!

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo 0

 

 

wyckoff

Hello,

thank you for your script and it works. Unfortunatelly the outcome is different vs wyckoff. The image seems that every time there is a negative close start a new count with new bar.

Can the script be adapted ? without Gann Swing

 

Ciro

 

Hi Ciro,

Please explain exactly what you mean by "some important difference", especially as some of us reading your post, including me, have not studied Wycroft's methods in sufficient depth to identify those differences as you see them.

The script as presented, by my viewing, is doing exactly as previously described in calculating the accumulated volume following each Gann swing top and bottom to the subsequent swing bottom/top, subject to the caveat of possible anomalous results following 1 bar counter trends and outside bars.

If you wish to calculate the accumulated volume without using Gann Swing tops and bottoms, then you will need to clearly define very precisely the Top/Bottom the criteria to establish the signals from which to commence and end the volume calculations. The scripting PIVOT function might be one approach, but I leave that for you to explore.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

 

 

Hi Trevor,

thank you for your replay. I try to give more detail.

In the wise-wase indicator posted initially it seems it works this way:

 

a) if closing price is positive, than volume is green; if next bar the closing price i positive that volume is green and it added to previous volume bar, so it is a cumulative volume.

B) if the closing price is negative, than the previous volume (green bar ) is stopped and new volume bar (Red) start to show in the chart; if the next bar continue to show negative price action the volume is added.

In this way volume indicator is correlated with closing price action.

I hope that this will help you to understant it better.

Really apologize for my bad english.

Kind regards,

Ciro

 

 

I'm looking to find a correct explanation but at the moment i didn't find it.

i'm searching to give you the exact definition forumla

Hi Ciro & Kim,

I've had a closer look at the Weis Wave (https://weisonwyckoff.com/weis-wave/ ) and I've developed the script shown below which I believe meets the requirements of the Weis Wave approach, which I understand to be:

  • Calculate the Accumulated Volume from a Close Top to a Close Bottom, and
  • vice versa.

For example:

From a Close Top, ie a Bar Close that is higher than the previous Bar Close and succeeding Bar Close, add the Volume of each Bar after the Close Top until, and including, the volume of a Close Bottom.

This results in the following:

20190221 Weis Wave Accumulated Volume From Close Tops and Bottoms

The Script Code to produce the "Weis Wave Accumulated Volume From Close Tops and Bottoms" is:

// Weis Wave Accumulated Volume From Close Tops and Bottoms

// Top = If( (Close(2) < Close(1)) and (Close(1) >= Close(0)), 1, 0);

Bottom = If( (Close(2) > Close(1)) and (Close(1) <= Close(0)), 1, 0);

//

// Top to Bottom down Swing Bars

Sig1 = IF((TIMESINCESIGNAL(Top) < TIMESINCESIGNAL(Bottom)) ,1,0);

// Bottom to Top up Swing Bars

Sig2 = IF((TIMESINCESIGNAL(Bottom) < TIMESINCESIGNAL(Top)), 1, 0);

//

// Down Swings

Plot1 = if(Sig1, ACCSINCESIGNAL(Vol(0), Sig1),0) ;

Plot1.color = Red;

Plot1.Plotstyle = histogram;

Plot1.LineStyle = Line;

Plot1.LineWidth = 4;

//

// Up Swings Plot2 = IF(Sig2, ACCSINCESIGNAL(Vol(0), Sig2) ,0);

Plot2.color = Green;

Plot2.Plotstyle = Histogram;

Plot2.Linestyle = Line;

Plot2.LineWidth = 4;

I trust I've understood what you were looking for.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

 

 

Hi Trevor,

as you can see I have compared the two charts, the original one and the optuma chart.

https://weisonwyckoff.com/weis-wave/

The chart is of Caterpillar in 2011 spring.

As you can see there are two difference.

A) the bar colour

B) but more important there are difference on indicator. If you look a 18th May Caterpillar show a reversal price, so the wise indicator switched from red cumulative volume, to new green volume.

 

I hope this will help you a bit.

Ciro

Hi Ciro,

Addressing your comments:

A Bar Chart colours:

The use of OHLC Bars or Candlesticks and their colour scheme is one of personal preference. I happen to like Candles with Optuma's "Swing Relations" colour scheme. It's up to you how you colour your charts.

B Volume indication discrepancies:

Below is the Caterpillar chart from https://weisonwyckoff.com/weis-wave/ and my chart of the same period with my script applied.

20190224 CAT Weis Wave

You will note that at 17-18-19 May 2011 the charts are the same. That, however, cannot be said for the period 3 to 9 June 2011 (yellow highlighted) and the reason for the difference is explained below my chart from Optuma.

20190224 CAT Weis Wave Accumulated Volume From Close Tops and Bottoms

The difference in the volume aggregation during the period 3 to 9 June arises, I believe, from a further limitation included in the application of the "Wies Wave" in the top chart. On that chart I have highlighted the comment "5¢ wave from daily closes". I interpret this to mean that the difference between successive Closes must be at least 5¢. This limiting criteria is not addressed in the script I presented previously, which considers that the a minimum price movement can cause a change in trend. I've ignored this limiting criteria because it will be different for different markets, as can be seen in the various charts in the referenced article, eg 0.0003 pip in the case of EUR/USD, 0.75 Point on S&P and 10¢ on AEM. My script can be applied universally, whereas those varying swing limiting criteria would require separate scripts embodying their respective limiting criteria for each market. I leave it for you to amend the scripts to meet your specific requirements.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

 

Hello Trevor,

it maybe there is some settings that doesn't work.

I used Candlestick with Swing Relations, but the indicator is Always red.

And i can't understand why, do you have any ideas ?

Ciro.

Hi Ciro,

Yes, I can see why. Have a go with this version of the script:

 

// Weis Wave Accumulated Volume From Close Tops and Bottoms

//

Top = If( (Close(2) < Close(1)) and (Close(1) >= Close(0)), 1, 0);

Bottom = If( (Close(2) > Close(1)) and (Close(1) <= Close(0)), 1, 0);

//

// Top to Bottom down Swing Bars

Sig1 = IF((TIMESINCESIGNAL(Top) < TIMESINCESIGNAL(Bottom)) ,1,0);

// Bottom to Top up Swing Bars

Sig2 = IF((TIMESINCESIGNAL(Bottom) < TIMESINCESIGNAL(Top)), 1, 0);

//

// Down Swings

Plot1 = if(Sig1, ACCSINCESIGNAL(Vol(0), Sig1),0) ;

Plot1.color = Red;

Plot1.Plotstyle = histogram;

Plot1.LineStyle = Line;

Plot1.LineWidth = 4;

//

// Up Swings

Plot2 = IF(Sig2, ACCSINCESIGNAL(Vol(0), Sig2) ,0);

Plot2.color = Green;

Plot2.Plotstyle = Histogram;

Plot2.Linestyle = Line;

Plot2.LineWidth = 4;

 

It looks like I copied a development version of the script in my earlier post - one could call it a "scripting challenge". Apologies for the confusion.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

 

Trevor i have been away and so would thank you for your input. On researching further it would appear the Weis wave incorporates the Zig Zag which would be the same or similar to Percent swing overlay in Optuma. "used to filter out relatively small price movements. You can preset the deviation as a percentage in order to discard smaller moves" That is what is meant by “5¢ wave from daily closes”. The problem with the zig zag is it repaints. However there is a work around please see article https://forums.babypips.com/t/stochastic-indicator-and-the-zigzag-indicator-know-the-truth/40507. I have tried to rewrite the Script to encapsulate the ability to preset the deviation but its not working and would appreciate some help. I would also like to incorporate a secondary criteria based around the stochastic discussed in the article to stop the indicator repainting but my scripting expertise is limited and i have no idea how that would be achieved or if this possible. My updated script is as follows :

//Volume Between Swings

PSW = PERCENTSWING(PERCENT=5.0, DEFAULT=SwingEnd, COLOURSTYLE=Up/Down);

PSWStart= SWINGSTART(PSW);

PSWEnd = SWINGEND(PSWEnd);

Rng = PSWStart-PSWEnd;

// Down Swings bars

Sig1 = if((TIMESINCESIGNAL(PSW) > 0 and Rng > 0) , 1, 0);

Thanks

Sig2 = IF(TIMESINCESIGNAL(PSWEnd) < 1 and Rng < 0, 1, 0) ;

Sig3= If(Sig1 or Sig2, 1, 0); // Up Swing Bars

Sig4 = if((TIMESINCESIGNAL(PSW) > 0 and Rng < 0), 1, 0);

Sig5= IF(TIMESINCESIGNAL(PSWEnd) < 1 and Rng > 0, 1, 0) ; Sig6= If(Sig4 or Sig5, 1, 0);

// Plot the Down trend Volume

Plot1 = If(Sig3, ACCSINCESIGNAL(Vol(), Sig1), 0) ;

Plot1.Colour = Red; Plot1.Plotstyle = Histogram; Plot1.LineWidth = 5;

Plot1.LineStyle = Solid;

// Plot the Up trend Volume

Plot2 = If(Sig6, ACCSINCESIGNAL(Vol(), Sig4), 0) ;

Plot2.Colour = Green; Plot2.Plotstyle = Histogram; Plot2.LineWidth = 5;

Plot2.LineStyle = Solid;

Screen shot attached

 

 

 

Hi Kim,

Unfortunately, due to other commitments, I don't have time to study your referenced article and analyse your script at present.

However, I would caution the use of SWINGSTART and SWINGEND, both of which, I believe, require the GANNSWING() function definition (https://forum.optuma.com/topic/help-with-gann-swing-pattern-solution-please/) before they can be used. Also, one must remember that a SWINGEND becomes a SWINGSTART at the end of one swing, which is of course the start of a new swing.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

Hi Kim,

Have you had any luck with the Weis wave script ? I would also like to be able to apply Weis wave to my charts but I am not having much luck and my scripting knowledge is very low.

 

Cheers Shannon

Hi Kim,

Apologies for not getting back to you sooner, but here is a revised version of your script. I've commented out the parts of your script and added my changes in bold italics so you can see what I've done.

// Kim #51395 20190303

//Volume Between Swings

//PSW = PERCENTSWING(PERCENT=5.0, DEFAULT=SwingEnd, COLOURSTYLE=Up/Down);

PSW = PERCENTSWING(PERCENT=10, DEFAULT=SwingList, COLOURSTYLE=Up/Down);

PSWStart= SWINGSTART(PSW);

//PSWEnd = SWINGEND(PSWEnd);

PSWEnd = SWINGEND(PSW);

Rng = PSWStart - PSWEnd;

// Down Swings bars

//Sig1 = if((TIMESINCESIGNAL(PSW) > 0 and Rng > 0) , 1, 0);

Sig1 = if((TIMESINCESIGNAL(PSWStart) > 0 and Rng > 0) , 1, 0);

//Sig2 = IF(TIMESINCESIGNAL(PSWEnd) < 1 and Rng < 0, 1, 0) ;

Sig2 = IF(TIMESINCESIGNAL(PSWStart) > 0 and Rng < 0, -1, 0) ;

//Sig3= If(Sig1 or Sig2, 1, 0);

// Up Swing Bars

//Sig4 = if((TIMESINCESIGNAL(PSW) > 0 and Rng < 0), 1, 0);

//Sig5= IF(TIMESINCESIGNAL(PSWEnd) < 1 and Rng > 0, 1, 0) ;

//Sig6= If(Sig4 or Sig5, 1, 0);

// Plot the Down trend Volume

//Plot1 = If(Sig3, ACCSINCESIGNAL(Vol(), Sig1), 0) ;

Plot1 = If(Sig1, ACCSINCESIGNAL(Vol(), Sig1), 0) ;

Plot1.Colour = Red;

Plot1.Plotstyle = Histogram;

Plot1.LineWidth = 5;

Plot1.LineStyle = Solid;

// Plot the Up trend Volume

//Plot2 = If(Sig6, ACCSINCESIGNAL(Vol(), Sig4), 0) ;

Plot2 = If(Sig2, ACCSINCESIGNAL(Vol(), Sig2), 0) ;

Plot2.Colour = Green; Plot2.Plotstyle = Histogram;

Plot2.LineWidth = 5;

Plot2.LineStyle = Solid;

Here what the resulting plot looks like (with PercentSwing = 10%): 20190503 Kim #51395 20190303

Is this the result you are after?

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

Hi Trevor,

I have used your latest script for Weis Wave but I am having some issues. The first is I am not getting the swing overlay on the chart and the second is show view isn't showing accumulative volume it is just showing equal height bars across show view. Please see attached screen shot of my issue.

If you could please help that would be very much appreciated.

Thank you Shannon. Weis Wave

Hi Shannon,

The swing overlay is a standard Optuma tool: Percent Swing Chart Overlay (PCSC).

As to the second issue, I suspect that you have done a straight copy from the Forum and paste into the Script Manager. Unfortunately this can introduce hidden characters that interfere with the operation of the script. To avoid this problem when copying scripts from anywhere it is advisable to first paste the script into a text only editor like Notepad or Notepad++, then do a second copy and paste in the Optuma Manager. That way any hidden characters are completely removed from the script before pasting into Optuma.

Make sure when you apply the PCSC and the "#% Swings Volume" (as I've named it on my system) script to a chart that your set the same percent value (eg 10%) in both the tool and the script, otherwise you'll be scratching your head again.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm