xmd79

SET13_INDEX

Feb 24th, 2022
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. //@version=5
  2. indicator(title = "SET13_INDEX", shorttitle="SET13_INDEX")
  3.  
  4. rsi_period = input.int(title="RSI Period", defval=14, minval=2, maxval = 500)
  5.  
  6. getRSI(t1) =>
  7. c = request.security(t1, timeframe.period, close)
  8. tso = request.financial("SET:PTT", "TOTAL_SHARES_OUTSTANDING", "FQ", ignore_invalid_symbol = true)
  9. rsi = ta.rsi(c,rsi_period)
  10.  
  11. ptt_rsi = getRSI("SET:PTT")
  12. aot_rsi = getRSI("SET:AOT")
  13. advanc_rsi = getRSI("SET:ADVANC")
  14. cpall_rsi = getRSI("SET:CPALL")
  15. gulf_rsi = getRSI("SET:GULF")
  16. pttep_rsi = getRSI("SET:PTTEP")
  17. scc_rsi = getRSI("SET:SCC")
  18. scb_rsi = getRSI("SET:SCB")
  19. kbank_rsi = getRSI("SET:KBANK")
  20. bdms_rsi = getRSI("SET:BDMS")
  21. ea_rsi = getRSI("SET:EA")
  22. or_rsi = getRSI("SET:OR")
  23. scgp_rsi = getRSI("SET:SCGP")
  24.  
  25.  
  26. plot((ptt_rsi + aot_rsi + advanc_rsi + cpall_rsi+ gulf_rsi + pttep_rsi + scc_rsi + scb_rsi + kbank_rsi + bdms_rsi+ ea_rsi + or_rsi + scgp_rsi)/13,
  27. color = color.black )
  28. plot(70, color=color.gray,style = plot.style_stepline)
  29. plot(50, color=color.gray,style = plot.style_stepline)
  30. plot(30, color=color.gray,style = plot.style_stepline)
Advertisement
Add Comment
Please, Sign In to add comment