TradingView
RicardoSantos
22 nov 2016 19:43

Function Sine Wave 

U.S. DOLLAR / WTI CRUDE OILICE

Beskrivning

Function to draw Sine Waves.
Kommentarer
IvanWaller
Question: How do you use this?
UnknownUnicorn1062692
there`s a problem with (n) because every time a trading day passes (n) shifts the sine slightly causing the sine to get offset from the price. Any ideas on how to fix this? also the sine is Black so if you have dark theme on the sine doesn't show up.
RicardoSantos
@destagni, thx for the feedback, if it was based on unix timestamp it would be locked to its start date and it would jump time breaks, thats the only options around that issue.
vnet24
Hi, in line no 9, what will be value of n, as the variable n is not defined in the script.
RicardoSantos
@RajeshThakkar, builtin variable from pinescript it represents current bar number since the first loaded bar
vnet24
Thanks
freds_view
n is not declared ? so how does this work?
littlebeard
@freds_view, n is an old built-in variable from previous versions of Pine Script that referred to the bar number, it has been replaced with bar_index in newer versions.
TensorTom
I don't get a sine from it. odd
Mer