The_Algo_Engineer

SUPPORT RESISTANCE STRATEGY [5MIN TF]

A SUPPORT RESISTANCE BREAKOUT STRATEGY for 5 minute Time-Frame , that has the time condition for Indian Markets
The Timing can be changed to fit other markets, scroll down to "TIME CONDITION" to know more.
The commission is also included in the strategy .

The basic idea is when ,

1) Price crosses above Resistance Level ,indicated by Red Line, is a Long condition.
2) Price crosses below Support Level ,indicated by Green Line , is a Short condition.
3) Candle high crosses above ema1, is a part of the Long condition .
4) Candle low crosses below ema1, is a part of the Short condition .
5) Volume Threshold is an added confirmation for long/short positions.
6) Maximum Risk per trade for the intraday trade can be changed .
7) Default qty size is set to 50 contracts , which can be changed under settings → properties → order size.
8) ATR is used for trailing after entry, as mentioned in the inputs below.


// ═════════════════════════//
// ————————> INPUTS <————————— //
// ═════════════════════════//

→ L_Bars ———————————> Length of Resistance / Support Levels.
→ R_Bars ———————————> Length of Resistance / Support Levels.
→ Volume Break ———————> Volume Breakout from range to confirm Long/Short position.
→ Price Cross Ema —————> Added condition as explained above (3) and (4).
→ ATR LONG —————————> ATR stoploss trail for Long positions.
→ ATR SHORT ————————> ATR stoploss trail for Short positions.
→ RISK ————————————> Maximum Risk per trade intraday.

The strategy was back-tested on TCS ,the input values and the results are mentioned under "BACKTEST RESULTS" below.


// ═════════════════════════ //
// ————————> PROPERTIES<——————— //
// ═════════════════════════ //

Default_qty_size ————> 50 contracts , which can be changed under

Settings

Properties

Order size

// ═══════════════════════════════//
// ————————> TIME CONDITION <————————— //
// ═══════════════════════════════//
  • The time can be changed in the script , Add it → click on ' { } ' → Pine editor→ making it a copy [right top corner} → Edit the line 27.
    The Indian Markets open at 9:15am and closes at 3:30pm.
    The 'time_cond' specifies the time at which Entries should happen .
    "Close All" function closes all the trades at 3pm , at the open of the next candle.
    To change the time to close all trades , Go to Pine Editor → Edit the line 92 .
    All open trades get closed at 3pm , because some brokers don't allow you to place fresh intraday orders after 3pm .

// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 100 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
INPUTS can be changed for better Back-Test results.
The strategy applied to TCS (5 min Time-Frame and contract size 50) gives us 60% profitability , as shown below
It was tested for a period a 6 months with a Profit Factor of 1.8 ,net Profit of 30,000 Rs profit .
Sharpe Ratio : 0.49
Sortino Ratio : 1.4

The graph has a Linear Curve with Consistent Profits.

The INPUTS are as follows,
1) L_Bars —————————> 4
2) R_Bars —————————> 4
3) Volume Break ————> 5
4) Price Cross Ema ——> 100
5) ATR LONG ——————> 2.4
6) ATR SHORT —————> 2.6
7) RISK —————————> 2000
8) Default qty size ——> 50
TCS

Save it to favorites.
Apply it to your charts Now !!

Thank You ☺
TCS

Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?