tartigradia

na_skip_highest

tartigradia Aggiornato   
Library "na_skip_highest"
Finds the highest historic value over len bars but skip na valued bars (eg, off days). In other words, this will ensure we find the highest value over len bars with a real value, and if there are any na bars in-between, we skip over but the loop will continue. This allows to mimic calculations on markets with off days (eg, weekends).

na_skip_highest(src, len)
  Finds the highest historic value over len bars but skip na valued bars (eg, off days). In other words, this will ensure we find the highest value over len bars with a real value, and if there are any na bars in-between, we skip over but the loop will continue. This allows to mimic calculations on markets with off days (eg, weekends).
  Parameters:
    src: series float source (eg, close)
    len: int length, number of recent bars to consider in the window to find the highest value
  Returns: highest float highest value found over the len window
Note di rilascio:
v2

Fixed:
Forgot to remove a debug line in calculations, previous version was not working, now it works as expected (tested on field in another indicator).

Added:
na_skip_highest_or_lowest(src, len, mode)
  Internal function. Finds the highest or lowest historic value over len bars but skip na valued bars (eg, off days). In other words, this will ensure we find the highest value over len bars with a real value, and if there are any na bars in-between, we skip over but the loop will continue. This allows to mimic calculations on markets with off days (eg, weekends).
  Parameters:
    src: series float source (eg, close)
    len: int length, number of recent bars to consider in the window to find the highest value
    mode: int If 0 finds the highest value, if 1 finds the lowest value. Internal parameter.
  Returns: highest float highest value found over the len window

na_skip_lowest(src, len)
  Finds the lowest historic value over len bars but skip na valued bars (eg, off days). In other words, this will ensure we find the lowest value over len bars with a real value, and if there are any na bars in-between, we skip over but the loop will continue. This allows to mimic calculations on markets with off days (eg, weekends).
  Parameters:
    src: series float source (eg, close)
    len: int length, number of recent bars to consider in the window to find the highest value
  Returns: highest float highest value found over the len window
Note di rilascio:
v3: fix a mistake that made the loop use one more iteration than intended.
Libreria Pine

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzare questa libreria in privato o all'interno di altre pubblicazioni open-source, ma il riutilizzo del codice è subordinato al rispetto del Regolamento.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questa libreria?

Copia il testo ed incollalo nel tuo script.