jason5480

Trailing Take Profit

jason5480 Обновлено   
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.
Информация о релизе:
  • Add min and max input val
  • Simplify the strategy order commands
  • Simplify long Take profit price plot command
Информация о релизе:
  • Use close source to define the profit price
  • Set offset to the plot of TP price
Информация о релизе:
  • 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
Информация о релизе:
  • Use strategy.percent_of_equity
  • Draw lines with width 1
Информация о релизе:
  • Update pinescript to V5
  • Take profit step to 0.05 deviation to 0.01
  • Transparency deprecation fix
Информация о релизе:
  • 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
Информация о релизе:
  • (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 150
  • Increase max lines to 150
  • 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 автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?