BankNifty 5min Supertrend Based StrategyBankNifty 5min Supertrend Based Strategy, Intraday.
Work Best at 5mint chart on BankNifty.
The strategy is designed to trade using the Supertrend indicator with session-based rules, and risk management. It allows for customization through input variables and aims to provide a clear visual representation of the Supertrend by changing the color .
The script also includes input variables for the trading session and date range, which allows the trader to specify the time period in which they want the strategy to run. The session variable specifies the start and end times of the trading session, which in this case is set to the Indian trading session from 9:15 am to 3:10 pm.
The strategy starts by defining input variables such as the session time, start and end date for the backtesting, the length of the ATR, and the Supertrend factor. It also includes options for delay at session start and stop loss points and trail percentage .
The code then checks if the current time is within the specified session and date range . If it is, the Supertrend and its direction are calculated using the defined input variables. The strategy then waits for N numbers of candles (defined by the User) to form at the start of every session i.e. 09:15 AM before entering a trade.
The entry and exit conditions for long and short trades are defined based on the change in the Supertrend direction and the number of candles formed at the session start i.e. 09:15 AM . After that, it takes entry and exit for long and short trades on the change in the Supertrend direction . Stop-loss and trailing stop-loss are also defined based on the input variables.
Stop-loss (Defined by the user) is fixed points either below or above the Entry Price for Long and Short entries.
The Supertrend plot is displayed with changing colors depending on the direction. Finally, the strategy closes all trades at the end of the session if there are any open trades.
Overall, this strategy aims to trade with the Supertrend indicator using session-based rules and risk management.
However, as with any trading strategy, it is important to thoroughly test it before using it in live trading .
Intraday
NIFTY 50 5mint StrategyThis 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.
M0PB (Momentum Pullback)Long/short strategy that identifies extreme readings on the rsi as a *momentum signal*, unlike most RSI strategies the script will look to buy or sell the first pullback in the direction of the extreme RSI reading.
Enters positions on the first pullback to the 5ema(low)/ 5ema(high) and exits at rolling 12 bar high/ low. The rolling high/ low feature means that if the price enters into a prolonged consolidation the profit target will begin to reduce with each new bar. The best trades tend to work within 2-6 bars.
Built for use on 5 min intervals on FX, Indexes, and Crypto. Lower than 5 minute time frames tend to be noisier and mean more commissions and a higher risk of slippage so the suggested timeframe is 5 mins.
Hard stop is X ATR (users can experiment with this) from the position entry price. This can be adjusted in user inputs.
There is a lot of slack left in entries and exits but the overall strategy is fairly robust across timeframes and markets and has between 60%-70% win rate with larger winners.
Signals that occur from economic news volatility are best avoided.
Consolidation Breakout [Indian Market Timing]OK let's get started ,
A Day Trading (Intraday) Consolidation Breakout Indication Strategy that explains time condition for Indian Markets .
The commission is also included in the strategy .
The basic idea is ,
1) Price crosses above upper band , indicated by a color change (green) is the Long condition .
2) Price crosses below lower band , indicated by a color change (red) is the Short condition .
3) ATR is used for trailing after entry
// ═══════════════════════════════//
// ————————> TIME CONDITION <————————— //
// ═══════════════════════════════//
The Indian Markets open at 9:15am and closes at 3:30pm.
The time_condition specifies the time at which Entries should happen .
"Close All" function closes all the trades at 2:57pm.
All open trades get closed at 2:57pm , because some brokers dont allow you to place fresh intraday orders after 3pm.
NSE:NIFTY1!
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 114 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
LENGTH , MULT (factor) and ATR can be changed for better backtest results.
The strategy applied to NIFTY (3 min Time-Frame and contract size 5) gives us 60% profitability , as shown below
It was tested for a period a 8 months with a Profit Factor of 2.2 , avg Trade of 6000Rs profit and Sharpe Ratio : 0.67
The graph has a Linear Curve with consistent profits.
NSE:NIFTY1!
Save it favorites.
Apply it to your charts Now !!
Thank me later ;)
MACD Willy StrategyThis strategy is mainly developed for scalping / intraday trading. It could potentially be used to identify entry/exit signals for short term options trading. It performs decently well on popular stocks when used on time frames between 5 min to 15 min using regular session bar data. It combines 3 popular indicators, EMA, MACD, and William %range, to generate both long and short signals.
EMA:
Default is 200 EMA line.
MACD:
Default is 12/26 lengths for fast/slow signal inputs.
William %R - Smoothed (Published):
This is a custom indicator that generates two moving average lines from the original William %R line.
How it works:
Entry conditions:
1. Long/short entries when bar closes above/below EMA line
2. Long/short entries when MACD line is above/below signal line (histogram > 0 for long, < 0 for short)
3. Long/short entries when William %R fast MA line is above/below slow MA line
Exit conditions:
1. Exit long when MACD line is below signal line, vise versa for exit short
2. Exit long when William %R fast MA line is below slow MA line, vise versa for exit short
3. Exit long when William %R fast MA line must in below the overbought (-20) limit, exit short when above the oversold (-80) limit.
***Note that parameters are NOT optimized for any particular stocks / instruments.
Enjoy~~!!
[VJ]First Candle StrategyHello Traders, this is a simple intraday strategy involving the first candle of the day with an additional twist to the traditional style . You can modify the time of candle on the stock and see what are your best picks. Comment below if you found something with good returns
Strategy: Observe the first candle of the day within any time frame. 15m works best. If the first candle is RED ,then go for buy side for the rest of the day. You could square off at close of session or have a fixed take profit and stop loss. This is a contrarian indicator where people just use this as their first entry for the day. The same holds good when a Green candle is seen you go short side.
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
Tendency EMA + RSI [Alorse]A very simple and highly effective strategy LONG & SHORT that combines only 2 indicators:
RSI
3 Moving Average Exponential (EMA)
LONG Entry conditions are:
EMA 20 cross over EMA 10
EMA 10 is above EMA 100
LONG Exit conditions are:
RSI greater than 70
Or when X number of candles have passed and the trade is in profit. (Check Settings)
SHORT Entry conditions are:
EMA 20 cross under EMA 10
EMA 10 is below EMA 100
SHORT Exit conditions are:
RSI is less than 30
Or when X number of candles have passed and the trade is in profit. (Check Settings)
Webhook Starter Kit [HullBuster]
Introduction
This is an open source strategy which provides a framework for webhook enabled projects. It is designed to work out-of-the-box on any instrument triggering on an intraday bar interval. This is a full featured script with an emphasis on actual trading at a brokerage through the TradingView alert mechanism and without requiring browser plugins.
The source code is written in a self documenting style with clearly defined sections. The sections “communicate” with each other through state variables making it easy for the strategy to evolve and improve. This is an excellent place for Pine Language beginners to start their strategy building journey. The script exhibits many Pine Language features which will certainly ad power to your script building abilities.
This script employs a basic trend follow strategy utilizing a forward pyramiding technique. Trend detection is implemented through the use of two higher time frame series. The market entry setup is a Simple Moving Average crossover. Positions exit by passing through conditional take profit logic. The script creates ten indicators including a Zscore oscillator to measure support and resistance levels. The indicator parameters are exposed through 47 strategy inputs segregated into seven sections. All of the inputs are equipped with detailed tool tips to help you get started.
To improve the transition from simulation to execution, strategy.entry and strategy.exit calls show enhanced message text with embedded keywords that are combined with the TradingView placeholders at alert time. Thereby, enabling a single JSON message to generate multiple execution events. This is genius stuff from the Pine Language development team. Really excellent work!
This document provides a sample alert message that can be applied to this script with relatively little modification. Without altering the code, the strategy inputs can alter the behavior to generate thousands of orders or simply a few dozen. It can be applied to crypto, stocks or forex instruments. A good way to look at this script is as a webhook lab that can aid in the development of your own endpoint processor, impress your co-workers and have hours of fun.
By no means is a webhook required or even necessary to benefit from this script. The setups, exits, trend detection, pyramids and DCA algorithms can be easily replaced with more sophisticated versions. The modular design of the script logic allows you to incrementally learn and advance this script into a functional trading system that you can be proud of.
Design
This is a trend following strategy that enters long above the trend line and short below. There are five trend lines that are visible by default but can be turned off in Section 7. Identified, in frequency order, as follows:
1. - EMA in the chart time frame. Intended to track price pressure. Configured in Section 3.
2. - ALMA in the higher time frame specified in Section 2 Signal Line Period.
3. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
4. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
5. - DEMA in the higher time frame specified in Section 2 Trend Line Period.
The Blue, Green and Orange lines are signal lines are on the same time frame. The time frame selected should be at least five times greater than the chart time frame. The Purple line represents the trend line for which prices above the line suggest a rising market and prices below a falling market. The time frame selected for the trend should be at least five times greater than the signal lines.
Three oscillators are created as follows:
1. Stochastic - In the chart time frame. Used to enter forward pyramids.
2. Stochastic - In the Trend period. Used to detect exit conditions.
3. Zscore - In the Signal period. Used to detect exit conditions.
The Stochastics are configured identically other than the time frame. The period is set in Section 2.
Two Simple Moving Averages provide the trade entry conditions in the form of a crossover. Crossing up is a long entry and down is a short. This is in fact the same setup you get when you select a basic strategy from the Pine editor. The crossovers are configured in Section 3. You can see where the crosses are occurring by enabling Show Entry Regions in Section 7.
The script has the capacity for pyramids and DCA. Forward pyramids are enabled by setting the Pyramid properties tab with a non zero value. In this case add on trades will enter the market on dips above the position open price. This process will continue until the trade exits. Downward pyramids are available in Crypto and Range mode only. In this case add on trades are placed below the entry price in the drawdown space until the stop is hit. To enable downward pyramids set the Pyramid Minimum Span In Section 1 to a non zero value.
This implementation of Dollar Cost Averaging (DCA) triggers off consecutive losses. Each loss in a run increments a sequence number. The position size is increased as a multiple of this sequence. When the position eventually closes at a profit the sequence is reset. DCA is enabled by setting the Maximum DCA Increments In Section 1 to a non zero value.
It should be noted that the pyramid and DCA features are implemented using a rudimentary design and as such do not perform with the precision of my invite only scripts. They are intended as a feature to stress test your webhook endpoint. As is, you will need to buttress the logic for it to be part of an automated trading system. It is for this reason that I did not apply a Martingale algorithm to this pyramid implementation. But, hey, it’s an open source script so there is plenty of room for learning and your own experimentation.
How does it work
The overall behavior of the script is governed by the Trading Mode selection in Section 1. It is the very first input so you should think about what behavior you intend for this strategy at the onset of the configuration. As previously discussed, this script is designed to be a trend follower. The trend being defined as where the purple line is predominately heading. In BiDir mode, SMA crossovers above the purple line will open long positions and crosses below the line will open short. If pyramiding is enabled add on trades will accumulate on dips above the entry price. The value applied to the Minimum Profit input in Section 1 establishes the threshold for a profitable exit. This is not a hard number exit. The conditional exit logic must be satisfied in order to permit the trade to close. This is where the effort put into the indicator calibration is realized. There are four ways the trade can exit at a profit:
1. Natural exit. When the blue line crosses the green line the trade will close. For a long position the blue line must cross under the green line (downward). For a short the blue must cross over the green (upward).
2. Alma / Linear Regression event. The distance the blue line is from the green and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 6 and relies on the period and length set in Section 2. A long position will exit on an upward thrust which exceeds the activation threshold. A short will exit on a downward thrust.
3. Exponential event. The distance the yellow line is from the blue and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 3 and relies on the period and length set in the same section.
4. Stochastic event. The purple line stochastic is used to measure overbought and over sold levels with regard to position exits. Signal line positions combined with a reading over 80 signals a long profit exit. Similarly, readings below 20 signal a short profit exit.
Another, optional, way to exit a position is by Bale Out. You can enable this feature in Section 1. This is a handy way to reduce the risk when carrying a large pyramid stack. Instead of waiting for the entire position to recover we exit early (bale out) as soon as the profit value has doubled.
There are lots of ways to implement a bale out but the method I used here provides a succinct example. Feel free to improve on it if you like. To see where the Bale Outs occur, enable Show Bale Outs in Section 7. Red labels are rendered below each exit point on the chart.
There are seven selectable Trading Modes available from the drop down in Section 1:
1. Long - Uses the strategy.risk.allow_entry_in to execute long only trades. You will still see shorts on the chart.
2. Short - Uses the strategy.risk.allow_entry_in to execute short only trades. You will still see long trades on the chart.
3. BiDir - This mode is for margin trading with a stop. If a long position was initiated above the trend line and the price has now fallen below the trend, the position will be reversed after the stop is hit. Forward pyramiding is available in this mode if you set the Pyramiding value in the Properties tab. DCA can also be activated.
4. Flip Flop - This is a bidirectional trading mode that automatically reverses on a trend line crossover. This is distinctively different from BiDir since you will get a reversal even without a stop which is advantageous in non-margin trading.
5. Crypto - This mode is for crypto trading where you are buying the coins outright. In this case you likely want to accumulate coins on a crash. Especially, when all the news outlets are talking about the end of Bitcoin and you see nice deep valleys on the chart. Certainly, under these conditions, the market will be well below the purple line. No margin so you can’t go short. Downward pyramids are enabled for Crypto mode when two conditions are met. First the Pyramiding value in the Properties tab must be non zero. Second the Pyramid Minimum Span in Section 1 must be non zero.
6. Range - This is a counter trend trading mode. Longs are entered below the purple trend line and shorts above. Useful when you want to test your webhook in a market where the trend line is bisecting the signal line series. Remember that this strategy is a trend follower. It’s going to get chopped out in a range bound market. By turning on the Range mode you will at least see profitable trades while stuck in the range. However, when the market eventually picks a direction, this mode will sustain losses. This range trading mode is a rudimentary implementation that will need a lot of improvement if you want to create a reliable switch hitter (trend/range combo).
7. No Trade. Useful when setting up the trend lines and the entry and exit is not important.
Once in the trade, long or short, the script tests the exit condition on every bar. If not a profitable exit then it checks if a pyramid is required. As mentioned earlier, the entry setups are quite primitive. Although they can easily be replaced by more sophisticated algorithms, what I really wanted to show is the diminished role of the position entry in the overall life of the trade. Professional traders spend much more time on the management of the trade beyond the market entry. While your trade entry is important, you can get in almost anywhere and still land a profitable exit.
If DCA is enabled, the size of the position will increase in response to consecutive losses. The number of times the position can increase is limited by the number set in Maximum DCA Increments of Section 1. Once the position breaks the losing streak the trade size will return the default quantity set in the Properties tab. It should be noted that the Initial Capital amount set in the Properties tab does not affect the simulation in the same way as a real account. In reality, running out of money will certainly halt trading. In fact, your account would be frozen long before the last penny was committed to a trade. On the other hand, TradingView will keep running the simulation until the current bar even if your funds have been technically depleted.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that the endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Webhook Integration
The TradingView alerts dialog provides a way to connect your script to an external system which could actually execute your trade. This is a fantastic feature that enables you to separate the data feed and technical analysis from the execution and reporting systems. Using this feature it is possible to create a fully automated trading system entirely on the cloud. Of course, there is some work to get it all going in a reliable fashion. Being a strategy type script place holders such as {{strategy.position_size}} can be embedded in the alert message text. There are more than 10 variables which can write internal script values into the message for delivery to the specified endpoint.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that my endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Here is an excerpt of the fields I use in my webhook signal:
"broker_id": "kraken",
"account_id": "XXX XXXX XXXX XXXX",
"symbol_id": "XMRUSD",
"action": "{{strategy.order.action}}",
"strategy": "{{strategy.order.id}}",
"lots": "{{strategy.order.contracts}}",
"price": "{{strategy.order.price}}",
"comment": "{{strategy.order.alert_message}}",
"timestamp": "{{time}}"
Though TradingView does a great job in dispatching your alert this feature does come with a few idiosyncrasies. Namely, a single transaction call in your script may cause multiple transmissions to the endpoint. If you are using placeholders each message describes part of the transaction sequence. A good example is closing a pyramid stack. Although the script makes a single strategy.close() call, the endpoint actually receives a close message for each pyramid trade. The broker, on the other hand, only requires a single close. The incongruity of this situation is exacerbated by the possibility of messages being received out of sequence. Depending on the type of order designated in the message, a close or a reversal. This could have a disastrous effect on your live account. This broker simulator has no idea what is actually going on at your real account. Its just doing the job of running the simulation and sending out the computed results. If your TradingView simulation falls out of alignment with the actual trading account lots of really bad things could happen. Like your script thinks your are currently long but the account is actually short. Reversals from this point forward will always be wrong with no one the wiser. Human intervention will be required to restore congruence. But how does anyone find out this is occurring? In closed systems engineering this is known as entropy. In practice your webhook logic should be robust enough to detect these conditions. Be generous with the placeholder usage and give the webhook code plenty of information to compare states. Both issuer and receiver. Don’t blindly commit incoming signals without verifying system integrity.
Setup
The following steps provide a very brief set of instructions that will get you started on your first configuration. After you’ve gone through the process a couple of times, you won’t need these anymore. It’s really a simple script after all. I have several example configurations that I used to create the performance charts shown. I can share them with you if you like. Of course, if you’ve modified the code then these steps are probably obsolete.
There are 47 inputs divided into seven sections. For the most part, the configuration process is designed to flow from top to bottom. Handy, tool tips are available on every field to help get you through the initial setup.
Step 1. Input the Base Currency and Order Size in the Properties tab. Set the Pyramiding value to zero.
Step 2. Select the Trading Mode you intend to test with from the drop down in Section 1. I usually select No Trade until I’ve setup all of the trend lines, profit and stop levels.
Step 3. Put in your Minimum Profit and Stop Loss in the first section. This is in pips or currency basis points (chart right side scale). Remember that the profit is taken as a conditional exit not a fixed limit. The actual profit taken will almost always be greater than the amount specified. The stop loss, on the other hand, is indeed a hard number which is executed by the TradingView broker simulator when the threshold is breached.
Step 4. Apply the appropriate value to the Tick Scalar field in Section 1. This value is used to remove the pipette from the price. You can enable the Summary Report in Section 7 to see the TradingView minimum tick size of the current chart.
Step 5. Apply the appropriate Price Normalizer value in Section 1. This value is used to normalize the instrument price for differential calculations. Basically, we want to increase the magnitude to significant digits to make the numbers more meaningful in comparisons. Though I have used many normalization techniques, I have always found this method to provide a simple and lightweight solution for less demanding applications. Most of the time the default value will be sufficient. The Tick Scalar and Price Normalizer value work together within a single calculation so changing either will affect all delta result values.
Step 6. Turn on the trend line plots in Section 7. Then configure Section 2. Try to get the plots to show you what’s really happening not what you want to happen. The most important is the purple trend line. Select an interval and length that seem to identify where prices tend to go during non-consolidation periods. Remember that a natural exit is when the blue crosses the green line.
Step 7. Enable Show Event Regions in Section 7. Then adjust Section 6. Blue background fills are spikes and red fills are plunging prices. These measurements should be hard to come by so you should see relatively few fills on the chart if you’ve set this up as intended. Section 6 includes the Zscore oscillator the state of which combines with the signal lines to detect statistically significant price movement. The Zscore is a zero based calculation with positive and negative magnitude readings. You want to input a reasonably large number slightly below the maximum amplitude seen on the chart. Both rise and fall inputs are entered as a positive real number. You can easily use my code to create a separate indicator if you want to see it in action. The default value is sufficient for most configurations.
Step 8. Turn off Show Event Regions and enable Show Entry Regions in Section 7. Then adjust Section 3. This section contains two parts. The entry setup crossovers and EMA events. Adjust the crossovers first. That is the Fast Cross Length and Slow Cross Length. The frequency of your trades will be shown as blue and red fills. There should be a lot. Then turn off Show Event Regions and enable Display EMA Peaks. Adjust all the fields that have the word EMA. This is actually the yellow line on the chart. The blue and red fills should show much less than the crossovers but more than event fills shown in Step 7.
Step 9. Change the Trading Mode to BiDir if you selected No Trades previously. Look on the chart and see where the trades are occurring. Make adjustments to the Minimum Profit and Stop Offset in Section 1 if necessary. Wider profits and stops reduce the trade frequency.
Step 10. Go to Section 4 and 5 and make fine tuning adjustments to the long and short side.
Example Settings
To reproduce the performance shown on the chart please use the following configuration: (Bitcoin on the Kraken exchange)
1. Select XBTUSD Kraken as the chart symbol.
2. On the properties tab set the Order Size to: 0.01 Bitcoin
3. On the properties tab set the Pyramiding to: 12
4. In Section 1: Select “Crypto” for the Trading Model
5. In Section 1: Input 2000 for the Minimum Profit
6. In Section 1: Input 0 for the Stop Offset (No Stop)
7. In Section 1: Input 10 for the Tick Scalar
8. In Section 1: Input 1000 for the Price Normalizer
9. In Section 1: Input 2000 for the Pyramid Minimum Span
10. In Section 1: Check mark the Position Bale Out
11. In Section 2: Input 60 for the Signal Line Period
12. In Section 2: Input 1440 for the Trend Line Period
13. In Section 2: Input 5 for the Fast Alma Length
14. In Section 2: Input 22 for the Fast LinReg Length
15. In Section 2: Input 100 for the Slow LinReg Length
16. In Section 2: Input 90 for the Trend Line Length
17. In Section 2: Input 14 Stochastic Length
18. In Section 3: Input 9 Fast Cross Length
19. In Section 3: Input 24 Slow Cross Length
20. In Section 3: Input 8 Fast EMA Length
21. In Section 3: Input 10 Fast EMA Rise NetChg
22. In Section 3: Input 1 Fast EMA Rise ROC
23. In Section 3: Input 10 Fast EMA Fall NetChg
24. In Section 3: Input 1 Fast EMA Fall ROC
25. In Section 4: Check mark the Long Natural Exit
26. In Section 4: Check mark the Long Signal Exit
27. In Section 4: Check mark the Long Price Event Exit
28. In Section 4: Check mark the Long Stochastic Exit
29. In Section 5: Check mark the Short Natural Exit
30. In Section 5: Check mark the Short Signal Exit
31. In Section 5: Check mark the Short Price Event Exit
32. In Section 5: Check mark the Short Stochastic Exit
33. In Section 6: Input 120 Rise Event NetChg
34. In Section 6: Input 1 Rise Event ROC
35. In Section 6: Input 5 Min Above Zero ZScore
36. In Section 6: Input 120 Fall Event NetChg
37. In Section 6: Input 1 Fall Event ROC
38. In Section 6: Input 5 Min Below Zero ZScore
In this configuration we are trading in long only mode and have enabled downward pyramiding. The purple trend line is based on the day (1440) period. The length is set at 90 days so it’s going to take a while for the trend line to alter course should this symbol decide to node dive for a prolonged amount of time. Your trades will still go long under those circumstances. Since downward accumulation is enabled, your position size will grow on the way down.
The performance example is Bitcoin so we assume the trader is buying coins outright. That being the case we don’t need a stop since we will never receive a margin call. New buy signals will be generated when the price exceeds the magnitude and speed defined by the Event Net Change and Rate of Change.
Feel free to PM me with any questions related to this script. Thank you and happy trading!
CFTC RULE 4.41
These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under-or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.
[VJ]Phoenix Force of PSAR +MACD +RSIThis is a simple intraday strategy for working on Stocks or commodities based out on PSAR, MACD , RSI and chop index . You can modify the start time and end time based on your timezones. Session value should be from market start to the time you want to square-off
Important: The end time should be at least 2 minutes before the intraday square-off time set by your broker
Comment below if you get good returns
Strategy: Entry Exits using PSAR and momentum and trend using MACD and RSI. A chop index is used as filtering
Indicators used :
Parabolic SAR is a technical indicator that is used to determine the price direction of stocks and it also draws attention to the traders when the price is changing
PSAR helps you:
Identify when a certain price trend is going to change direction
Indicate the most effective level at which to enter into the trade
Indicate the most effective exit point for the trade
Moving average convergence divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security's price. ... Traders may buy the security when the MACD crosses above its signal line and sell—or short—the security when the MACD crosses below the signal line
RSI is intended to chart the current and historical strength or weakness of a stock or market based on the closing prices of a recent trading period.
Buying/Selling
When trading with the parabolic SAR, you would buy a market when the dots move below the current asset price and are green in colour. Alternatively, you would sell a market when the dots move above the current asset price and are red in colour. We use MACD , RSI to ensure that a right trade is picked when PSAR gives an indication. CI is used to stay away from the range bound market as much as possible.
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
MA length : 200
RSI threshold : 50
MACD: 12,26,9
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
[VJ]Thor for MFIThis is a simple intraday strategy for working on Stocks or commodities . You can modify the start time and end time based on your timezones. Session value should be from market start to the time you want to square-off
Important: The end time should be at least 2 minutes before the intraday square-off time set by your broker
Comment below if you get good returns
Strategy:
Indicators used :
Moving average (MA) is a widely used technical indicator that smooths out price trends by filtering out the “noise” from random short-term price fluctuations. Here moving averages are used to identify trend direction and to determine support and resistance levels. Overbought and oversold regions are also taken into consideration
The Money Flow Index ( MFI ) is a momentum indicator that measures the flow of money into and out of a security over a specified period of time. It is related to the Relative Strength Index ( RSI ) but incorporates volume , whereas the RSI only considers price. The MFI is calculated by accumulating positive and negative Money Flow values (see Money Flow ), then creating a Money Ratio. The Money Ratio is then normalized into the MFI oscillator form.
Using the combination of Overbought and Oversold values and varying MFI and using the MA filter to ensure the direction , we can buy/sell when conditions are met
Buying with MFI
1. MFI drops below 20 and enters inside oversold zone.
2. MFI bounces back above 20.
3. MFI pulls back but remains above 20.
4. A MFI break out above its previous high is a good buy signal.
Selling with MFI
1. MFI rises above 80 and enters inside overbought zone.
2. MFI drops back below 80.
3. MFI rises slightly but remains below 80.
4. MFI drops lower than its previous low is a signal to short sell or profit booking
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
MFI factor : 3
Moving Average : 80
Overbought & Oversold - can be varied as per user
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
[VJ]War Machine PAT IntraThis is a simple intraday strategy for working on Stocks . You can modify the values on the stock and see what are your best picks. Comment below if you found something with good returns
Strategy:
Indicators used :
The Choppiness Index is designed to determine whether the market is choppy or trading sideways, or not choppy and trading within a trend in either direction. Using a scale from 1 - 100, the market is considered to be choppy as values near 100 (over 61.80) and trending when values are lower than 38.20)
The Money Flow Index (MFI) is a momentum indicator that measures the flow of money into and out of a security over a specified period of time. It is related to the Relative Strength Index (RSI) but incorporates volume, whereas the RSI only considers price. The MFI is calculated by accumulating positive and negative Money Flow values (see Money Flow), then creating a Money Ratio. The Money Ratio is then normalized into the MFI oscillator form.
Using the combination of CI (trend factor as constant) and varying MFI, we can buy/sell when conditions are met
Buying with MFI
1. MFI drops below 20 and enters inside oversold zone.
2. MFI bounces back above 20.
3. MFI pulls back but remains above 20.
4. A MFI break out above its previous high is a good buy signal.
Selling with MFI
1. MFI rises above 80 and enters inside overbought zone.
2. MFI drops back below 80.
3. MFI rises slightly but remains below 80.
4. MFI drops lower than its previous low is a signal to short sell or profit booking
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
Trending factor : 50
Overbought & Oversold - can be varied as per user
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
Supertrend - IntradaySupertrend Intraday Strategy
Basic supertrend strategy purpose built for intraday trading. Users can define intraday session during which the strategy will run.
Position is reversed when signal changes by using double quantity. Once the intraday session is over & if the position is open; it is squared off.
Parameters:
Intraday Session - Defines the duration for which the strategy should execute.
Multiplier
ATR Period
Moving Average - IntradayMoving Average Intraday Strategy
Basic moving average strategy purpose built for intraday trading. It uses two simple moving averages & takes a positions on crossover.
Position is reversed when signal changes by using double quantity. Once the intraday session is over & if the position is open; it is squared off.
Users can define intraday session during which the strategy will run.
Parameters:
Intraday Session - Defines the duration for which the strategy should execute.
Short Term Moving Average Period
Long Term Moving Average Period
Simple Moving Average CrossoverThis strategy uses two moving averages of 21 and 8 to generate buy or sell signal.
This is for purely intraday trades and best use in 15 min time frame
This strategy uses angle/slope of ma to filter out period of sideways movement and only generate signals when the stock starts trending in one direction
How to use this
1) Buy when the buy is generated
2) Sell when the sell is generated
Properties you can tweak to adjust this strategy to your needs are
1) angle -> Adjust this properties to define how much slope would be considered to generate the signals, higher the values lesser the trades generated.
2) atr period-> this is to adjust the atr period
3) ma source -> close is considered as source , you can use open or high or low
ARR VWAP IntradayIntra day VWAP Strategy
Strategy is
Buy when vwap goes up and RSI above 50 (Can be modified) .
Sell wehn vwap goes down and rsi bellow 50 (Can be modified)
Exit all at market close hour specified
FTSMA - Trend is your frendThis my new solid strategy: if you belive that "TREND IS YOUR FRIEND" this is for you!
I have tested with many pairs and at many timeframes and have profit with just minor changes in settings.
I suggest to use it for intraday trading .
VERY IMPORTANT NOTE: this is a trend following strategy, so the target is to stay in the trade as much as possible. If your trading style is more focused on scalping and/or pullbaks, this strategy is not for you.
This strategy uses moving averages applied to Fourier waves for forecasting trend direction.
How strategy works:
- Buy when fast MA is above mid MA and price is above slow MA, which acts as a trend indicator.
- Sell when fast MA is below mid MA and price is below slow MA, which acts as a trend indicator.
Strategy uses a lot of pyramiding orders because when you are in a flat market phase it will close 1 or 2 orders with a loss, but when a big trend starts, it will have profit in a lot of orders.
So, if you analize carefully the strategy results, you will note that "Percent Profitable" is very low (30% in this case) because strategy opened a lot of orders also in flat markets with small losses, BUT "Avg # bars in winning trades" is very high and overall Profit is very high: when a big trend starts, orders are kept open for long time generating big profits.
Thanks to all pinescripters mentioned in the code for their snippets.
I have also a study with alerts. Next improvement (only to whom is interested to this script and follows me): study with alerts on multiple tickers all at one. Leave a comment if you want to have access to study.
HOW TO USE STRATEGY AND STUDY TOGHETER:
1- Add to chart the strategy first, so your workspace will be as clean as possible.
2- Open the Strategy Tester tab at footer of the page.
3- Modify settings to get best results (Profit, Profit Factor, Drawdown).
4- Add study with alerts to your chart with same setting of strategy.
I WILL PROVIDE A DETAILED QUICK INSTALLATION GUIDE WITH THE STUDY!
Please use comment section for any feedback or contact me if you need support.
Strategy - Bobo PAPATRHi I've revamped this bot mentioned in the linked idea to make it work with v4 of pine. In doing so there are some very significant changes to how it works. The main one is that it no longer uses traditional daily pivot calculations to calculate the bands. It creates a more dynamic intraday set of pivot points based on recent price action rather than yesterday's ohlc. As published, the bot is tuned for a 15 min time frame. But it actually works well on lower time frames you just need to adjust the lookback periods in settings a bit to re tune it. It's also tuned to ES really but will need tweaking for a different instrument at the very least.
The basic concept is recent price action is used to calculate a 'middle' around which red and green bands are located. Their position or width is largely determined by recent volatility. The middle line is again calculated from recent price action. The three lines from that form a tradeable range with green at the top and red at the bottom. The strategy is simple enough, it shorts as it sinks from outside red, and longs when rising above green. The basic principle being that once you enter that range you have a high probability of hitting the middle before you hit your stop loss. So the basic principle is you are trying to capture the inherent ranginess of liquid indices like S&P 500. That back and forth movement that happens. The bot is capturing this by fading extremes of a recent range but the problem with that is you'dd get murdered in a strong trend. To mitigate that there is a trend calculation running in the background the will prevent trading against firm trends mostly. So the bot should trade mostly in rangy conditions because that is what it is trying to do.
Bot will close issue close signals automatically upon crossing the middle, it also will close automatically at predefined stops or limits. These values are denominated in market mintick values. For example the CFD SPX500 has a mintick of 0.1. Therefore a stop value of 100 will equate to 10 points on the index. If trading the same market via ES1! the mintick value is different - 0.25. So in this case a value of 40 is required to set the stop at 10 points.
Anyway shout if you have questions. Hope it's useful.
TVC:SPX OANDA:SPX500USD
Strategy - Bobo Intraday Swing Bot with filtersThis is an adapted version of my swing bot with additional filters that mean it works quite well on lower timeframes like 1min, 5 mins as long as you adjust the setting accordingly (reduce pivot timescale, band width)
Entry conditions are filtered by an invisible trend calculation running in the background so the bot doesn't repeatedly try and fail to fade a strong trend. It has just about everything you should need for basic use, stop losses and targets, automatically close trade at pivot.
I get good results on rangey instruments like major indices such as SPX / ES that kind of thing. Make sure you understand the minmum tick value of an index so the stop setting on the bot work properly
Hope it's useful!
QuantCat Intraday Strategy (15M)QuantCat Intraday Strategy
This strategy is designed to be used on the 15 minute time frame, on liquid x/btc pairs and BTC/USD.
It works by having 2 moving averages, automatic stop loss calculation, and taking positions on MA crosses and MA zone bounces for confirmation.
Stoploss is so crucial to minimise any damage from huge unexpected candles, the strategies can just be used for entries as well, you don't have to stick to the exact formula- of the long and short system, but this by itself is profitable.
The system nets positive results on
-BTC/USD
-ETH/BTC
-LTC/BTC
-XRP/BTC
There is a small element of trend filtering also for the MA's, but I found adding it in actually hindered performance when testing and training the strategies unless it was using a loose value.
You can get live alerts for this strategy and speak to our developers by joining our server on discord! (Link in signature)
The Puria MethodTraders who work on this system argue that the Forex Strategy “The Puria Method” can make a 50 points profit a day :) FX:EURUSD )
Volume & Intraday ScriptI am still learning pinescript, and part of this was created using the Pine Script language reference manual. This includes looking at the time series, a fixed length, and the default intraday_loss variables. This also includes the basic fixed lengths for an swma (Symmetrically weighted moving average) and the script to start creating a strategy. All in all this is just a basic sample of pinescript that you can customize for your trading needs. This can work with Cryptocurrency but these moving averages usually work more efficiently for forex.
EMA Intraday StrategyHere is a EMA intraday strategy. very profitable on the GBPAUD 1M charts if you are watching very closely, working on coding a indicator for it