project-nv / night-vision

Highly customizable charting library, created for professional traders
https://nightvision.dev
MIT License
252 stars 58 forks source link

Need Fibonacci Circle in charts. #123

Closed nkroker closed 1 month ago

nkroker commented 1 month ago

Description

I need to draw a fib circle as an overlay similar to what Tradingview have https://in.tradingview.com/support/solutions/43000518159-fib-circles/

Is there any way to achieve this.

Suggested solution

If there's nothing available, is there any workaround or is it be implemented as a new feature.

Alternative

Suggest something here

Additional context

No response

Validations

vattevaii commented 1 month ago

I implemented this with custom navyJS code.. I don't think we have features like drawing lines, circles and any other custom drawing in nightvision (I've seen some related code in the library but don't know how to use them, I copied the code in my repo then added it as a script for my first navyJS script)

propagate(...data: any): void
  draw(...data: any): void
  drawBotbar(...data: any): void
  drawSidebar(...data: any): void
  keydown(...data: any): void
  keypress(...data: any): void
  keyup(...data: any): void
  mouseup(...data: any): void
  mousedown(...data: any): void
  mousemove(...data: any): void
  mouseout(...data: any): void
  mouseover(...data: any): void
  click(...data: any): void
  legend(...data: any): void
  meta(...data: any): void
  dataFormat(...data: any): void
  yRange(...data: any): void
  preSampler(...data: any): void
  legendHtml(...data: any): void
  valueTracker(...data: any): void
  ohlc(...data: any): void

these are the base functions which are used in a navy file.. where you also get $events,$lib,$core and some other variables (I forgot what), which you can use to get chart's current state to draw upon the chart

nkroker commented 1 month ago

Hi @vattevaii

Thanks for the input my issue is solved by this.