Skip to content
All library documents

Using Position Data for Percentage-Based Stop Losses

Article vn.py community

Summary

This brief forum exchange concerns adding a percentage stop based on actual profit and loss to a CTA strategy. The questioner notes that margin differs by instrument, so a fixed price-distance calculation may not represent the actual loss, and asks whether the strategy can read profit-and-loss information from the trading interface. A reply points to retrieving position information through the main engine, then directs the questioner to documentation for script trading. This suggests that position data is the starting point for implementing a stop tied to account or position results rather than a simple price move.

The thread gives no worked example, formula, or clarification of how to convert the returned position fields into a percentage threshold. It also does not explain whether the value is realized or unrealized P&L, how to handle multiple positions, or how often to check the threshold. The exchange is therefore a useful pointer, but implementation details and the stop's exact definition require further documentation.

Key ideas

  • Instrument-specific margin makes price-distance stops an imperfect proxy for actual profit and loss.
  • The suggested starting point is to retrieve position information through the main trading engine.
  • The discussion links to further documentation but does not provide a complete stop-loss implementation.

Tags

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