Trying to build a simple indicator (Ratio of the ongoing wave Vol. vs the avg Vol. of the past 10 waves) New

Login or Register

Please login or register in order to view and post in the Forum.

6 posts / 0 new
Last post
Eyal Okin
Last seen: 10 hours 7 min ago
Joined: 06/03/2023 - 12:54
Trying to build a simple indicator (Ratio of the ongoing wave Vol. vs the avg Vol. of the past 10 waves)

Hi there,
I'm trying to build a custom indicator I can use on native rt investor zigzag. The idea is to calculate the ratio of the current wave volume to the average volume of other 10 waves, both up waves and down waves. So for instant if the wave shows 1.4 it means that this wave is 150 percent of the average of last 19 waves. I'm positive it is pretty simple for somebody who does coding, but I'm struggling with implementation. Any help?

0
marcns
Last seen: 3 days 17 hours ago
Joined: 12/30/2021 - 10:46
Try this chart definition

Try this chart definition below, it should display the info you need.

BEGIN Investor/RT CUSTOM INDICATOR DEFINITION for ZigVol_vsZigVol_Ave
COMMENT=NONE
SOURCE=
PLATFORM=Windows 10 x64 (6.2, Build 9200)
DATE=2025-05-11 15:02
VERSION=15.1.25 x64 (Build #33565 Mar 22 2024 22:32:52)
DATAFEED=CQG Continuum
NAME=ZigVol_vsZigVol_Ave
BARCOUNT=AUTOMATIC
ELEM=ZZO:Zig Zag Oscillator:ZIGOSC[ ] 20,C PREFS: 0,128,255,2,2,0,2,20,T,T,5,199,53,102,2,1240900,2009544058,T,4,15001500,187,0,0,96,13,3541240,29568,8,F,18,2,30663,\0,\0,16,F,0,0,16,3273,0,0,16,F,32,F,-1,223,0,1,-2944,469791472,2,-4060,18,-21928,T,T,54,-3088,234,F,223,3273,-32511,F,2,F,F,10,-3088,234,-0,^r,0,0,0,0,-2944,18,F,1241244,-22967,0,1,30665,2536,19713,0,0,F,22,0,
ELEM=ZZO_xbar_ave:Zig Zag Oscillator:ZIGOSC[ ] 20,C PREFS: 0,128,255,2,2,0,2,20,T,T,5,199,53,102,2,1240900,2009544058,T,4,15001500,187,0,0,96,13,3541240,29568,13,F,18,20,30663,\0,\0,16,F,0,0,16,3273,0,0,16,F,32,F,-1,223,0,1,-2944,469791472,2,-4060,18,-21928,T,T,54,-3088,234,F,223,3273,-32511,F,2,F,F,10,-3088,234,-0,^r,0,0,0,0,-2944,18,F,1241244,-22967,0,1,30665,2536,19713,0,0,F,22,0,
INDICATOR=ZZO / (ZZO_xbar_ave/ 20)
END Investor/RT CUSTOM INDICATOR DEFINITION for ZigVol_vsZigVol_Ave
BEGIN Investor/RT CHART DEFINITION for Untitled_73
--
--To Import This Chart, drag and drop this file onto any Investor/RT window, or:
--1. Select all the text in this file.
--2. COPY to clipboard (Ctrl+C)
--3. Go to Investor/RT and PASTE (Ctrl+V)
--To learn more about importing definitions see www.linnsoft.com/importing.
--
COMMENT=NONE
SOURCE=MC
PLATFORM=Windows 10 x64 (6.2, Build 9200)
DATE=2025-05-11 15:02
TIMEZONE=GMT Summer Time (UTC + 0:00) DST
VERSION=15.1.25 x64 (Build #33565 Mar 22 2024 22:32:52)
DATAFEED=CQG Continuum + DTNMA ORS=12 CQG
NAME=Untitled_73 SIZE=837,2049
PERIODICITY=3,1,1 (1 Minute)
PIXELS=2:0
LOOKAHEAD=0
RMARGIN=30
CFLAGS=524288 CFLAGS2=268488353
VIEWPERIOD=1,1,120,3815334000,3829849260 (Last 120 hours)
SUBSESSION=0,30,2
COLORS=8553090,16777215,7237230,16053492,15921906,11842740,16777215,0,0
DESC=Untitled_73: @JY# (1m) 1 Minute, Full Session 23:00-22:00
SESSION OVERRIDE=31 24 Hour Session: Hours: 23:00 to 22:00
TICKER=@JY#:GLOBEX:31 SECTYPE=3 DISPLAY=28 ALIAS=@JY# DAYSESSION=2
-Tick Data: 10 Days, Intraday: 838 Days, Daily: 500 Days
PANE #1 PCT=0.001258 PFLAGS=256 SCALE=1,0.000000,0.000000,0.000000,0.000000,0.000000,0,0
PANE #2 PCT=0.700629 PFLAGS=32776 SCALE=0,0.006856,0.006958,0.000000,0.000000,0.000000,0,0
INDICATOR: ZIG #91 ASSOC: @JY#:GLOBEX:31 ID#1 PERIODICITY: 3,1,1 DESC: ZIGZAG[@JY# (1m) 4] 20,C Tot Vol LABEL: T TXTLBL: F,"AUTO",F RECALC: 0,0 PREFS: 0,128,255,2,2,0,2,20,T,F,5,0,0,255,2,2,0,F,4,15001500,1,16,96,1,1241032,2010419839,14,0,F,T,-8192,1,myLabel,50.061.878.6,F,F,0,0,255,2,2,0,F,F,0,F,F,F,255,0,0,2,2,0,F,T,8,T,T,F,F,F,F,0,0,F,F,2,F,F,10,F,0,8,Play Corkpop,0,0,1,0,F,20,F,20000,0,30666,32767,F,F,0,1000,2,F,F,3,
INSTRUMENT: @JY#:GLOBEX:31 ID#1 PERIODICITY: 3,1,1 TYPE: 2,2,28 COLORS: 0,12632256,1,0 [Alias: @JY#]
VAP_FOOTPRINT: 0,0,2,0,9,0,0,100,0,0,0,4160,50,0,0,0,0,0,0,0,Arial,0,
SESSION #31. 24 Hour Session: Closed,UnPosted, Hours: 23:00 to 22:00
PANE #3 PCT=0.299371 PFLAGS=8 SCALE=1,-0.210000,3.850000,0.000000,0.000000,0.000000,0,0
INDICATOR: CI #40 ASSOC: @JY#:GLOBEX:31 ID#1 PERIODICITY: 3,1,1 DESC: CI:ZigVol_vsZigVol_Ave[@JY# (1m) 1] ZZO / (ZZO_xbar_ave/ 20) LABEL: T TXTLBL: F,"",F RECALC: 0,0 PREFS: 0,51,255,2,2,0,ZigVol_vsZigVol_Ave,0,0,3,F,15693672,3,255,0,0,0,0,0,6,70,F,0,F,50,F,F,14001400,1,0,2,0,F,F,0,0,255,1,2,0,33488896,33619712,21672,4.000000,8.000000,12.000000,1,1,F,T,F,F,0,F,F,1020,405,A1,F,F,3,
- This chart definition references 1 RTL object (scan/signal/custom indicator)
END Investor/RT CHART DEFINITION for Untitled_73

Eddy
Last seen: 2 min 6 sec ago
Joined: 03/01/2024 - 15:25
Using ZigZag Oscillator tokens for analysing Wave Volume

Marcus, thank you for your contribution, I was about to post a similar chart (in the chart share) :

https://www.linnsoft.com/charts/ef-wave-vol-analysis-es

Eyal, the good thing is that you don't really need any coding, but just a very basic custom indicator (the ratio between the ongoing wave volume and the avg vol of the past X waves) and some knowledge about the Zig Zag Oscillator, as both values of this ratio will be derived from 2 ZZO tokens, which I have also added as indicators  on the attached chart

In the bottom pane, you have the ZZO indicator returning the total volume of the current wave, which is defined based on a retracement criteria expressed in ticks (chart variable C#1) that can be adjusted with the corresponding up/ down set C# "incremental buttons". You can also adjust (with the C#2 variable button) the number of waves being used for the average

The second pane uses one of the Flex statistics output options of the zigzag oscillator. Flex Statistics allows the user to specify a combination of statistics (Avg, Sum, Max, Min), data items (Rotation Size, Pivot Price, Total Volume, etc), number of legs, and the direction of legs (all legs, up legs only, down legs only). This combination of options allows the user to extract just about any statistical data imaginable from the market-structured moves organised by the Zig Zag Indicator. Review this video for more on this flex statistic options. 

The final trick is to use the "Custind" label option of the zigzag indicator to display the value of the ratio on top of each pivot bar. If you just want also to keep track of the spot value (for the current bar) without having to diplay the custom indicator, you may store the currnet CI value into a V# variable (V#1) and add an "annotation" indciator with "Spot ratio : %V#1" as text

For your information, I have just updated the ZZO indicator webpage : https://www.linnsoft.com/techind/zig-zag-oscillator-indicator-zzo

The preference tab now includes a comprehensive presentation (by category) of all the 45+ outputs that can be derived from the Zig Zag oscillator

Eyal Okin
Last seen: 10 hours 7 min ago
Joined: 06/03/2023 - 12:54
Guys , thank you some much! I

Guys , thank you some much! I was hoping for some simple instructions, but got so much more!!!

Eddy
Last seen: 2 min 6 sec ago
Joined: 03/01/2024 - 15:25
Another type of Wave analysis using the ZZO token

For the record, I posted recently, for another user, a chart relying also on the ZZO token.

https://www.linnsoft.com/charts/ef-demo-zzo-stat-v-esm5

Here the question was to calculate how many pivots High back (resp. Low) you have to go to find a pivot with a higher price (resp. lower).  

To achieve that result, you need to use the ZZO token to identify the up and down pivot bars and the STAT indicator for getting access to the number of bars since a Higher High or Lower low.

Then you do a SUM to count the number of wave up/dn to find back a higher high / lower low..

Eyal, after posting this, you asked a slightly alternative question, ie how many waves with up volume back (resp. Low) I have to go back to find a wave with an higher volume(resp. lower) than the current one

You will find the chart corresponding to this case posted here

https://www.linnsoft.com/charts/ef-demo-2-zzo-stat-esm5

The syntax of the corresponding required wave Count is very similar (see screenshot below) to the first chart. The whole trick here is to observe that instead of a price, you are asking to compare relative wave volumes

So instead of using a plain STAT indicator token to find the number of bars since a Higher Higher, you need to use STAT(CI) to have that higher high comparison based on that CI value instead of the price itself (with the CI being the wave Up volume in that case)

 

Eyal Okin
Last seen: 10 hours 7 min ago
Joined: 06/03/2023 - 12:54
Eddy, I might sound

Eddy, I might sound repetitive, but once again: huge thanks for your time and patience!