OPEN-SOURCE SCRIPT

BankNifty 5min Supertrend Based Strategy

Updated
BankNifty 5min Supertrend Based Strategy, Intraday.

Work Best at 5mint chart on BankNifty.

The strategy is designed to trade using the Supertrend indicator with session-based rules, and risk management.It allows for customization through input variables and aims to provide a clear visual representation of the Supertrend by changing the color.

The script also includes input variables for the trading session and date range, which allows the trader to specify the time period in which they want the strategy to run. The session variable specifies the start and end times of the trading session, which in this case is set to the Indian trading session from 9:15 am to 3:10 pm.

The strategy starts by defining input variables such as the session time, start and end date for the backtesting, the length of the ATR, and the Supertrend factor. It also includes options for delay at session start and stop loss points and trail percentage.

The code then checks if the current time is within the specified session and date range. If it is, the Supertrend and its direction are calculated using the defined input variables. The strategy then waits for N numbers of candles (defined by the User) to form at the start of every session i.e. 09:15 AM before entering a trade.

The entry and exit conditions for long and short trades are defined based on the change in the Supertrend direction and the number of candles formed at the session start i.e. 09:15 AM. After that, it takes entry and exit for long and short trades on the change in the Supertrend direction. Stop-loss and trailing stop-loss are also defined based on the input variables.

Stop-loss(Defined by the user) is fixed points either below or above the Entry Price for Long and Short entries.

The Supertrend plot is displayed with changing colors depending on the direction. Finally, the strategy closes all trades at the end of the session if there are any open trades.

Overall, this strategy aims to trade with the Supertrend indicator using session-based rules and risk management.

However, as with any trading strategy, it is important to thoroughly test it before using it in live trading.
Release Notes
BankNifty 5min Supertrend Based Strategy, Intraday.

Work Best at 5mint chart on BankNifty .

The strategy is designed to trade using the Supertrend indicator with session-based rules, and risk management. It allows for customization through input variables and aims to provide a clear visual representation of the Supertrend by changing the color.

The strategy is designed to trade using the Supertrend indicator with session-based rules, risk management, and changing the color.

The strategy starts by defining input variables such as the session time, start and end date for the backtesting, the length of the ATR, and the Supertrend factor. It also includes options for delay at session start and stop loss points and trail percentage.

The code then checks if the current time is within the specified session and date range. If it is, the Supertrend and its direction are calculated using the defined input variables. The strategy then waits for N numbers of candles(Defined by the user) to form at the start of every session before entering a trade.

The entry and exit conditions for long and short trades are defined based on the change in the Supertrend direction and the number of candles formed at the session start. Stop-loss and trailing stop-loss are also defined based on the input variables.

The Supertrend plot is displayed with changing colors depending on the direction. Finally, the strategy closes all trades at the end of the session if there are any open trades.

Overall, this strategy aims to trade with the Supertrend indicator using session-based rules and risk management.

However, as with any trading strategy, it is important to thoroughly test it before using it in live trading.
Release Notes
You'll get a hint on how the strategy performed, at least in the past, although obviously there is no guarantee that it will make money in the future.
Release Notes
Updates to this strategy
  • Stop-loss is improved (fixed Points)
    Added Target Profit/Points
    Added option to take ReEntry in the supertrend direction after hitting Sl/TG/TSl.


This strategy Shows good results in the futures.
Always Remember
the strategy performed, at least in the past, although obviously there is no guarantee that it will make money in the future.
Release Notes
Always Future Test (Paper Trade) the new strategy
Release Notes
apply to chart
5minuteschartbankniftytradesetupbankniftytradingintradaysupertrendTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer