Skip to content
All library documents

A Pine Script Tool for Semi-Automated Entries and Trailing Exits

Article FMZ digest · Author: 发明者量化-小小梦

Summary

This document presents a Pine strategy intended to help discretionary traders automate a preplanned entry and exit process. The configurable inputs control trade direction, order size, initial entry mode, stop distance, trailing offset, and the price distance that activates trailing protection. The entry can be immediate, set at a specified limit price, or disabled; after entry, the strategy applies a fixed stop and a trailing exit, while plotting the trigger and trailing levels for monitoring.

Examples show immediate and limit-price entries, as well as the default disabled mode, and explain that stop and trailing offsets are measured in price ticks while the activation distance is a price amount. The author stresses checking the instrument’s minimum tick setting and describes using real-time price calculations. This is a tool design walkthrough rather than evidence of profitable performance: it does not report test results, and traders are expected to adapt and understand the order behavior for their market and execution setup.

Key ideas

  • Configure direction, quantity, entry mode, stop distance, and trailing parameters for a planned trade.
  • Choose immediate entry, a specified limit entry, or a disabled setting to prevent unintended orders.
  • The strategy combines a fixed loss exit with a trailing exit after price reaches an activation level.
  • Check that the configured minimum tick matches the instrument because some distances are tick-based.
  • The document demonstrates functionality but does not provide evidence of trading performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.