OPEN-SOURCE SCRIPT
Updated

Source Strategy

This strategy converts indicator signals into long and short entries and exits. It looks for non-zero values from your chosen entry sources to enter positions, and from exit sources to close positions.

The strategy supports both longs and shorts. For long trades, it looks at your selected long source and long exit source; for short trades, it looks at your chosen short source and short exit source. The strategy enters a position when either source produces any value except zero.

Stop loss and take profit orders are incorporated for risk management. These orders are calculated as a percentage of your position's value, providing dynamic risk management as price moves. The percentage levels for stop loss and take profit orders are configurable in the settings, allowing you to adjust your risk parameters based on market conditions and trading style.

To use the strategy, add it to your chart. The input parameters can be configured in the strategy's settings panel, including your signal sources for long and short entries and exits, and the percentage levels for stop loss and take profit orders.
Release Notes
Fixed issue where stop loss and take profit were only executed when there was a signal from source.
Release Notes
Increased maximum allowed stop loss and take profit percentages from 10% and 20% to 100%.
Release Notes
The strategy now includes exclusion conditions for both entries and exits, providing more precise control over trade execution. When enabled, these conditions can prevent new positions from being opened even when entry signals are active, and can prevent existing positions from being closed even when exit signals are triggered.

For both long and short trades, you can now set separate exclusion sources for entries and exits. These new features are optional and can be enabled independently in the strategy settings, allowing for customized filtering of your trade signals.
Release Notes
The strategy now includes a trailing stop that starts when the price moves beyond the trail points from entry. When enabled, the stop follows the price, keeping a trail offset distance, and only moves up on new highs or down on new lows.

Disclaimer