Hỏi & Đáp Chứng Khoán
  • Thông báo


    Kết quả 1 đến 20 của 166

    Threaded View

    1. #9
      Ngày tham gia
      Oct 2009
      Bài viết
      1,925
      Được cám ơn 617 lần trong 428 bài gởi

      Mặc định Pro Stochastic - Chỉ báo dao động hay

      //@version=4

      //Name
      study(title="Professional Stochastic", shorttitle="Pro Sto", overlay=false)

      // Calculation
      smoothK = input(defval=14, title="%K Range", minval=1, step=1)
      smoothD = input(defval=3, title="%D Period", minval=1, step=1)
      smooth = input(defval=6, title="Smooth", minval=1, step=1)
      useColors = input(true, title="Use Background Colors")

      useCurrentRes = input(true, title="Use Current Chart Resolution")
      resCustom = input(title="Use Different Timeframe (Uncheck Box Above)", type=input.resolution, defval="720")
      res = useCurrentRes ? timeframe.period : resCustom

      k = sma(stoch(close, high, low, smoothK), smooth)
      d = sma(k, smoothD)
      outK = security(syminfo.tickerid, res, k)
      outD = security(syminfo.tickerid, res, d)

      // Color
      longCond = false
      sellCond = false
      longCond := outK > outD and outK < 20 and useColors
      sellCond := outK < outD and outK > 80 and useColors
      col = ( (longCond) ? #00FF00 : ((sellCond) ? #FF0000 : na) )
      bgcolor(col, transp=80)

      // Sto Lines
      plot(outK, color=#40E0D0, linewidth=2, transp=0, title="K")
      plot(outD, color=#FF00FF, linewidth=2, transp=0, title="D")
      hline(50, title="Midline", color=color.gray, linestyle=hline.style_dashed)

      // Signal Lines (Note changing these will not change the alert postions)
      bullzoneband = hline(80, "Overbought Zone", color=#40E0D0, linewidth=2, linestyle=hline.style_dotted)
      upband = hline(100, "Overbought Upper Zone", color=#40E0D0, linewidth=2)
      fill(upband, bullzoneband, color=#40E0D0, transp=90)
      bearzoneband = hline(20, "Oversold Zone", color=#9400D3, linewidth=2, linestyle=hline.style_dotted)
      downband = hline(0, "Oversold Lower Zone", color=#9400D3, linewidth=2)
      fill(bearzoneband, downband, color=#9400D3, transp=90)

      // Alerts
      upperLine = 80
      lowerLine = 20

      enteringUpperLine = crossover(outK, upperLine)
      leavingUpperLine = crossunder(outK, upperLine)
      enteringLowerLine = crossunder(outK, lowerLine)
      leavingLowerLine = crossover(outK, lowerLine)

      alertcondition(leavingUpperLine, title='Stoch Crossunder Upper', message='Stoch Leaving Upper Bound')
      alertcondition(leavingLowerLine, title='Stoch Crossover Lower', message='Stoch Leaving Lower Bound')

      alertcondition(enteringUpperLine, title='Stoch Crossover Upper', message='Stoch Crossover Upper')
      alertcondition(enteringLowerLine, title='Stoch Crossunder Lower', message='Stoch Crossunder Lower')

      // © Azure
      Trade what you see, not what you think!!!

    2. Có 2 thành viên đã cám ơn tigeran :
      JokerZ (04-06-2020), madara (05-06-2020)

    Thông tin của chủ đề

    Users Browsing this Thread

    Có 3 thành viên đang xem chủ đề này. (0 thành viên và 3 khách vãng lai)

       

    Similar Threads

    1. Hỏi - Đáp về Đấu trường chứng khoán Vietstock
      By ducthang85 in forum Vận động trường
      Trả lời: 38
      Bài viết cuối: 16-04-2020, 03:51 PM
    2. [Hỏi - Đáp] - Xin hỏi về lưu ký chứng khoán
      By Thinhkk in forum Kiến thức Chứng khoán
      Trả lời: 1
      Bài viết cuối: 28-07-2017, 08:03 AM
    3. Trả lời: 9
      Bài viết cuối: 11-09-2014, 09:42 AM

    Bookmarks

    Quyền viết bài

    • Bạn Không thể gửi Chủ đề mới
    • Bạn Không thể Gửi trả lời
    • Bạn Không thể Gửi file đính kèm
    • Bạn Không thể Sửa bài viết của mình