OPEN-SOURCE SCRIPT
Strategy Builder With Indicators

This strategy script is designed for traders who enjoy building systems using multiple indicators.
Please note: This script does not include any built-in indicators. Instead, it works by referencing the plot outputs of the indicators you’ve already added to your chart.
For example, if you add a MACD and an ATR indicator to your chart, you can assign their plot values as inputs in the settings panel of this strategy.
• MACD as a trigger
• ATR as a filter
How Filters Work
Filters check whether certain conditions are met before a trade can be opened. For instance, if you set a filter like ATR > 30, then no trade will be executed unless that condition is true — even if the trigger fires.
All filters are linked, meaning every active filter must be satisfied for a trade to occur.
How Triggers Work
Triggers are what actually fire a trade signal — such as a moving average crossover or RSI breaking above a specific level. Unlike filters, triggers are independent. Only one active trigger needs to be true for the trade to execute.
Thanks to its modular structure, this strategy can be used with any indicator of your choice.
⸻
Risk Management Features
In the settings, you’ll find flexible options for:
• Stop Loss (SL)
• Trailing Stop Loss (TSL)
• Multi Take-Profit (TP)
These features enhance trade safety and let you tailor your risk management.
SL types available:
• Tick-based SL
• Percent-based SL
• ATR-based SL
Once you select your preferred SL type, you can fine-tune its distance using the offset field.
Trailing SL allows your stop to follow price as it moves in your favor — helping to lock in profits.
Multi-TP lets you take profits at two different levels, helping you secure gains while leaving room for extended moves.
Breakeven option is also available to automatically move your SL to entry after reaching a profit threshold.
⸻
How to Build a Solid Strategy
Let’s break down a good setup into three key components:
1. Trend Filter
Avoid trading against the trend — that’s like swimming against the current.
Use a filter like:
• Supertrend
• Momentum indicators
• Candlestick bias, etc.
Example: In this case, I used Supertrend and filtered for trades only if the price is above the uptrend line.

2. Trigger Condition
Once we confirm the trend is on our side, we need a trigger to execute at the right moment. This can be:
• RSI cross
• Candlestick patterns
• Trendline breaks
• Moving average crossovers, etc.
Example: I used RSI crossing above 50 as the entry trigger.

3. Risk Management
Even in the right trend at the right time — anything can happen. That’s why you should always define Stop Loss and Take Profit levels.
⸻
And there you have it! Your strategy is ready to backtest, refine, and deploy with alerts for live trading.

If you’d like a step-by-step guide on how to use this strategy and set everything up correctly, watch this video tutorial:
https://youtu.be/D4PqSx7f35o?si=5-X6pGRfybkxEzfU
Questions or suggestions? Feel free to reach out
Please note: This script does not include any built-in indicators. Instead, it works by referencing the plot outputs of the indicators you’ve already added to your chart.
For example, if you add a MACD and an ATR indicator to your chart, you can assign their plot values as inputs in the settings panel of this strategy.
• MACD as a trigger
• ATR as a filter
How Filters Work
Filters check whether certain conditions are met before a trade can be opened. For instance, if you set a filter like ATR > 30, then no trade will be executed unless that condition is true — even if the trigger fires.
All filters are linked, meaning every active filter must be satisfied for a trade to occur.
How Triggers Work
Triggers are what actually fire a trade signal — such as a moving average crossover or RSI breaking above a specific level. Unlike filters, triggers are independent. Only one active trigger needs to be true for the trade to execute.
Thanks to its modular structure, this strategy can be used with any indicator of your choice.
⸻
Risk Management Features
In the settings, you’ll find flexible options for:
• Stop Loss (SL)
• Trailing Stop Loss (TSL)
• Multi Take-Profit (TP)
These features enhance trade safety and let you tailor your risk management.
SL types available:
• Tick-based SL
• Percent-based SL
• ATR-based SL
Once you select your preferred SL type, you can fine-tune its distance using the offset field.
Trailing SL allows your stop to follow price as it moves in your favor — helping to lock in profits.
Multi-TP lets you take profits at two different levels, helping you secure gains while leaving room for extended moves.
Breakeven option is also available to automatically move your SL to entry after reaching a profit threshold.
⸻
How to Build a Solid Strategy
Let’s break down a good setup into three key components:
1. Trend Filter
Avoid trading against the trend — that’s like swimming against the current.
Use a filter like:
• Supertrend
• Momentum indicators
• Candlestick bias, etc.
Example: In this case, I used Supertrend and filtered for trades only if the price is above the uptrend line.
2. Trigger Condition
Once we confirm the trend is on our side, we need a trigger to execute at the right moment. This can be:
• RSI cross
• Candlestick patterns
• Trendline breaks
• Moving average crossovers, etc.
Example: I used RSI crossing above 50 as the entry trigger.
3. Risk Management
Even in the right trend at the right time — anything can happen. That’s why you should always define Stop Loss and Take Profit levels.
⸻
And there you have it! Your strategy is ready to backtest, refine, and deploy with alerts for live trading.
If you’d like a step-by-step guide on how to use this strategy and set everything up correctly, watch this video tutorial:
https://youtu.be/D4PqSx7f35o?si=5-X6pGRfybkxEzfU
Questions or suggestions? Feel free to reach out
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Built Your TradingView Tools With Experts
milvetti.com
milvetti.com
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Built Your TradingView Tools With Experts
milvetti.com
milvetti.com
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.