Proper Round Functions [QuantNomad]

Round function in PineScript is very simple and allows you to round numbers only to the closest integer number. This is a bit irritating because I very often have to round numbers to some decimal places and not integer.
So I created 2 functions I use all the time and now sharing them with you.

  • roundn - rounds the values in its first argument to the specified number of decimal places.
  • roundtick - rounds the values to current symbol mintick

I hope they will be useful for you.
Eliminar de Scripts favoritos. Añadir a Scripts favoritos.
PineScript Programming: https://qntly.com/pinepro
TradingView Essential: https://qntly.com/tve

Access to Pro Indic.: https://qntly.com/proind

YouTube: https://qntly.com/youtube
Discord: https://qntly.com/discord
Telegram: https://qntly.com/tel


hi quand i have a question how can i alert if doble doji side by side and next candle green or red ( doji -> doji -
i have this code buy i need

Precision = input(0.15, minval=0.0001, title="Doji's Max Body size")
barcolor(abs(open - close) <= (high - low) * Precision ? yellow : na)

doji=(abs(open - close) <= (high - low) * Precision ? 1:0)
doji2=(abs(open - close) <= (high - low) * Precision ? 1:0)
plotchar (doji)
@istek7, something like this should work for you:
alertcondition(doje and doji2, "alert", "alert")
+1 Responder
istek7 QuantNomad
@QuantNomad, i m not chicking thanks for back
Very thanks
Thanks !
This is an another interesting creation! Thanks for sharing QuantNomad <3
Inicio Analizador de acciones Analizador de Forex Crypto Screener Calendario económico Cómo funciona Funcionalidades del gráfico Precios Recomendar a un amigo Normas Centro de ayuda Soluciones broker y sitio web Widgets Soluciones gráficas Biblioteca de gráficos ligeros Blog y Noticias Twitter
Perfil Opciones de configuración del perfil Cuenta y facturación Amigos referidos Monedas Mis Tickets de Soporte Centro de ayuda Ideas publicadas Seguidores Siguiendo Mensajes privados Chat Cerrar sesión