Advertisement
Maurizio-Ciullo

Indicatore Atr Ver5

Jun 15th, 2023 (edited)
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // VERSIONE 5 PINESCRIPT
  2.  
  3. /////////////////// INIZIO ALTRO MODO PER SCRIVERE L'ATR CON UNA FUNZIONE ///////////////////////////////////
  4. // Start Detecting ATR Long Normal //
  5. in_length_atr_long_normal = input.int(title="Atr Length_long_normal", defval=11, minval=0, group='Atr Long Normal')
  6. in_smoothing_atr_long_normal = input.string(title="Smoothing_atr_long_normal", defval="SMA", options=["RMA", "SMA", "EMA", "WMA"], group='Atr Long Normal')
  7. ma_function_long(source, in_length_atr_long_normal) =>
  8.     switch in_smoothing_atr_long_normal
  9.         "RMA" => ta.rma(source, in_length_atr_long_normal)
  10.         "SMA" => ta.sma(source, in_length_atr_long_normal)
  11.         "EMA" => ta.ema(source, in_length_atr_long_normal)
  12.         => ta.wma(source, in_length_atr_long_normal)
  13. plot(ma_function_long(ta.tr(true), in_length_atr_long_normal), title = "ATR_long_normal", color=color.new(#ca5555, 0))
  14. //atr_long_normal = ma_function_long(ta.tr(true), in_length_atr_long_normal)
  15. // End Detecting ATR Long Normal //
  16. /////////////////// FINE ALTRO MODO PER SCRIVERE L'ATR CON UNA FUNZIONE ///////////////////////////////////
  17.  
  18. /////////////////// INIZIO INDICATORE ATR DAILY VERSIONE 5 ///////////////////////////////////
  19. // atr_daily = request.security(syminfo.tickerid, "D", ta.atr(14))
  20. /////////////////// FINE INDICATORE ATR DAILY ///////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement