jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Fibonacci retracements calculation

stock tools has fibonacci retracement where first click shows level 0 and last click shows level = 1 ( so it goes from 0 to 1)
where if you check other charting tools like tradingview,yahoo finance.. they show calculations from 1 to 0 ( first click would show last level.. )

is it possible with highchart to achieve what other charting softwares ?

i have attached the images to show.. (0% -- 1 (100%))
Thanks
sample1.jpg
sample1.jpg (38.44 KiB) Viewed 396 times
Attachments
sample2.jpg
sample2.jpg (83.97 KiB) Viewed 396 times
jakub.s
Posts: 1075
Joined: Fri Dec 16, 2022 11:45 am

Re: Fibonacci retracements calculation

Hi,

Thanks for the question!

There's no easy option that you could change in the API, but you can easily modify the fibonacciRetracement function to achieve this result.

Here's a demo: https://jsfiddle.net/BlackLabel/1njLywf6/

Let me know if that helps.

Best regards!
Jakub
Highcharts Developer
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: Fibonacci retracements calculation

so you mean i have to write my own retracement ? currently i am using stocktools --> mapping --> highcharts-fibonacci which draws one for us..
jakub.s
Posts: 1075
Joined: Fri Dec 16, 2022 11:45 am

Re: Fibonacci retracements calculation

Hi,

If you're creating it through StockTools you could simply set a custom Highcharts.Annotation.types.fibonacci.levels array.

Here's a demo: https://jsfiddle.net/BlackLabel/ndvw5r80/

Let me know if that solves your problem.

Kind regards!
Jakub
Highcharts Developer
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: Fibonacci retracements calculation

thanks a lot for reply.. this is really useful. but can i take this to next level ? meaning if i change the level.. then force the re-calculation of retracement which is drawn on screen ?
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: Fibonacci retracements calculation

sorry for reply again.. but i did look at closely.its not working as what we need.. i would need to change the calculation... so that when user clicks on first candle. (that price should start calculating at 1(100%) NOT 0..) i dont think thats happening...in the demo.. i am ok with not changing on per user base.. you can ignore older reply... also is there a way we can display real price value as well along with level..
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: Fibonacci retracements calculation

its working as expected.. it was my mistake in some understanding.. and read the annotation code again .. and now its working..

Thanks a lot for help
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: Fibonacci retracements calculation

sorry .. i spoke too soon. spoke to our client. and its still not working as expected.
to demonstrate i have two video links

https://vimeo.com/842976698?share=copy

in the above video you will see that when i click first time. on candle.. its still is not showing 1(100%) and second click is at 100%.

https://vimeo.com/842980443?share=copy

in above yahoo video you will see first click (dark purple) corresponds to 100% or 1 and last click shows 0.. this is what i would like to achieve ?
is this possible with default calculations.. flipping level's array is not seem to be working..
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: Fibonacci retracements calculation

to further demonstrate.. i have code below

https://jsfiddle.net/8qcfzyno/

run the code.. select range '1m' from top.. you will see retracement where first candle is at 1.. even though levels = [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1];

this is what i am trying to achieve with stool tools binding

Return to “Highcharts Stock”