Variant Of Weis Wave

Hi Trevor,

Thanks for the quick reply.

I have now added the PCSC tool and have downloaded Notepad++ and have copied and pasted the script as you have suggested as I was previously coping straight from this forum.

Unfortunately I'm still having the same issues please see my attached picture of the steps I have taken.

Cheers Shannon

Notepad++Weis Wave With ScriptWeis Wave Swing Overlay

Hi Shannon,

The first thing i can see in the screen shot you provided is that the Show View has been applied to the Volume tool, not the chart itself…

Ex3

For the script to work you need to apply the Show View to the chart.

If that doesn’t fix it, Edit the script and go to the RNG line (8th from the top), and remove the - sign, then re-add it. This symbol is sometimes pasted in incorrectly, even from Notepad, and deleting / readding it is the only way to fix it. (The next major update to Optuma will include improvements to pasting scripts from outside sources to stop this).

 

Trevor thanks so much for your assistance. I had derived a workaround but your script is better. Shannon from what i can see you are not deleting the parts of the script that Trevor has replaced. I also took Mathews advice re removing and replacing -

The revised script is then

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

PSWStart= SWINGSTART(PSW);

PSWEnd = SWINGEND(PSW);

Rng = PSWStart - PSWEnd;

// Down Swings bars

Sig1 = if((TIMESINCESIGNAL(PSWStart) > 0 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(Sig1, ACCSINCESIGNAL(Vol(), Sig1), 0) ;

Plot1.Colour = Red;

Plot1.Plotstyle = Histogram;

Plot1.LineWidth = 5;

Plot1.LineStyle = Solid;

// Plot the Up trend Volume

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

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

Plot2.LineWidth = 5;

Plot2.LineStyle = Solid;

The screenshot attached is 5 percent swing

Hi Kim & Shannon,

Kim, your Percent Plot on the chart is 5% and your script 10%. Always make sure they are the same

Here is a minimalist listing of the script, use Notepad to copy/paste and replace the "em dash" with a hyphen "-" (as suggested by Matthew) when using this script:

// Kim's Weis Wave 20190513

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

PSWStart= SWINGSTART(PSW);

PSWEnd = SWINGEND(PSW);

Rng = PSWStart - PSWEnd;

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

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

// Plot the Down trend Volume

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(Sig2, ACCSINCESIGNAL(Vol(), Sig2), 0) ;

Plot2.Colour = Green;

Plot2.Plotstyle = Histogram;

Plot2.LineWidth = 5;

Plot2.LineStyle = Solid;

Here a screenshot with both the script and Percent Swing Overlay Plot set for 10%:

20190513 Kims Weis Wave

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

I wanted to be able to see the cumulative volume for each swing (as in the Gann Swing Overlay) on a chart. I found a script in this thread (#49999) which looked something like what I needed. After looking at Optuma’s scripting videos I managed to create it as a new tool, however when I apply it to a chart it shows the output over the chart area see below) - not beneath the chart (as would be the case with say the way the Volume tool displays . The second issue is that the forum thread talks about a 2 bar swing and I’m just looking for the cumulative volume of each swing - ie not sure what effect the 2 bar condition would have. My first foray into scripting other than for some basic scanning so any help would be appreciated.

EDIT: I found that if I added Volume to a chart and then ran my new script tool it does display as per the thread example. However, I’d still appreciate an explanation of what impact the 2 bar criteria in the thread example has (I’m assuming it means there needs to be a swing of 2 bars?) - and how would I amend the script to achieve what I want?

Swing volume

Hi Robert,

I see you have 3 questions:

1 Placement of the script on the chart:

To place the script on the chart under the bar/candlestick use the SHOWVIEW. Select the SHOWVIEW tool and apply it to the chart, then go to the SHOWVIEW properties and select the script to be displayed.

2 Changing the script for 1 Day Gann Swing:

Change the SWINGCOUNT =1 in the GANNSWING line of the script.

3 Using the script for 1 Bar Gann Swings:

My post #50055 on 2 Dec 2018 5:36 PM in this thread describes a couple of anomalies when using the 1 Bar Gann Swing. To date I haven't come up with a way of avoiding those anomalies when using the Gann Swing function.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

Thanks for the input. There seems to be some errors in the output (or perhaps I’m just not reading it correctly!)

On the chart below there is a single red volume bar on 12 November with a volume of 15M. I really can’t work out how it arrives at that result. I’m guessing it is something to do with that swing down only being 2 days long? I’ve noticed this result on other charts as well.

Then on the last chart for BLD there is this strange red and green bar a few days from the right hand side? I’ve also seen this multi-coloured bar output elsewhere.

script error

BLD script

Duplicated post but can’t find option to delete?

Hi Robert,

Firstly, I’m assuming you’ve named your script “SwingVolume”, so from your chart of CCL you appear to have applied the SHOWVIEW to the Volume view (“Volume & SwingVolume”). Doing this will undoubtedly produce erroneous results.

When selecting a SHOWVIEW, select a blank area on the candlestick chart, right click, select the “spanner” and type SHOWVIEW and either click Enter, or select SHOWVIEW with the cursor and click - this will open a SHOWVIEW view panel below the chart panel. The initiation of the SHOWVIEW MUST be on the candlestick (or bar) chart. Then go to the SHOWVIEW Properties and select the script to be displayed.

Secondly, those anomalies that you’ve identified are exactly what I was alluding to in my posts #50055 on 2 Dec 2018 5:36 PM and #56637 yesterday. The issue arises from the algorithm used to identify the Gann Swing which must be confirmed before it can identify the swing tops and bottoms. That plays havoc with trying to use it for aggregating the volume between the swing tops and bottoms as you are trying to do here. I’ve given up on try to find a fix as it is not a high priority for me. Maybe someone else can come up with a solution.

Cheers

Trevor

The Auld Tyma from

Auld Tyma Data Logo with URL 1 cm

 

Thanks for your input but given there doesn’t seem to be an easy fix for this problem, do you know if it’s possible to pay for a solution (assuming it is solvable). Should I take it up with Optuma?

Hi Robert

As a work around I use price time labels which you can configure for cumulative volume

Search Knowledge base or go here https://help.optuma.com/kb/faq.php?id=387

I find it much more flexible than any fixed script

Hope it helps

Cheers Kim

 

 

Hi Robert,

You could check Optuma’s Consulting Service for paid assistance with your scripting requirement.

Cheers

Trevor

Re my previous query on this thread I approached Optuma who said they would prefer I put the following query to the forum before they get involved.

The issue with the scripts on the forum is that engulfing and inside bars give false output. I just want to sum the volume to a variable (Plot1 in the output part of a scipt appended below) while the Gannswing() IsDown and then when the swing changes, zero Plot1 and sum the volume to Plot2 while it stays in the up direction. If the scripting language had a Do While loop command (which it doesn’t seem to) I could probably do this myself but not being familiar with the language it’s a daunting task.

Probably a 5 minute task for someone conversant with scripting but I’ve been struggling with it for half of today! At least I’ve got a better idea of the language.

Follows is the extract of the display part of a script from the forum that I started playing around with. If I could calculate Plot 1 and Plot 2 I’d be home!

// Plot the Down trend Volume

Plot1 = ?>;

Plot1.Colour = Red;

Plot1.Plotstyle = Histogram;

Plot1.LineWidth = 5;

Plot1.LineStyle = Solid;

// Plot the Up trend Volume

Plot2 = ? ;

Plot2.Colour = Green;

Plot2.Plotstyle = Histogram;

Plot2.LineWidth = 5;

Plot2.LineStyle = Solid;

 

Any assistance greatly appreciated.

Hi Trevor,

I tried to apply your original script (also copied below). Simply copied pasted into a new script. The only thing I see as plotted are flat lines, not your type of histogram
Has there been any change in the script parameters or operators since 2018 for it not to work ?

 

Thanks

Axel

 

================

 

// 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;

Hi Axel,

You mention you just copied and paste the script directly into Script Manager. This is fraught with issues as you are copying HTML code from the Forum into the Script Manager which requires clean text formatting. (If you read through all the posts in this thread you’ll find explanations of the issues you’ve encountered.)

So, you need to:

  • copy the code into Notepad, then
  • copy it from Notepad to the Script Manager, then
  • go through the code and delete any "-" and replace them ["-" can get through the Notepad text as an "em" (a longer dash) rather than a "-" (a short dash or hyphen) and this will cause issues when the script runs].
Hopefully this will resolve the issue for you.

Cheers

Trevor

 

Hi All,

Just letting you know that there is an issue with this script in the 1.6 Beta. It seems that my changes to TIMESINCESIGNAL() to allow offsets is not working correctly with the Gann Swing results.

We’re looking into this now.

All the best

Mathew

Hi Kim,

I’m sorry I did not look at this in more detail when you first posted (I was preparing to move from the US back to Aus, so have been a bit distracted).

For reference, here is some code to do the Weis Waves.

// is this close higer than previous close
vUp = CLOSE() >= CLOSE()[1];

// remember that true = 1 and false = 0
vUpSig = vUp ChangeTo 1;
vDnSig = vUp ChangeTo 0;

// Plot the Down trend Volume
Plot1 = If(vUp == 0, ACCSINCESIGNAL(Vol(), vDnSig), 0) ;
Plot1.Colour = Red;
Plot1.Plotstyle = Histogram;
Plot1.LineWidth = 5;
Plot1.LineStyle = Solid;

// Plot the Down trend Volume
Plot2 = If(vUp == 1, ACCSINCESIGNAL(Vol(), vUpSig), 0) ;
Plot2.Colour = Green;
Plot2.Plotstyle = Histogram;
Plot2.LineWidth = 5;
Plot2.LineStyle = Solid;

To Trevor’s point above - make sure you use the “<> Code” button in the forum toolbar to insert code. That avoids the text editing changing characters.

Now, to the idea of a Gann version of this, I would strongly caution against using swing charts for this. The issue is the lag from the swing bottom until we know it was a bottom. We could use the confirm dates of the swings (when we knew the swing had changed - change the colour style to “Unconfirmed” and you will see the difference this makes) but that will apply an offset to the interval for which the volume is being accumulated.

We also need to couple this with the fact that volume typically fades as the trend continues. So if we delay we are missing the major volume at the start of the swing.

So we have two choices:

  1. We accumulate from swing bottom to swing top.
  2. We accumulate from confirmation date to confirmation date.
This all gets much more complex when we are working with swings. Make sure you have a look at this post https://www.optuma.com/swing-scripting-1/

Put this script in a Show Plot

GS = GANNSWING(DEFAULT=SwingList, USECLUSTERS=False, USEBREAKOUT=False, SWINGCOUNT=2);
GS.SwingEnd

And compare that with this version

GS = GANNSWING(DEFAULT=SwingList, USECLUSTERS=False, USEBREAKOUT=False, SWINGCOUNT=2);
SWINGEND(GS)

The second one is giving us the flat lines at the extremes of the swings.

Ok, enough blabbing - here is a script that will do what you are looking for (subject to all the caveats above).

// Is our swing up
GS = GANNSWING(DEFAULT=SwingList, USECLUSTERS=False, USEBREAKOUT=False, SWINGCOUNT=2);
// close() > 0 is a hack we use to convert from swings to bars
vUp = SwingUp(GS)  and (Close() > 0);

// when does the swing turn
vUpSig = vUp ChangeTo 1;
vDnSig = vUp ChangeTo 0;

// Plot the Down trend Volume
Plot1 = If(vUp == 0, ACCSINCESIGNAL(Vol(), vDnSig), 0) ;
Plot1.Colour = Red;
Plot1.Plotstyle = Histogram;
Plot1.LineWidth = 5;
Plot1.LineStyle = Solid;

// Plot the Down trend Volume
Plot2 = If(vUp == 1, ACCSINCESIGNAL(Vol(), vUpSig), 0) ;
Plot2.Colour = Green;
Plot2.Plotstyle = Histogram;
Plot2.LineWidth = 5;
Plot2.LineStyle = Solid;

Hope that helps

Mathew

Hi Matthew and Trevor,

 

Trevor, apologies but did not notice at once this is a 3 pages thread. Having said that I wrote copy/paste, but in fact did go via a simple text editor first - learned this the hard way many years ago :frowning: . Your recommendation is very valid indeed.

Ok, read the entire thread in the meanwhile. Noted the last post of Matthew w/ great interest, thank you for the update script and potential issues ! This helps a lot.
Also noted your recommendation to post a code using the <>Code function

Thanks to both,

Axel

 

Hi, I just learned from another email chain that the creator of Weis Wave, David Weis passed away yesterday. I was searching the forum to see if anyone was talking about him and found this chain - just thought I’d pass the info along. RIP

Jeff