Pivot Point V2 Backtest Pivot points simply took the high, low, and closing price from the previous period and
divided by 3 to find the pivot. From this pivot, traders would then base their
calculations for three support, and three resistance levels. The calculation for the most
basic flavor of pivot points, known as ‘floor-trader pivots’, along with their support and
resistance levels.
WARNING:
- For purpose educate only
- This script to change bars colors.
Análisis de tendencia
Breakout Trend Follower StrategyThis strategy goes long when highs are broken and uses a trailing stop that follows swing lows. User can configure a back test date range and choose whether or not to only take trades above a selected moving average.
The desire for me to make this script was to try to capture those extreme breakouts that can occur after a consolidation/equilibrium pattern. This catches those using stop-buys as the entry. Out of all the scripts I have made thus far, this one is the one that has the best results. Time frames might vary due to commission structures, etc. I currently use this strategy on stocks on the 30-min time frame and crypto (with Coinbase's high fees) on the 2-hr time frame.
ADX | DMI Trend StrategyThis strategy takes the ADX Indicator I wrote and applies it to a strategy for back testing purposes.
I've also applied a date filter so you can back test specific date ranges and a moving average filter so you can choose whether to filter your longs/shorts based on a moving average.
WOMBO COMBO: EMA & VWAP & MACD & BB & STCHello my fellow investors,
After hours of reading, backtesting, and YouTube video watching I discovered that EMA, VWAP, BB, MACD, and STC produce the most consistent results for investment planning. This strategy allows you to pick between the aforementioned indicators or layer them together.
It works on the pricipal of:
1) Always follow the market trend - buy/sell above/below 200EMA
2) Follow corporate investing trends - buy/sell above/below VWAP
3) Apply MACD check - buy--> MACD line above signal line and corssover below histogram \\ sell --> MACD line below signal line and crossover above histogram.
4) Check volitility with price against BB limits upper/Sell or lower/buy
5) When STC crosses about 10 buy and when it drops below 90 sell
6) Exit position when stop loss is triggered or profit target is hit. BB also provides a parameter to exit positions.
This code is the product of many hours of hard work on the part of the greater tradingview community. The credit goes to everyone in the community who has put code out there for the greater good.
MACD Cross+MAStrategy MACD cross + Ma cross
การเข้าจะเข้าต่อเมื่อมีการ Cross ของ MACD ก่อน แล้วมีการ Cross ของเส้น ma 9,26 ตามมา
จากการ Backtest ของผมถือว่าเป้น Indicator ที่ค่อนข้างบอกให้เข้าช้าเลยทีเดียว แต่ใช้ Follow เทรนพอใช้ได้อยู่ครับ
แนะนำให้ใช้ในช่วงที่ตลาดเป็นขาขึ้นนะครับ ช่วงหมียาวอย่างปี 2018 Indicator ตั้วนี้ไม่เวิร์คอย่างแรงเลยครับ
ในภาพ backtest ตั้งแต่ปี 2019 - ปัจจุบันนะครับ
ใช้ใน TF Day จะเห็นผลดีที่สุด
Trend Reversal / Potential pressureThis strategy looks for potential trend reversals by looking at hammer candles (defined in the is_hammer and is_stick functions). After getting confirmation a trade is open with determined SL/TP. ATR is used to justify the volatility. Fine-tune the parameters for your specific use case.
RSI W Pattern strategyThis strategy is similar to RSI V pattern strategy, but it looks for W pattern in RSI chart.
RULES
======
BUY
1. ema20 is above ema50
2. RSI5 crossing up 30 from oversold area
3. and RSI5 must be below overbought area (default value set to 65)
Add to existing Position
1. You can add on the next W pattern OR
2. if RSI5 is crossing up from below 20
Exit
1. when RSI5 reaches 75
Note: This is for short term/swing trading . which gets on when price dip in trending and quickly gets you out on RSI overbought area
cATRpillar Strategy**This is my first strategy on the Pine editor, any tips or tricks from the community would be awesome!
This strategy was developed from my indicator "cATRpillar". it uses the ATR range values to determine entry, and uses EMA values to determine an exit if the market goes against it.
Highest High and Lowest Low Channel StrategyHighest / Highest High Highest (Data) - HHV (Data, Period)
Lowest / Lowest Low Lowest (Data) LLV (Data, Period)
These functions calculate the highest / lowest value of a selected data.
Highest High and Lowest Low options are mostly used.
The Highest function calculates the highest value of the selected data in the past.
The Lowest function calculates the lowest value of the selected data in the past.
RSI Divergence X Ichimoku Cloud X 200EMAHi all,
This script is a combination of the RSI Divergence Strategy combined with Ichimoku Cloud and 200 EMA .
A long position is entered only when the RSI identifies a bullish divergence (either regular or hidden), and that the Ichimoku Cloud is above the 200 EMA . This is to ensure that there is a confirmation of a bullish trend before an entry.
Similarly, a short position is entered only when the RSI identified a bearish divergence (either regular or hidden), and that the Ichimoku Cloud is below the 200 EMA . This is to ensure that there is a confirmation of a bearish trend before an entry.
I find that this script works best on Intraday charts.
This is just a simple script I built on my third attempt of backtesting strategies on TradingView. Do give it a go and let me know if you guys have any feedback or comments about it. Happy trading!
STRATEGY:RETRACEMENTThis is a basic script meant to help you identify Fibonacci Retracement Levels. Based on the high and low lookback periods you input, it will draw lines for the highest high and lowest low for those times as well as the Fibonacci Retracement Levels in between.
Combo Backtest 123 Reversal & Elder Ray (Bear Power) This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Developed by Dr Alexander Elder, the Elder-ray indicator measures buying
and selling pressure in the market. The Elder-ray is often used as part
of the Triple Screen trading system but may also be used on its own.
Dr Elder uses a 13-day exponential moving average (EMA) to indicate the
market consensus of value. Bull Power measures the ability of buyers to
drive prices above the consensus of value. Bear Power reflects the ability
of sellers to drive prices below the average consensus of value.
Bull Power is calculated by subtracting the 13-day EMA from the day's High.
Bear power subtracts the 13-day EMA from the day's Low.
You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...
WARNING:
- For purpose educate only
- This script to change bars colors.
Noro's Donchian StrategyThe strategy uses Donchian price channel . The channel is shown in blue lines. All other lines use Donchian channel too. The red line is the center line between the channel lines. The lime line is a few percent further away. The percentage is set by the user in the strategy settings.
Lines
Blue line - to open position using market stop order
Lime line - take-profit (limit order)
Red line - stop-loss (market stop order, trailing-stop)
For
- BTC /USD, XBT/USD, ETH/USD (need USD)
- timeframe: 1h or 4h
EMA Slope Trend Follower StrategyThis strategy is based on the slope of the EMA130.
Over that slope, the script calculates two EMAs (9,21) which are used to generate the main entry and exit signal.
In particular, the strategy enters a LONG position when EMA9 > EMA21. On the contrary, it closes the LONG and opens a SHORT when EMA9 < EMA21.
When the slope of the EMA130 is rising, it means that the price is accelerating upwards, fueling an uptrend. Conversely, when the slope is falling, it means that the price is slowing down, falling into a possible downtrend.
Calculating and analyzing two EMAs (fast and slow) over the slope of a medium length EMA instead of the price anticipates a lot the signal. In this way, the strategy never miss a trend.
In order to minimize false positives (entering useless positions), I included two filters, which can be optionally turned on:
- Trend Filter: When the price is above EMA200, the strategy opens ONLY LONG positions. If price < EMA200, only shorts allowed. If the slope gives a long signal and price is below EMA200, for example, the eventual SHORT position is closed, but the LONG entry is postponed to the moment when both conditions (slope uptrending and price > ema200) are met.
I recommend always turning on this filter, as it dramatically decreases drawdown.
- Volatility Filter: When the standard deviation of the last 20 candles is below its 50 samples moving average, no positions are opened, as market is going sideways. The purpose of this filter is to prevent false positives (positions which open and close in a matter of candles due to false signals in sideways market).
I recommend turning on this filter only on low time frames.
This strategy works great on medium time frames (like 4h, 6h, daily), since it spends way less in fees, opening less positions.
It works good on low TFs too (up to 1h, didn't test lower ones), provided Volatility filter is turned on and parameters are set according to the asset.
Commission included in calculations: 0.06% (it's the taker commission on BitMEX with the 10% discount obtainable with any referral link)
Slippage included in calculations: 2 ticks (BitMEX has very liquid order books, and slippage doesn't happen very often unless a huge position size is used).
RSI5_50 with DivergenceThis is variation of RSI Divergence strategy.
I have added a filter (long term RSI) to the Rules. strategy BUYs when RSI 50 period is above 50 line and there is divergence on the short term RSI
settings
=========
short term RSI period 5
long term RSI period 50
stopLoss is 8% --- if setting is enabled
BUY Rule
========
RSI 50 is above 50 line
short term RSI is showing divergence
Add to existing
==============
if already in position, BUY when shorTermRSI is crossing above 20
TakeProfit
=========
when longTermRSI reaches 60,65, 70 and 75 level , take partial profits .
(not when crossing down --- This may affect on profits , because when price goes down , it goes very fast )
Exit
=====
when longTermRSI is crossing down 30
OR stopLoss value hits
Note: When I tested this with GOOGL stock , I have got excellent results ... any experts there , please check everything is good with scripting ...
Happy Trading
Ichimoku Cloud Strategy v2.0Trend following trading strategy “Ichimoku Crossover” is a popular Ichimoku trading strategy that uses the cloud and crossover of two base lines to define the market reverse point. Ichimoku crossover trading strategy has appeared to be a profitable trading strategy.
The indicator has 5 base lines and to read Ichimoku indicator it is required to understand the meaning of these lines first of all:
Tenkan-Sen line, also called the Conversion Line, represents the midpoint of the last 9 candlesticks . It is calculated with the following Ichimoku formula: .
Kijun-Sen line, also called the Base Line, represents the midpoint of the last 26 candlesticks . It is calculated with the following formula: .
Chiou Span, also called the Lagging Span, lags behind the price (as the name suggests). The Lagging Span is plotted 26 periods back.
Senkou Span A, also called the Leading Span A, represents one of the two Cloud boundaries and it’s the midpoint between the Conversion Line and the Base Line: . This value is plotted 26 periods into the future and it’s the faster Cloud boundary.
Senkou Span B, or the Leading Span B, represents the second Cloud boundaries and it’s the midpoint of the last 52 price bars: . This value is plotted 52 periods into the future and it is the slower Cloud boundary.
Trading with Ichimoku is very simple.
The Conversion Line needs to break above the Base Line. This will be a buy signal.
For a bearish (sell) signal a trader should wait for the Conversion line crosses the Base line downwards it is a sell signal.
SupterTrend I created this script for basically two reasons
1. there is not simple suptertrend indicator available on tv rather you will find many fancy suptrend indicators with confusing other indicators and absurd background colors i dont know why some of the trader coders are obsessed with is using over the top color and designing phenomena.
2. I want to let people know about the accuracy of suptertrend indicator on multiple time frames i am plaining to create a backtesting tool for almost all Famous indicators so that specially new folks know what should they expect from any particular Indicator
Also i added intraday filter to check the results for intrday signals . the sqaure off timings are for Indian markets only but you can edit the hours and minutes in the code for using other than indian markets. No need to do anything if you only want positional trading trading results
RSI V Pattern strategyThis strategy based on RSI for swing trading or short term trading
Strategy Rules
=============
LONG
1. ema20 is above ema50 --- candles are colored green on the chart
2. RSI value sharply coming up
previous candle1 low is previous candle2 low and previous candle1 RSI value is less than previous candle2
current candle RSI value is greater than previous candle1 and crossing above 30
above which makes a V shape on RSI indicator, colored in yellow on the chart , price bar is colored in yellow
3. Enter Long when the above V pattern occurs
EXIT LONG
1. when the RSI reaches 70 , close half position and move stop loss to up
2. when RSI reaches high value 90, close 3/4 position
3. when RSI crossing below 10 OR stopLoss hit , whichever happens first , close whole position
Note : take profit levels are colored in blue on RSI and Price candles
I have tested SPY , QQQ on daily chart , performance results are with 80% win rate and more than 3 profit factor
Happy Trading
Fibonacci + RSI - StrategyStrategy: Fibonacci + RSI:
- Intraday trading strategy (Scalping).
Time Frames Tested with best Results:
30 Minutes.
5 Minutes.
15 Minutes.
1 Minute
Indicators Used:
RSI (30 / 70)
Fibonacci (1 - 0.784)
How it Works:
Once the Price Hits the 1 or -1 Fibonacci Level and bounces a little bit, It checks the RSI if Over Bought or Over Sold According to 30 - 70.
If both conditions are satisfied, it triggers a Long or Short Positions.
Further Notes:
- I have put a Stop-loss with a 2% just for further upgrades.
- Not advised to use in High Volatility Markets.
- No Repaint was observed during a 2-Weeks Tests.
If you have any suggestions or modifications please contact to add.
If you have observed any bad behavior please contact to fix.
Trade wisely.
KD compare strategy (交易策略對照組)This is a base and easy trading strategy for comparing my other strategy.
The strategy consider K >= 80 is strong target in the last high period,
and consider K <=20 is the weak target in the last low period.
In the strong target, the strategy may increase long at the first day when K < 50, until 2/3 max order limitation or strong target become to weak.
In the weak target, the strategy may increase short at the first day when K > 50, until 2/3 max order limitation or strong target become to strong.
there are three orders for this strategy.
when the strong become to weak, it may use the remain 1/3 to save itself, and change the direction at the next k > 50
when the weak become to weak, it may use the remain 1/3 to save itself, and change the direction at the next k < 50
這是一個簡單的雙向交易策略,用來對照我其他的策略。
當 K>=80 它會認為目前是強勢股,偏多操作
當 K<=20 它會認為目前是強勢股,偏空操作
當標的為強勢股時,當第一次 K<50 會加碼多單,最多買進2/3的持股,直到轉弱
當標的為弱勢股時,當第一次 K>50 會加碼空單,最多買進2/3的持股,直到轉強
當強勢轉弱勢時,會使用剩下的1/3來拯救持股,在下次 k > 50 出清持股
當弱勢轉強勢時,會使用剩下的1/3來拯救持股,在下次 k < 50 出清持股
BTC and ETH Long strategy - version 1I will start with a small introduction about myself. I'm now trading cryto currencies manually for almost 2 years. I decided to start after watching a documentary on the TV showing people who made big money during the Bitcoin pump which happened at the end of 2017.
The next day, I asked myself "Why should I not give it a try and learn how to trade".
This was in February 2018 and the price of Bitcoin was around 11500USD.
I didn't know how to trade. In fact, I didn't know the trading industry at all.
So, my first step into trading was to open an account with a broken. Then I directly bought 200$ worst of BTC . At that time, I saw the graph and thought "This can only go back in the upward direction!" :)
I didn't know anything about Stop loss, Take profit and Risk management.
Today, almost 2 years after, I think that I know how to trade and can also confirm that I still hold this bag of 200$ of bitcoin from 2018 :)
I did spend the 2 last years to learn technical analysis , risk management and leverage trading.
Today (14/05/2020), I know what I'm doing and I'm happy to see that the 2 last years have been positive in terms of gains. Of course, I did not make crazy money with my saving but at least I made more than if I would have kept it in my bank account.
Even if I like trading, I have a full time job which requires my full energy and lots of focus, so, the biggest problem I had is that I didn't have enough time to look at the charts.
Also, I realized that sometimes, neither technical analysis , nor fundamentals worked with crypto currency (at least for short time trading). So, as I have a developer background I decided to try to have a look at algo trading.
The goal for me was neither to make complex algos nor to beat the market but just to automate my trading with simple bot catching the big waves.
I then started to take a look at TV pine script and played with it.
I did my first LONG script in February 2020 to Long the BTC Market. It has some limitations but works well enough for me for the time being. Even if the real trades will bring me half of what the back testing shows, this will still be a lot more than what I was used to win during the last 2 years with my manual trading.
So, here we are! Below you will find some details about my first LONG script. I'm happy to share it with you.
Feel free to play with it, give your comments and bring improvements to it.
But please note that it only works fine with the candle size and crypto pair that I have mentioned below. If you use other settings this algo might loose money!
- Crypto pairs : XBTUSD and ETHXBT
- Candle size: 2 Hours
- Indicator used: Volatility , MACD (12, 26, 7), SMA (100), SMA (200), EMA (20)
- Default StopLoss: -1.5%
- Entry in position if: Volatility < 2%
AND MACD moving up
AND AME (20) moving up
AND SMA (100) moving up
AND SMA (200) moving up
AND EMA (20) > SAM (100)
AND SMA (100) > SMA (200)
- Exit the postion if: Stoploss is reached
OR EMA (20) crossUnder SMA (100)
Here is a summary of the results for this script:
XBTUSD : 01/01/2019 --> 14/05/2020 = +107%
ETHXBT : 01/01/2019 --> 14/05/2020 = +39%
ETHUSD : 01/01/2019 --> 14/05/2020 = +112%
It is far away from being perfect. There are still plenty of things which can be done to improve it but I just wanted to share it :) .
Enjoy playing with it....
Strategy TimeframeHello!
Until now, it was among all my strategy codes, but I wanted to share it alone. You can use this code to see strategy results or indicator results within a specific date range. It will be sufficient to add window() condition to the trading or alarm conditions. If time information is also important, you can change the Timestamp interval in the code.
Türkçe
Şimdiye kadar tüm strateji kodlarım arasında bulunuyordu fakat tek başına paylaşmak istedim. Strateji sonuçlarını ya da indikatör sonuçlarını belirli bir tarih aralığında görmek için bu kodu kullanabilirsiniz. Alım-satım ya da alarm koşullarına window() şartını da eklemeniz yeterli olacaktır. Saat bilgisi de önemli ise kod içerisindeki Timestamp aralığını değişebilirsiniz.