PROTECTED SOURCE SCRIPT
已更新

Outside Bar Strategy with Multiple Entry Models

278
Outside Bar Strategy with Multiple Entry Models

This Pine Script strategy implements a versatile trading system based on the Outside Bar pattern, offering three distinct entry models: Close Entry, High/Low Entry, and Midpoint Entry. Designed for traders seeking flexibility, the strategy includes customizable risk/reward ratios, an optional EMA trend filter, and enhanced visualization with line fills.

Key Features:

Entry Models:
Close Entry: Enters a long position when the current candle closes above the high of the previous outside bullish bar . For short, it enters when the candle closes below the low of the previous outside bearish bar.
High/Low Entry: Enters a long position when the price crosses above the high of the previous outside bullish bar . For short, it enters when the price crosses below the low of the previous outside bearish bar .
Midpoint Entry: Places a limit order at the midpoint of the previous outside bar, entering when the price reaches this level.
EMA Trend Filter: Optionally filters signals based on the alignment of EMAs (7 > 25 > 99 > 200 for long, 7 < 25 < 99 < 200 for short). Can be toggled via the Use EMA Filter input.
Risk/Reward Management: Configurable risk/reward ratio (default 2.0) with stop-loss set at the low/high of the outside bar and take-profit calculated based on the bar's range multiplied by the ratio.
Visualization:
Lines for entry, stop-loss, and take-profit levels (dashed for active trades, solid for pending Midpoint Entry orders).
Line fills: Red between entry and stop-loss, green between entry and take-profit.
Previous lines and fills persist on the chart for historical reference (line deletion disabled).
Pending limit orders for Midpoint Entry extend dynamically to the right until triggered or canceled.
Information Table: Displays real-time trade details (entry model, RR ratio, open trade status, entry/stop/take-profit levels, profit/loss percentage) and strategy statistics (success rate, total trades). For Midpoint Entry, pending order details are shown.
Inputs:

Entry Model: Choose between Close Entry, High/Low Entry, or Midpoint Entry (default: Close Entry).
Risk/Reward Ratio: Set the RR ratio (default: 2.0, step: 0.5).
Use EMA Filter: Enable/disable the EMA trend filter (default: true).
Line Colors and Style: Customize colors for entry, stop-loss, and take-profit lines, and select line style (solid or dashed).
Table Settings: Adjust table text color, size (small/normal/large), and position (right top/middle/bottom).



Disclaimer: This strategy is for educational purposes only. Backtest thoroughly and use at your own risk. Past performance is not indicative of future results.
發行說明
RR Table Update
發行說明
R update

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。