jason5480

Trailing Stop Loss

jason5480 업데이트됨   
This script demonstrate how to make a Training Stop Loss to "ride the wave". In comparison to classic Stop Loss this strategy follows the price upwards (for long positions) and when price drops by a fixed percentage then you exit your position.
릴리즈 노트:
  • Minor typos
릴리즈 노트:
  • Add the ability to disable trailing for demonstration reasons
  • Close open orders on trend reversal
  • Add sell labels on cross-under
릴리즈 노트:
  • Fix a bug that made Stop Loss to not trigger appropriately when it was reached at the very first candle end enable trailing was un-checked
릴리즈 노트:
  • Refactor stopValue calculation to be more readable
릴리즈 노트:
  • Fix longIsActive logic
릴리즈 노트:
  • Check if time is within backtest period in order to set the price to prevent unnecessary calculations and drawing outside the area of interest
  • Replace deprecated trasp argument with color.new
릴리즈 노트:
  • Set calc on every tick to false by default, as @fgo943 suggested
릴리즈 노트:
  • Minor Update the chart for a better overview and understanding of the trailing stop loss
릴리즈 노트:
  • Fix a bug that were causing stop loss to be calculated wrong when there was new entry back to back with the end of the previous one
  • Use strategy.percent_of_equity
릴리즈 노트:
  • Draw lines with width 1
릴리즈 노트:
  • Update to pinescript V5
  • Stop Loss step is now 0.05
릴리즈 노트:
  • Let's face it a Green-Red color model is more intuitive!
릴리즈 노트:
  • Happy New Year!
  • Many code refactorings and optimizations to better use this script as a template and plug your own strategy at ease
릴리즈 노트:
  • Bug fix: (rare/minor) Remove 'strategy.position_size == 0' condition in stop loss calculation that made the very first stop loss price target to be calculated based on previous 'strategy.position_avg_price' instead of 'close' if the previous position closed exactly one bar before!
릴리즈 노트:
  • (minor) refactoring
릴리즈 노트:
  • Use time_filters library
릴리즈 노트:
  • Minor revision update
릴리즈 노트:
  • Replace deprecated "when=" with if statements in strategy calls
릴리즈 노트:
  • Change fastMA default color to yellow
릴리즈 노트:
  • Increase max labels to 300
  • Minor refactoring
릴리즈 노트:
  • Update time_filters library
릴리즈 노트:
  • Some minor label/color changes
릴리즈 노트:
  • small refactoring
릴리즈 노트:
  • Update time_filters library version
릴리즈 노트:
  • Update time_filters library version
릴리즈 노트:
  • Use the 'chrono_utils' library for the date-time window filter

If you're interested in exploring and discovering other high quality free strategies come join us in Discord: discord.gg/2wkm9QqSuY
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?