Cipher_B (Finandy support)In this version of the script you can force to cancel your position after some amount of time indepedently on price action. For example, your bot open a short position with SL=1% and TP=2.4% but price did not reach any of this level over the course of to say 8 hours. In this case, position will be closed regardless of the price.
Other interesting features are volume and slope filters. Slope is essentially a derivative of price action. If you don't like to buy your instrument under high volatility, for example, if a trend goes down too fast then you can filter long position which could be opened according to the strategy. Same thing for volume filter. If the volume is too high/too low, you might want to escape such setup in your trading strategy.
Moreover, you can tune price shift for opening position. To say, if you believe that the signal for opening position comes too early everytime, you can force the strategy to buy at 1% lower price than the current price when the signal comes. Similar logic for short: open position price will be always higher than the price of the signal. If the price did not reach such level then position will be automatically cancel with a new signal arrival. Check the backtesting results to understand better the logic.
Candlestick analysis
Double Inside Bar & Trend Strategy - KaspricciDouble Inside Bar & Trend Strategy - Kaspricci
This strategy combines the Double Inside Bar candlestick pattern with a trend filter. Once the second inside bar closes and price is above trend moving average, a buy stop order is placed at high of the candle. If price is below trend moving average, a sell stop order is placed at the low of the candle.
This strategy is for educational purposes only! It is not meant to be a financial advice.
Settings
Trend source, type of moving average and length for calculating trend
Stop Loss Type - default: ATR. You can switch between stop loss calculation based on Average True Range value or fixed value.
ATR Length / Factor / TP Ratio - default: 14 / 2.0 / 2.0. Used to calculate the Stop Loss as ATR * Factor and Take Profit as Stop Loss * TP Ratio.
FIX Stop Loss / Take Profit - default: 10 pips / 20 pips. In case you select Stop Loss Type = FIX, these value swill be used.
Risk in % - default: 1%, option to adjust the quantity of a trade based on a defined risk percentage. If enabled, it will overwrite the quantity parameter of the strategy settings.
On top you can filter trades by start and end date as well as time of the day.
50 Pips A Day Strategy - Kaspricci50 Pips A Day Strategy
This strategy is designed to work on 1 hour timeframe. It is designed to capture the early market move of major forex pairs like EURUSD or GBPUSD. It takes the high and low of the first candle (7 a.m. GMT, London Stock Exchange opens) and places to pending orders at these prices levels.
High + additional gap in pips = buy stop pending order
Low + additional gap in pips = sell stop pending order
For both orders a stop loss of 15 pips and a take profit of 50 pips is used as a default. As soon as price triggers one pending order, the remaining pending order is cancelled. At the end of the configured session time all open and pending orders are closed / cancelled.
Settings
Trading Time - start and end time of session. It is configured for Monday to Friday only. At the beginning the first candle is used to define stop prices for pending orders.
Source for Buy Stop order - Default: high. Used to calculate buy stop order. You can add additional pips as a gap.
Source for Sell Stop order - Default: low. Used to calculate sell stop order. You can add additional pips as a gap.
Stop Loss in Pips - Default: 15. Used for both pending orders.
Take Profit in Pips - Default: 50. Used for both pending orders.
This strategy is for educational purposes only! It is not meant to be a financial recommendation.
Sine Wave TheoryThere are some ideas out there that the market is like a collection of quantum events and that it could all be broken down into sine waves. I created this script to put that to the test.
The idea is simple, I tested 3 different factors that could be put into sine wave form.
1.) Bar Change
2.) Volume Average Change
3.) Coin Flip
For the bar change, I simply allow the sine wave to move upwards or downwards if the bars have changed color in their sequence. For example, if there were 3 red bars and 1 green bar, it would not move the sine wave up or down until the green bar appeared.
For the average volume change, it was the same idea, except that the sine wave could only move up or down if the volume had moved up or below the average value of the length given for calculating the average volume.
Finally, the coin flip simply simulates flipping a coin, and allows the sine wave to move one direction or the other once it has a side that is different from the previous chosen side. For example, heads, heads, heads, tails (once it flipped to tails, this would allow it to move a direction).
The sine wave trading theory that I watched claimed that if you know the correct sine wave # (which is how large the peak is, and/or the sine wave count which is how many peaks and valleys occur) that you can successfully predict future trades. Their claims that the reason it does not look like a perfect sine wave for these events is because there is different amounts of trading going on, thus the timing will be slightly off.
I am posting this to disagree with their ideas. For example, if you select to turn on trading for coin flip and turn off bar change, you will see the coin flip did better on the default settings!
It just so happens that any setting will eventually be good, making all the sine wave variations just completely random if you win or not.
I posted this to demonstrate how silly trading sine waves is. The real trick is using cosine and tangent waves... lol j/k
I hope this helps someone avoid this scam concept.
Open High Low StrategyThis is a very simple, yet effective and to some extend widely followed scalping strategy to capture the underling sentiments of the counter whether it will go up or down.
What is it?
This is Open-High-Low (OLH) strategy.
As you already aware of Candlestick patterns, there is patterns called as Marubozu patterns where the sell wick or buy wick either ceases to exists (or very small). This is exactly in the same principle.
In OLH strategy: The buy signal appears when the Open Price is the Low Price. It means if you draw the candlestick, there is no bottom wick. So after the opening of the candle, the demand drives the price up to the level, some selling may or may not come and closes in green. This indicates a strong upward biasness of the underlying counter.
Similarly, a sell signal appears when the Open price is the High Price. It means there is no upper wick. So there is no buying pressure, since the opening of the candle, sellers are in force and pulls down the price to a closing.
This strategy generates the signal at the close of the candle (technically barstate.isconfirmed). Because until the bar is real-time there is no option to know the final closing or high. So you will see the bar on which it generates the buy or sell signal is actually indicates the previous bar as OLH bar.
To determine the Stop-Loss, it uses the most widely known SL calculation of:
For buy signal, it takes the low of the last 7 candles and substract the ATR (Average True Range) of 14-period.
For sell signal, it takes the high of the last 7 candles and add it to the ATR (Average True Range) of 14-period.
One can plot the SL lines as dotted green and red lines as well to see visually.
Default Risk:Reward is 1:2, Can be customizable.
What is Unique?
Of course the utter simplistic nature of this strategy is it's key point. Very easy and intuitive to understand.
There are awesome strategies in this forum that talks about the various indicators combinations and what not.
Instead of all this, in a 15m NSE:NIFTY chart, it generates a good ~ 47% profit-factor with 1:2 Risk Reward ratio. Means if you loose a trade you will loose 1% of account and if you win you will gain 2%. Means 3 trades (2 profits and 1 loss) in a trading session result 3% overall gain for the day. (Assuming you are ready with 1% draw down of your account per trade, at max).
Disclaimer:
This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
Trend Breakout high/low #1What is the Trend Breakout high/low #1?
This script uses the high/low of each fixed time period as a conditional judgment, and when the high/low is broken as a buy/sell signal, trying to capture a trend.
How to use this script?
Start date and Stop date: You can choose the date of the test.
Trading cycle: Selected time period is used as the basis for determining the high/low and is limited to one trade only.
Stop range: This value will calculate the stop loss range. Set 50-100 that is better
Fixed mode: Fixed of lots per transaction.
---Additional Functions---
Reversal mode: Reversing the buy and sell signals, may be useful in certain situations.
Wighted mode: Increased profitability under certain conditions
When win & When lose:Judgment when there is an ongoing loss/profit as a condition, may be useful in certain situations.
Use closing price: Use the closing price breakout high/low as a conditional judgment, but this function sometimes fails.
Notes:
Trading cycle and your chart time period can't be set too close,that will result repainting.
Stop range can't be set too small,that will result repainting either.
RSI with Slow and Fast MA Crossing Strategy (by Coinrule)This strategy utilises 3 different conditions that have to be met to buy and 1 condition to sell. This strategy works best on the ETH/USDT pair on the 4-hour timescale.
In order for the strategy to enter the trade, it must meet all of the conditions listed below:
ENTRY
RSI increases by 5
RSI is lower than 70
MA9 crosses above MA50
To exit a trade, the below condition must be met:
EXIT
MA50 crosses above MA9
This strategy works well on LINK/USDT on the 1-day timeframe, MIOTA/USDT on the 2-hour timeframe, BTC/USDT on the 4-hour timeframe, and BEST/USDT on the 1-day timeframe (and 4h).
Back-tested from 1 January 2020.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
EMA + Bullish Engulfing Candle Pattern StrategyHello Guys! Nice to meet you all!
This is my first open source script!
### Long Condition
1. Bullish Engulfing Candle
2. No doge Candle
3. Present volume should be bigger than the previous volume (20%)
4. Trend filter (with 2 EMAs)
### Close Condition
1. When trend Changes
2. When Bearish Engulfing Candle appears
###
No stop loss and take profit.
Heiken Ashi & Super TrendThis is one of my open source 1h strategies
It works on Binance: BTCUSDTPERP charts
This strategy involves two indicators
1. Heiken Ashi - a typical technical indicator to help highlight and clarify the current trend. This somehow allows the chart to ignore unnecessary fluctuations and make the trend more visible.
2.Super Trend - - One of the most common ATR-based indicators, the SuperTrend indicator is useful to help you catch big trends.
Buy entry conditions are as follows.
1. The Super Trend indicator running on the Heiken Ashi chart gives a buy signal.
2. Buy at the current market price and take profit at 1% of the normal k-line at this time.
Take profit
TP - 1%
Stop Loss
None
How to use Leverage in PineScriptI believe there are many friends who have been confused by the leverage problem of TradingView strategy, when backtesting, it is always unable to bring its own leverage, so it is impossible to do leverage sustained compounding, this key point, and many friends are looking forward to solve. In particular, the default_qty_value = 100, where 100 is the upper limit.
Here I have used the official RSI strategy for demonstration, using the qty to place orders. Through strategy.equity, leverage and close price, and rounding, directly calculate the specific number of contracts need to be opened.
I hope you can enjoy solving the leverage problem, and I look forward to your pointing out my problems and shortcomings to me. Thank you.
V Bottom & V Top Pattern [Misu]█ This indicator shows V bottom & V top patterns as well as potential V bottom & V top.
These V bottom & V top are chart powerful reversal patterns.
They appear in all markets and time-frames, but due to the nature of the aggressive moves that take place when a market reverses direction, it can be difficult to identify this pattern in real-time.
To address this problem, I added potential V pattern as well as the confirmed one.
█ Usages:
You can use V top & V bottoms for reversal zones.
You can use it for scalping strategies, as a main buy & sell signal.
Potential V patterns can be used to anticipate the market, in addition to volatility or momentum indicators, for example.
█ How it works?
This indicator uses pivot points to determine potential V patterns and confirm them.
Paramaters are available to filter breakouts of varying strengths.
Patterns also have a "max number bars" to be validated.
█ Why a Strategy type indicator?
Due to the many different parameters, this indicator is a strategy type.
This way you can overview the best settings depending on your pair & timeframe.
Parameters are available to filter.
█ Parameters:
Deviation: Parameter used to calculate parameters.
Depth: Parameter used to calculate parameters.
Confirmation Type: Type of signal used to confirme the pattern.
> Mid Pivot: pattern will confirm on mid pivot breakout.
> Opposit Pivot: pattern will confirm on opposit pivot breakout.
> No confirmation: no confirmation.
Lenght Avg Body: Lenght used to calculate the average body size.
First Breakout Factor: This factor multiplied by the "body avg" filters out the non-significant breakout of potential V pattern.
Confirmation Breakout Factor: This factor multiplied by the "body avg" filters out the non-significant breakout for the confirmation.
Max Bars Confirmation: The maximum number of bars needed to validate the pattern.
ETH Climber Snake [ETHUSDT 60MIN]BEST PERFORMANCE: FTX:ETHUSDT 6H timeframe
The concept of Climber Snake is to detect the uptrend first and then take the advantage of each correction while the price is rising, while it hold during the bearish trend.
I'm using SAR indicator to detect the trend and Smooth HA Candles MTF v1 indicator made by @RafaelZioni to detect the correction waves
"NoSKi Hammer/Star /w angle of ema Backtester % Applied the angle of ema filter to stars formed in an uptrend, and hammers in a downtrend to try to pick good trading entries
Uses the average angle of the ema over the last 20 bars
(Please note: the angle calculation default value is calibrated for BTCUSD . There is no way currently to code it to be used across multiple pairs. The price to bar ratio has to be adjusted for other trading pairs. Please research price to bar ratio if unfamiliar). I have used a rough calculation so it can be used on other charts but won't be 100% accurate
Strategy uses % take profit and stop loss settings, and only enters one trade at a time (wont show entry if already in a position).
Separate ATR settings for filtering the size of hammer and star candles. (can filter out candles which are too large or small)
Red background colour is for when ema is at or below the set -ve angle slope. Green is for positive angle. Default is set at -45 and 45 degrees.
Big thankyou to ZenAndTheArtOfTrading for hammer and star coding, and Cosmic Angle - by cosmic_indicators for calculating the angle of emas.
Code was borrowed and used directly from these scripts.
Three EMAs Trend-following Strategy (by Coinrule)Trend-following strategies are great because they give you the peace of mind that you're trading in line with the market.
However, by definition, you're always following. That means you're always a bit later than your want to be. The main challenges such strategies face are:
Confirming that there is a trend
Following the trend, hopefully, early enough to catch the majority of the move
Hopping off the trade when it seems to have run its course
This EMA Trend-following strategy attempts to address such challenges while allowing for a dynamic stop loss.
ENTRY
The trading system requires three crossovers on the same candle to confirm that a new trend is beginning:
Price crossing over EMA 7
Price crossing over EMA 14
Price crossing over EMA 21
The first benefit of using all three crossovers is to reduce false signals. The second benefit is that you know that a strong trend is likely to develop relatively soon, with the help of the fast setup of the three EMAs.
EXIT
The strategy comes with a fixed take profit and a volatility stop, which acts as a trailing stop to adapt to the trend's strength. That helps you get out of the way as soon as market conditions change. Depending on your long-term confidence in the asset, you can edit the fixed take profit to be more conservative or aggressive.
The position is closed when:
The price increases by 4%
The price crosses below the volatility stop.
The best time frame for this strategy based on our backtest is the 4-hr. Shorter timeframes can also work well, although they exhibit larger volatility in their returns. In general, this approach suits medium timeframes. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange.
Optimised RSI strategy for Reversals (by Coinrule)The most common way to use the RSI to spot a good buy opportunity is to check for values lower than 30. Unfortunately, the RSI can remain in oversold territory for long periods, and that could leave you trapped in a trade in loss. It would be appropriate to wait for a confirmation of the trend reversal.
In the example above I use a short-term Moving Average (in this case, the MA9) coupled with an RSI lower than 40. This combination of events is relatively rare as reversal confirmations usually come when RSI values are already higher. As unusual as this setup is, it provides buy-opportunities with much higher chances of success.
The parameters of this strategy would be:
ENTRY: RSI lower than 40 and MA9 lower than the price
TAKE PROFIT and STOP-LOSS with a ratio of at least 2. That means that if you set up a take profit of 3%, your stop-loss shouldn’t be larger than 1.5%.
The advantage of this approach is that it has a high rate of success and allows you the flexibility of setting up the percentages of the take profit and stop-loss according to your preferences and risk appetite.
BTC WaveTrend R:R=1:1.5In this strategy, I used Wavetrend indicator (Lazy Bear).
It is very simple and easy to understanding: Long when Wavetrend1 crossover Wavetrend2 and they are less than a limit value (not buy when price overbought). Stoploss at lowest 3 bar previous. R:R = 1:1,5.
About other shortterm strategies for crypto market, you can view my published strategies.
Saturday Strategy BTC By KziI take the hypothèse that saturday is the most stable day of the week because, no SP500, no fed announcement and no weekly closure.
My Strategy is very simple:
Take the friday color (Red = Short // Green = Long)
Then open at the friday close price
Take a small pourcentage (1 or 2 %) then close.
What ever close on midnight.
Work Well on the 1h chart.
The Yellow is the saturday.
Maybe we can add the monthly close information to avoid opening trade on saturday if we are at this event.
Enjoy and give me your comment.
Kzi
Wick Reversal Hi the given strategy is based on detecting hammer and shooting star patterns to trade early reversals.
Strategy LinReg ST@RLStrategy LinReg ST@RL
Strategy LinReg ST@RL is a visual trend following indicator.
It is compiled in PINE Script Version V5 language.
This indicator/strategy, based on Linear Regression Calculation, is intended to help beginners (and also the more experienced ones) to trade in the right direction of the market trend and test strategy. It allows you to avoid the mistakes of always trading against the trend.
Strategy based on an original idea of @KivancOzbilgic (SuperTrend) and DevLucem (@LucemAnb) (Lin Reg ++)
A special credit goes to - KivancOzbilgic and @LucemAnb which inspired me a lot to improve this indicator/Strategy.
This indicator can be configured to your liking,according to your needs or your tastes.
The indicator/Strategy works in multi time frame.
The settings (length, offset, deviation, smoothing) are identical for all time frames if “Conf Auto” is not checked.
In this case the default settings (time frame=H1 settings) apply for all time frames.
The choice of source setting is common for all time frames.
If “Auto Conf” is checked,
then the settings will be optimized for each selected time frame (1m-3m H2 H3 H1 H4 & Daily). Time frames, other than 1m-3m H2 H3 H1 H4 & Daily will be affected with the default settings corresponding to the H1 time frame and will therefore not be optimized! The default setting values of each time frame (1m-3m H2 H3 H1 H4 & Daily) can be configured differently and optimized by you.
REVERSAL mode: Signal Buy=Sell and Signal Sell=Buy.
This option may be better than the regular strategy. Default mode is Reversal option.
Note that only for 1m (1 minute) Time frame, the option REVERSAL is opposite as default choice in configuration. (If reversal option is checked, then option for time frame 1m is not reversal!)
Trend indications (potential sell or buy areas) are displayed as a background color (bullish: green or bearish: red), assume that the market is moving in one direction.
You can tune the input, style and visibility settings to match your own preferences or habits.
Label Info (Simple or Full) gives trend info for each Exit (or current trade)
The choice of indicator colors is suitable for a graph with a "dark" theme, which you will probably need to modify for visual comfort, if you are using a "Light" mode or a custom mode.
This script is an indicator that you can run on standard chart types. It also works on non-standard chart types but the results will be skewed and different.
Non-standard charts are:
• Heikin Ashi (HA)
• Renko
• Kagi
• Point & Figure
• Range
As a reminder: No indicator is capable of providing accurate signals 100% of the time. Every now and then, even the best will fail, leaving you with a losing deal. Whichever indicator you base yourself on, remember to follow the basic rules of risk management and capital allocation.
BINANCE:BTCUSDT
! Français !
Strategy LinReg ST@RL
Stratégie LinReg ST@RL est un indicateur visuel de suivi de tendance.
Il est compilé en langage PINE Script Version V5.
Stratégie basée sur une idée originale de @KivancOzbilgic (SuperTrend) et DevLucem (@LucemAnb) (Lin Reg ++) Un crédit spécial va à - KivancOzbilgic et @LucemAnb qui m'ont beaucoup inspiré pour améliorer cet indicateur/stratégie.
Cet indicateur/strategie, basé sur le calcul de régression linéaire, est destiné à aider les débutants (et aussi les plus expérimentés) à trader dans le bon sens de la tendance du marché et à tester la stratégie. Cela vous permet d'éviter les erreurs de toujours négocier à contre-courant.
Cet indicateur peut être configuré à votre guise, selon vos besoins ou vos goûts.
L'indicateur/Stratégie fonctionne sur plusieurs bases de temps.
Les réglages (longueur, décalage, déviation, lissage) sont identiques pour toutes les bases de temps si
« Conf Auto » n'est pas coché. Dans ce cas, les paramètres par défaut (intervalle de temps=paramètres H1) s'appliquent à toutes les bases de temps.
Le choix du réglage de la source est commun à toutes les bases de temps.
Si "Auto Conf" est coché, alors les paramètres seront optimisés pour chaque base de temps sélectionnée (1m-3m H2 H3 H1 H4 & Daily). Les bases de temps, autres que 1m-3m H2 H3 H1 H4 & Daily seront affectées par les paramètres par défaut correspondant à la base de temps H1 et ne seront donc pas optimisées ! Les valeurs de réglage par défaut de chaque période (1m-3m H2 H3 H1 H4 & Daily) peuvent être configurées différemment et optimisées par vous.
Mode REVERSAL : Signal Achat=Vente et Signal Vente=Achat. Cette option peut être meilleure que la stratégie habituelle. Le mode par défaut est l'option REVERSAL.
Notez que seulement pour la base de temps de 1m (1 minute), l'option REVERSAL est l’opposée du choix par défaut dans la configuration. (Si l'option REVERSAL est cochée, alors l'option pour la base de temps 1 m n'est pas REVERSAL !)
Les indications de tendance (zones potentielles de vente ou d'achat) sont affichées en couleur de fond (haussier : vert ou baissier : rouge), supposons que le marché évolue dans une direction. Vous pouvez ajuster les paramètres d'entrée, de style et de visibilité en fonction de vos propres préférences ou habitudes.
Les informations sur l'étiquette (simples ou complètes) donnent des informations sur de chaque clôture (ou position en cours)
Le choix des couleurs des indicateurs est adapté à un graphique avec un thème "sombre", qu'il vous faudra probablement modifier pour le confort visuel, si vous utilisez un mode "Clair" ou un mode personnalisé.
Ce script est un indicateur que vous pouvez exécuter sur des types de graphiques standard. Cela fonctionne également sur les types de graphiques non standard, mais les résultats seront faussés et différents.
Les graphiques non standard sont :
• Heikin Ashi (HA)
• Renko
• Kagi
• Point & Figure
• Range
Pour rappel : Aucun indicateur n'est capable de fournir des signaux précis 100% du temps. De temps en temps, même les meilleurs échoueront, vous laissant avec une affaire perdante. Quel que soit l'indicateur sur lequel vous vous basez, rappelez-vous de suivre les règles de base de la gestion des risques et de l'allocation du capital.
Perfect OrderEntry Point
How to Entry
Perfect Order Entry
SMA5,13,21 & EMA75,90,200
Please enjoy your entry
Golden Swing Strategy - Souradeep DeyThis strategy is developed by Mr. Souradeep Dey. Strategy is based on RSI, Stoch, BB & Supertrend.
Coding by Rajkumar
SIMPLE CANDLESTICK PATTERN ALGO BACKTESTING - TESLA 4HMany traders spend a lot of time to create algorithms full of unrealistic and far from reality indicators and market conditions. With this script I want to help traders understand the advantage of the Pine language. Using indicators with no statistical foundation and creating algorithms with technical indicators and thousands of conditions is not always the right way to create an efficient tool.
With this script that we have called "SimpleBarPattern_LongOnly" we analyse the market through a simple condition, using bars or candles.
How it works
The condition is constructed as follows. You go long with 100% of the established capital and 0.03% commission. The first condition is that the minimum of the period under analysis falls below the opening level. The second condition is that the low of the period is below the low of the previous period. The third condition is that the close of the period is above the opening level. The final condition wants the current close to be higher than the previous open and higher than the previous close. We used a statistical approach in the creation of this script, some candlestick patterns that reflect these conditions are: Bullish Engulfing, Bullish Hammer and Morning Star .
This strategy aims to help traders make more accurate decisions while using candlesticks for their trading and scientifically demonstrates that candlesticks are valid statistical tools for financial analysis.
"SimpleBarPattern_LongOnly" is a very lightweight script created with Pine v5. We developed a user interface that can adjust the analysis period from a few days to several years.
The initial capital set is €1,000 (You can change this from the "Properties" section of the user interface).
Each individual trade uses 100% of the set capital, in this case €1,000.
The default commission per trade is 0.03% (You can change this in the "Properties" section of the user interface).
User Interface
1) General backtest time settings: Set the history period to be analysed
StartDate: backtest start date
StartMonth: backtest start month
StartYear: backtest start year
EndDate: backtest end day
EndMonth: backtest end month
EndYear: backtest end year
3) Stop Loss
4) Take Profit
Please do not hesitate to contact us for any questions or information.
Disclaimer
Be careful, the past is not a guarantee of future performance, so remember to use the script as a pure analysis tool. The developer takes no responsibility for any use other than research and analysis and can in no way be held liable for damages resulting from wrong use of this code.