Skip to content
All library documents

Converting Dollar Risk Into Stop and Profit Distances

Article TradingView scripts

Summary

This educational strategy example shows how to set stop-loss and take-profit distances from cash amounts in the symbol’s currency. It converts each dollar target into price points using the instrument’s point value, minimum tick size, and the absolute position size, then passes those distances to the strategy’s exit logic.

Entries are only an illustrative moving-average crossover system: a 14-period simple moving average crossing above or below a 28-period average opens a long or short position. The script also plots the average entry price and the corresponding stop and profit levels to make the exits visible. It is an example of translating fixed monetary targets into order distances, not evidence of a profitable trading strategy; the document reports no performance results. The conversion depends on instrument specifications and position size, so its behavior may differ across symbols or sizing methods.

Key ideas

  • The function converts a cash target into ticks using point value, minimum tick size, and absolute position size.
  • The example applies separate dollar inputs to profit-taking and stop-loss distances.
  • Long and short entries come from crossovers of 14-period and 28-period simple moving averages.
  • Plots show the estimated stop and profit levels relative to the average entry price.
  • The document presents an educational exit example and provides no 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.