Variant Of Weis Wave

Optuma Forums Optuma Scripting Variant Of Weis Wave

This topic contains 4 replies, has 2 voices, and was last updated by  Trevor R 1 week, 1 day ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #49967

    Kim
    • Topics: 1
    • Replies: 2
    • Posts: 3

    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

     

    Attachments:
    #49991

    Kim
    • Topics: 1
    • Replies: 2
    • Posts: 3

    Another attempt

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

    Attachments:
    #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  

    #50011

    Kim
    • Topics: 1
    • Replies: 2
    • Posts: 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

    #50055

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

    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

     

     

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

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