Reply To: Variant Of Weis Wave

Optuma Forums Optuma Scripting Variant Of Weis Wave Reply To: Variant Of Weis Wave

#49999

Trevor R
  • Topics: 15
  • Replies: 32
  • Posts: 47

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  

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close