OPEN-SOURCE SCRIPT
Cập nhật

Trailing Take Profit

36 666
This script demonstrates how to do trailing take profit. With this approach instead of setting a limit order, when you hit the target you just follow the price upwards (for long positions) and you sell when the price drops by a small percentage. This approach will increase the profits (slightly) in every strategy! Be aware that the simulated data may produce unrealistic results.
Phát hành các Ghi chú
  • Add min and max input val
  • Simplify the strategy order commands
  • Simplify long Take profit price plot command
Phát hành các Ghi chú
  • Use close source to define the profit price
  • Set offset to the plot of TP price
Phát hành các Ghi chú
  • Check if time is within backtest period to prevent unecesary calculation and print inside the area of interest
  • Replace deprecated transp argument with color.new
Phát hành các Ghi chú
  • Use strategy.percent_of_equity
  • Draw lines with width 1
Phát hành các Ghi chú
  • Update pinescript to V5
  • Take profit step to 0.05 deviation to 0.01
  • Transparency deprecation fix
Phát hành các Ghi chú
  • Let's face it a Green-Red color model is more intuitive!
Phát hành các Ghi chú
  • Happy New Year!
  • Many code refactorings and optimizations to better use this script as a template and plug your own strategy at ease
Phát hành các Ghi chú
  • (minor) refactoring
Phát hành các Ghi chú
  • Use time_filters library
Phát hành các Ghi chú
  • Minor revision update
Phát hành các Ghi chú
  • Replace deprecated "when=" with if statements in strategy calls
Phát hành các Ghi chú
  • Change fastMA default color to yellow
Phát hành các Ghi chú
  • Increase max labels to 150
  • Increase max lines to 150
  • Minor refactoring
Phát hành các Ghi chú
  • Update time_filters library
Phát hành các Ghi chú
  • Some minor label/color changes
Phát hành các Ghi chú
  • small refactoring
Phát hành các Ghi chú
  • Update time_filters library version
Phát hành các Ghi chú
  • Update time_filters library version
Phát hành các Ghi chú
  • Use the 'chrono_utils' library for the date-time window filter
Phát hành các Ghi chú

  • Add different alert messages per event
  • Update 'chrono_utils' library
Phát hành các Ghi chú
Update to pinescript version 6

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.