OPEN-SOURCE SCRIPT

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
backtestbreakoutdaytradingeducationalindianprofitableriskmanagmentstrategySupport and Resistancetradingtrend

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?


También en:

Exención de responsabilidad