Variant Of Weis Wave

Optuma Forums Optuma Scripting Variant Of Weis Wave

Tagged: 

This topic contains 23 replies, has 5 voices, and was last updated by Avatar Trevor R 3 months, 1 week ago.

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #49967
    Avatar
    Kim
    • Topics: 1
    • Replies: 4
    • Posts: 5

    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
    Avatar
    Kim
    • Topics: 1
    • Replies: 4
    • Posts: 5

    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
    Avatar
    Trevor R
    • Topics: 41
    • Replies: 128
    • Posts: 169

    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
    Avatar
    Kim
    • Topics: 1
    • Replies: 4
    • Posts: 5

    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
    Avatar
    Trevor R
    • Topics: 41
    • Replies: 128
    • Posts: 169

    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

     

     

    #51295
    Avatar
    Ciro
    • Topics: 6
    • Replies: 9
    • Posts: 15

    Some important difference

    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

     

    #51299
    Avatar
    Trevor R
    • Topics: 41
    • Replies: 128
    • Posts: 169

    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

     

     

    #51303
    Avatar
    Ciro
    • Topics: 6
    • Replies: 9
    • Posts: 15

    WEIS WAVE

    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

     

     

    #51307
    Avatar
    Ciro
    • Topics: 6
    • Replies: 9
    • Posts: 15

    I'M LOOKING

    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

    #51311
    Avatar
    Trevor R
    • Topics: 41
    • Replies: 128
    • Posts: 169

    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

     

     

    #51319
    Avatar
    Ciro
    • Topics: 6
    • Replies: 9
    • Posts: 15

    Still different, but close

    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 

    Attachments:
    #51335
    Avatar
    Trevor R
    • Topics: 41
    • Replies: 128
    • Posts: 169

    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

     

    #51339
    Avatar
    Ciro
    • Topics: 6
    • Replies: 9
    • Posts: 15

    SOMETHING DOES'T WORK

    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. 

    Attachments:
    #51347
    Avatar
    Trevor R
    • Topics: 41
    • Replies: 128
    • Posts: 169

    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

     

    #51395
    Avatar
    Kim
    • Topics: 1
    • Replies: 4
    • Posts: 5

    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

     

     

     

    Attachments:
Viewing 15 posts - 1 through 15 (of 24 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