Database in trading SQL remains a fundamental tool for querying and managing data. SQL's simplicity and power make it accessible to both beginners and experts. In trading systems, SQL enables efficient data retrieval and manipulation. Users can write SQL queries to analyze market trends and execute trading strategies.
Postgres is an open-source production-ready database with lots of use cases. Mongo is a NoSQL alternative that can sometimes be much faster than SQL databases. Arctic is built upon Mongo to make it even more helpful for those who work with market data, as Arctic supports pandas dataframes and NumPy arrays by default.
Pivot Points
How to draw support and resistance The most reliable source for identifying support and resistance levels is historical prices, making them invaluable to traders. The key is to familiarise yourself with past patterns – sometimes from very recent activity – so you can recognise them if they appear again.
Simply mark visible highs and lows on your chart; the higher highs and lower highs will serve as resistance levels, whereas the lower lows and higher lows will serve as support levels. It is always recommended that these lines are marked on longer timeframes to have reliable support and resistance levels.
BACKTESTED PIVOT INTRADAY STARTEGY [INDIA MARKET TIMING]A Back-tested Profitable Strategy for Free!!
A PIVOT INTRADAY STRATEGY for 5 minute Time-Frame , that also explains 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 ema1 ,indicated by pivot high line in green color .
2) Price crosses below ema1 ,indicated by pivot low line in red color .
3) Candle high crosses above pivot high , is the Long condition .
4) Candle low crosses below pivot low , is the Short condition .
5) Maximum Risk per trade for the intraday trade can be changed .
6) Default_qty_size is set to 60 contracts , which can be changed under settings → properties → order size .
7) ATR is used for trailing after entry, as mentioned in the inputs below.
// ═════════════════════════//
// ————————> INPUTS <————————— //
// ═════════════════════════//
Leftbars ——————————> Length of pivot highs and lows
Rightbars —————————> Length of pivot highs and lows
Price Cross Ema —————> Added condition
ATR LONG —————————> ATR stoploss trail for Long positions
ATR SHORT ————————> ATR stoploss trail for Short positions
RISK ————————————> Maximum Risk per trade for the day
The strategy was back-tested on RELIANCE ,the input values and the results are mentioned under "BACKTEST RESULTS" below .
// ═════════════════════════ //
// ————————> PROPERTIES<——————— //
// ═════════════════════════ //
Default_qty_size ————> 60 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 25 .
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 103 .
All open trades get closed at 3pm , because some brokers don't allow you to place fresh intraday orders after 3pm .
NSE:RELIANCE
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 128 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
INPUTS can be changed for better back-test results.
The strategy applied to NSE:RELIANCE ( 5 min Time-Frame and contract size 60) gives us 61% profitability , as shown below
It was tested for a period a 6 months with a Profit Factor of 1.45 , Net Profit of 21,500Rs .
Sharpe Ratio : 0.311
Sortino Ratio : 0.727
The graph has a Linear Curve with consistent profits.
The INPUTS are as follows,
1) Leftbars ————————> 3
2) Rightbars ——————— > 5
3) Price Cross Ema ———> 150
4) ATR LONG ——————> 2.7
5) ATR SHORT —————> 2.9
6) RISK —————————> 2500
7) Default qty size ——> 60
NSE:RELIANCE
Save it to favorites.
Apply it to your charts Now !!
FOLLOW US FOR MORE !
Thank me later ☺