NIFTY 50 5mint Strategy

theautotrading Mis à jour   
This is an intraday strategy for NIFTY50 Based First candle High and Low breakout.

The strategy takes user inputs for the start and end dates, start and end months, and start and end years, which define the time range to trade. The user can also specify the maximum number of trades to take during the time range and the length of the Exponential Moving Average ( EMA ) used in the strategy

In this strategy, the First candle's high and low are calculated and used as entry and exit points for trades. If the close price breaks above the First candle's high, a buy signal is generated. Conversely, if the close price breaks below the First candle's low, a sell signal is generated.

The strategy uses the Exponential Moving Average ( EMA ) as a filter to close entered positions either long or short, EMA also acts Target. If the close price falls below the EMA, a long position is closed, and if the close price rises above the EMA, a short position is closed or the PreviousCandleClose is above the First candle's high a short position is closed, When the PreviousCandleClose is below the First candle's low a long position is closed, First candle's high act as Stoploss

The strategy limits the number of trades taken within the specified time range, and if the time range is exceeded, all positions are closed.

Finally, the strategy plots the First candle's high and low, EMAs on the chart for visual reference.

Default settings work best with the 5mint candle, you may tweak settings according to your needs.

backtesting helps in interpreting how the trading strategy would have behaved in the past, and forward testing (paper trading) informs the traders how it would perform now.
Notes de version:
Updated the strategy.
  • removed Ema filter .
  • added stop loss and target (defined by the user ) based on the entry price().

the strategy performed, at least in the past, although obviously there is no guarantee that it will make money in the future. Always Future Test (Paper Trade) the new strategy.
Notes de version:
Quick Summary
This is a trading strategy script written in Pine Script language for trading the NIFTY 50 index in the 5-minutes time frame. The strategy is based on breakout trading where the high and low of the first candle of the session are used as breakout levels.

The script has inputs to define the start and end dates of the backtesting period, the trading session, the stop loss and target levels, the maximum number of trades, and the trade direction. The script also tracks the number of trades taken and submits buy/sell orders based on signals and maximum trades.

The script has some functions such as is_newbar() which checks if a new bar has formed, strategy.entry() to enter a long or short position, and strategy.close() to close a position. The script also uses variables such as counter_call and counter_put to track the number of trades taken and First_high and First_low to store the high and low of the first candle of the session.

Overall, the script is a simple breakout trading strategy that can be easily customized based on the user's preferences. However, it is important to note that trading strategies should be backtested thoroughly and validated before being used in live trading.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?