Documentation/AlgoCode/Function reference
stop
Stop loss from entry, in points, percent, or ATR.
stop 10 points
Write points, percent, or atr. A points or percent stop is measured from the signal bar's close. In close mode that close is the fill, and the stop can flatten the trade starting on the bar after entry, so the entry wick cannot stop the trade out. In next-open mode the distance stays on that signal close. The fill bar can trigger, and that exit books at the next bar's open. stop 2 atr becomes one points distance for the whole loaded series: 2 × ATR(14) of the second-to-last bar. Realized P&L uses the bar fill and the quantity actually closed. The stop level stays the trigger and is not the P&L price.
Return value
—
Note
- Also: stop 2 percent, stop 2 atr (2 × ATR of 14).
Example
when ema(9) crosses above ema(21) buy stop 10 points target 20 points