theautotrading

NIFTY 50 5mint Strategy

theautotrading 已更新   
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.
版本注释:
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.
版本注释:
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.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?