NIFTY 50 5mint Strategy

theautotrading Actualizado   
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.
Notas de prensa:
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.
Notas de prensa:
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 de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?