ZigZag with bar and pips counter.

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Re: ZigZag with bar and pips counter.

Postby LeTigre30 » Thu Sep 12, 2013 12:41 am

Hello TheLight,

My english knowledge is so poor, I don't well understand totally your request. Could you send me more details ; I think I have a bad understanding of this. In your example of 2.5%, does it mean that pips represent a certain percentage versus the last counter ?

I try to detail (on my favorite instrument XAUUSD)

The current counter - a Top- shows 600 pips ; the previous one -a Bottom- is at 1550,00 USD, so the difference is about 6,00 USD from the Bottom to the Top, that equal at a % of :
600 / 155000 or 6 USD / 1550 USD = 0.387096774 % (how many decimals must be shown ?) ?

is it right ?

How you use this percentage ?

Bst Rgds,
LeTigre30
User avatar
LeTigre30
FXCodeBase: Initiate
 
Posts: 173
Joined: Sun Dec 19, 2010 5:10 am
Location: Nimes (France)

Re: ZigZag with bar and pips counter.

Postby TheLight » Thu Sep 12, 2013 1:28 pm

Hi LeTigre30,

I am sorry for the confusion. I will try to simplify.

With the original ZigZag_Counter.lua

Each swing, up or down shows
x bars x pips

With the default 12, 5, 3 setting
I show on my XAU/USD D1 (daily) chart the last upswing completed was:
16 bars 16080 pips

I would like to know or display the 16080 as a % of the price to see how big or small the swing was compared to the price of the market.

The question would be, what price reference to use. Possibly the simplest is the closing price of the last bar of the referenced swing.

So in the XAU example of 16 bars 16080 pips, the close price was 1,417.20 on 08/28/2013. This was the swing high bar that gave us the calculation.

16080 / 141720 = 0.1135 or 1.135%
Displayed on chart as: 16 bars 16080 pips 1.135%

I mainly trade the currency pairs, so when trading CFD's does this present a consistency problem when trying to calculate a % with the ZigZag_Counter across all trade-able markets?

The purpose is having the ability by looking at each chart with the ZigZag_Counter applied and knowing immediately the swing pattern i.e. # of bars, # of pips, % of change (without having to always be putting the data into a spreadsheet to calculate)

I hope this helps. Thank you.
TheLight
 
Posts: 13
Joined: Tue Aug 07, 2012 1:50 pm
Location: Arizona, USA

Re: ZigZag with bar and pips counter.

Postby TheLight » Thu Sep 12, 2013 1:54 pm

Sorry LeTigre30

Calculation should be:
16080 / 141720 = 0.1135 or 11.35% or
160.80 / 1,417.20 = 0.1135 or 11.35%
Displayed as: 16 bars 16080 pips 11.35%
TheLight
 
Posts: 13
Joined: Tue Aug 07, 2012 1:50 pm
Location: Arizona, USA

Re: ZigZag with bar and pips counter.

Postby LeTigre30 » Thu Sep 12, 2013 4:05 pm

Hello TheLight,

It's more understanding now for me.
One can be add in the indi's parameters, or automatically, show the % in relation with the close price of the bar who support the label, and the % between the previous label and the current label.

I would like bring a precision : the indicated number of bars, include the two extreme bars, that is in my logic, not conform, as the peak is plotted at the closing price, so when the bar is totally finished, and a new bar is started. In your example, from 08/08/2013 to 08/28/2013, there are only 15 bars, which start at the open price of 08/08/2013 and finish at the close price of 08/28/2013. Please, give me your feed back on this ...

If I take your example : on XAUUSD Daily chart, 16 bars with 16074 pips (not 16080), I think I'm able to show the following percentages :

a)- % given by NbPips / Current Higher (or Lower) price (the zigzag is plotted on the top and bottom peaks), if your check the result of the top of 08/28/2013, i.e. 1434.05 (Higher) and the Lower price of 08/08/2013, as 1273.31, the result is 160.74 which gives 16074 pips. We can keep this calculation I think, as it is a good representation between the two peaks.

b)- % given by NbPips / previous price's peak (Top or Bottom), this could be help and show a negative %, in case the market is bearish for the current swing, what do you think about this ?

Bst Rgds,
LeTigre30
User avatar
LeTigre30
FXCodeBase: Initiate
 
Posts: 173
Joined: Sun Dec 19, 2010 5:10 am
Location: Nimes (France)

Re: ZigZag with bar and pips counter.

Postby LeTigre30 » Fri Sep 13, 2013 1:21 am

OverDriven wrote:This seems like a great indicator, but on my computer (newest version of Marketscope), none of the text labels show up, so it's just a zigzag. I tried version 3 and 4 with the same result. It gives me the option of text color and size in the properties, but the text is still not showing after trying some different settings.


Hello OverDriven,

Your display bug could come of the decimals of the instrument you use. Effectively, when I use EURUSD, the labels are not displayed. I think the problem is due to decimal number after decimal point, as I've observed the same issue with AUDUSD. I do my best to fix this issue with the next improvement for TheLight.

Regards
User avatar
LeTigre30
FXCodeBase: Initiate
 
Posts: 173
Joined: Sun Dec 19, 2010 5:10 am
Location: Nimes (France)

Re: ZigZag with bar and pips counter.

Postby LeTigre30 » Fri Sep 13, 2013 4:21 pm

Hi TheLight,

Please, find attached files with percentages which works like that :

XAUUSD m15.
On a top of a swing, the datas are (09/13/2013 13:30) : pips=1868, high=1323.45 $, + 1.4317 % ; the previous bottom is for low price at (09/13/2013 10:15) 1304.77 $, that gives :
1304.77 + 1.4317% = 1323.45 $ .

On a bottom of a swing, the datas are (09/13/2013 10:15) pips=2601, low=1304.77 $, - 1.9545 % ; the previous top is for high price at (09/13/2013 02:00) 1330.78 $, that gives :
1330.78 - 1.9545% = 1304.77 $.

please, send your feedback and how you use this new data (if you need, you can write me via PM).

For OverDriven,

I confirm that the issue you find seems coming from all instruments which have more of 2 decimals in their cotes. The indi has a well behavior for XAUUSD, UK100, USDOLLAR, GER30, FRA40, etc.

I do my best this coming week to fix this issue.

Bst Rgds,
leTigre30

ZZ_Counter_v5.png


ZigZag_Counter_v5.lua
(12.25 KiB) Downloaded 1093 times
User avatar
LeTigre30
FXCodeBase: Initiate
 
Posts: 173
Joined: Sun Dec 19, 2010 5:10 am
Location: Nimes (France)

Re: ZigZag with bar and pips counter.

Postby TheLight » Fri Sep 13, 2013 5:46 pm

Hi LeTigre30,

I needed to do some thinking and some research on this. I do agree with you, we want to make sure that ZigZag is counting correctly in regards to the number of bars (i.e. hours, days, weeks, months, etc.) So any tweaking you can provide to insure the accuracy of the ZigZag_Counter would be greatly appreciated. I had noticed since the beginning that it would always show an extra bar in the count.

What I was after was the ability to see the swing, not only in the quantity of bars (time), as well as pips (quantity), but as importantly simply as a % of the underlying asset (% of movement).

In researching this via a spreadsheet I am reminded that different markets have different decimal points. Which makes it difficult when trying to have a standardized drag and drop indicator such as ZigZag or ATR automatically calculate and display the pips as a % percentage of the current market value price.

Your thoughts or comments are welcome, but after reseraching it appears this may not be feasible. I have attached my research spreadsheet showing the 20 day average ATR in both pips as well as a %. Notice I had to add a multiplier in order to do the calculation accurately. Thank you.

Best regards,
TheLight
TheLight
 
Posts: 13
Joined: Tue Aug 07, 2012 1:50 pm
Location: Arizona, USA

Re: ZigZag with bar and pips counter.

Postby LeTigre30 » Sun Sep 15, 2013 1:07 am

Hello to All Traders who use this nice Indi, more particularily to Apprentice and OverDriven,

ZZ_Counter_v6.png
Issue fixed for all instruments


ZigZag_Counter_v6.lua
Lua Indi New Version 6
(12.8 KiB) Downloaded 1102 times


The signaled issue seems fixed ...
In fact, the original source code doesn't take in consideration the "pipSize" control variable when displaying the labels. For all instruments which have a pipsize() less than 1 (example EUR/USD = 0.0001), the labels were plotted out of the chart (not very easy to read (lol) ... the .png file shows now correct display ...

I've tested on GBP/USD, EUR/USD, XAG/USD, EUR/JPY, USD/JPY : seems correct.

In extension of the work of this indi, for me it's not logical to display the datas which include the dats of the previous swing (for bars, pips, volume).

Thank you for your feedback.

Bst Rgds,
LeTigre30
User avatar
LeTigre30
FXCodeBase: Initiate
 
Posts: 173
Joined: Sun Dec 19, 2010 5:10 am
Location: Nimes (France)

Re: ZigZag with bar and pips counter.

Postby TheLight » Sun Sep 15, 2013 7:42 pm

LeTigre30,

I have downloaded your updated ZigZag_Counter_V6.lua and have begun to replace my previous ZigZag on all of my research chart layouts. At first glance, I must say, I am impressed as the data provided is most helpful. You have done some nice work here. I will continue to work with this updated version as applied to many different markets and will let you know if I see anything out of the ordinary. Job well done!!!

Best regards,
TheLight

Observation: It may depend on screen size or type, but on my screens it would help if the "data text" could be displayed directly above the swing high and directly below the swing low.
TheLight
 
Posts: 13
Joined: Tue Aug 07, 2012 1:50 pm
Location: Arizona, USA

Re: ZigZag with bar and pips counter.

Postby LeTigre30 » Mon Sep 16, 2013 8:47 pm

Hello to All,

Many thanks to TheLight, your appreciation warms my heart.

For your request, after fighting with the code, I think this new version (7) will bring you what you need.

The previous one depended of the right scale.
Tested with currencies and CFD's.

Thanks for feedback ...

Bst Rgds,
LeTigre30

ZZ_Counter_v7.png


ZigZag_Counter_v7.lua
(15.07 KiB) Downloaded 1146 times
User avatar
LeTigre30
FXCodeBase: Initiate
 
Posts: 173
Joined: Sun Dec 19, 2010 5:10 am
Location: Nimes (France)

PreviousNext

Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 51 guests