Fitting patterns to your bias? I saw a post in twitter which marked a particular converging triangle on BTCUSDT chart on 4H timeframe (As shown below) and implying more bearishness ahead. But, is it really correct analysis?
Risk of drawing patterns manually is that we can fit any pattern to price action based on our bias. To overcome this, we need to follow a standard method to draw patterns on chart. Below is my algorithm for drawing patterns.
Draw zigzag on chart
Find and draw a trend line joining 2 or more pivot lows where price has not breached the trend line towards downside.
Find and draw a trend line joining 2 or more pivot highs where price has not breached the trend line towards upside.
While drawing, trend lines can touch the pivot candle at any point. But, candles should not lie outside trend line.
Take fake outs into consideration to make minor adjustments.
At least one among the above trend line should join 3 or more pivots. Another one can have just two pivots.
Do you see clear pattern after following these steps? If yes, then you found your pattern and also a skill to define them objectively without bias.
Hewhomustnotbenamed
How to draw trend lines in objective (algorithmic) wayHello everyone,
In this video, we explore how to draw trend lines in more subjective and algorithmic way.
Problem with drawing trend lines manually are
Subjective and may be influenced by personal factors
Easy to fit on historical data based on our biases.
Chances of overfitting to confirm our biases/ideas.
We can avoid these drawbacks by using an algorithmic method to achieve the same.
I have also developed several scripts which can help achieve this automatically. Users can refer to them for learning and practicing. Few of them are:
Auto TrendLines
Wedge and Flag Finder (Multi - zigzag)
Trendline Pairs (Deep Search)
Coming back to process of drawing trend lines manually, here are the steps.
Use and apply any zigzag indicator on the chart. In the demonstration, we have used Recursive Zigzag
Draw lines which joins more than 2 pivot lows for lower trendline and more than 2 pivot highs for higher trend line.
Make sure from starting pivot to ending pivot, price has not broken trendline convincingly, there can be rejections (touches) or fakeouts (just one or two bars outside trend line)
Higher number of candles touching the trendline, higher the strength of trend line.
If both higher and lower trend lines can be established, we can identify it as pattern - which can be triangles, wedges, channels etc.
Use different levels and lengths of zigzag to find different combinations. And then zero down to best possible pattern or use them in confluence.
Hope it was helpful and please let me know if you have any questions.
HOW-TO: Auto Harmonic Pattern - BacktesterHi All,
Here is a short video on how to use Auto-Harmonic-Pattern-Backtester-Trendoscope for building strategies using harmonic patterns.
CAUTION: THIS IS NOT A STRATEGY AND SHOULD NOT BE FOLLOWED BLINDLY. WE ENCOURAGE USERS TO UTILISE THIS AS BACKTESTING TOOL FOR BUILDING THEIR STRATEGY BASED ON HARMONIC PATTERNS
Notes about Strategy Properties
Qty is percentage based and non leveraged. Since pattern size is not uniform, risk per trade is not uniform per trade as well.
Default pyramiding is set to 4 - which means not all patterns will have trade if number of open trades is already 4
Key Settings
Can be either long or short mode but not not both. This is due to pine limitations.
Entry, Stop and Target settings along with Base are important in defining your strategy.
External filters plays a major role in adding external elements to the strategy. This also enables users to build their own filters. More details in this video
Strategy based alerts are different than custom alerts defined in settings. Custom alerts will fire for every pattern whereas strategy alerts will only fire upon generated trade signals. More details about Alert customisation is explained here .
When setting alerts, please turn off displays - pattern drawing and tables. And also limit backtest to minimal bars.
Please let me know if you have further questions.
Using Harmonic Pattern with Trend Following SystemHarmonic Pattern as system is known for finding possible reversal zones and hence assist in swing trading. But, most effective way of using harmonic patterns is in trend following. This can yield really amazing results when played with proper risk management.
Conditions
In trending market
Established trend followed by pattern
Trade Settings
Enter on breaking out of pattern with 100% recovery
Exit can be placed at farther distance or can also use trailing stop after certain profit.
Need to be cautious on short trades as expectation of high risk reward may end up in negative territory. (Lowest price can be 0)
Advantages
Very high risk reward. Even with less number of wins, can get very high reward.
Less slippage and commission
Simple to trade and takes less human effort.
Disadvantages
Lower win ratio. (Does not impact profit)
Longer trades need more patience
HOW-TO: Wolfe Strategy [Trendoscope]Just made this short video to explain the concepts of Wolfe Strategy which I recently published.
Wolfe wave is popular concept among option traders. However, I have made some tweaks in this strategy to standard wolfe pattern trade rules.
Entry price based on breakout
No moving target - using flat target.
Entry is done based on risk reward
Not time bound
Intelligently decides whether to place stop order or limit order
Few possible future improvements
Make bidirectional trades possible
Better filters to chose long and short trades or when to trade
Lot can be improved on Wolfe scanner to identify more patterns
Exit strategy - can introduce optional trailing
Thanks for listening. Hope you enjoyed and learnt something from this :)
RepaintingHello All,
In this video - we discussed about what is repainting, different types of repainting, how we can identify them and some resources for programmers to avoid them programmatically.
Here are some quick resources for programmers:
www.tradingview.com
Please let me if there are further questions
HOW-TO: Auto Harmonic Patterns - UltimateX (Revised)Hello Everyone,
Here is a video on detailed settings guide to invite only script -
In this video, we discuss about:
* Few important settings and how to use them
* Few references to other tutorials for extended help
Also please refer to linked ideas about:
* How to customise alerts in Auto Harmonic scripts
* How to use external filters
Let me know if you have any questions.
HOW-TO : Auto Chart Patterns UltimateHello All,
I have made this video which covers briefly on following points for Auto-Chart-Patterns-Ultimate-Trendoscope
1. Indicator components
2. Detailed settings
3. Few key features
4. Info about trading different patterns included
I could not cover alerts in the video due to time constraints. But, alerts is same as that of HOW-TO-Customize-Alerts-in-Auto-Harmonic-Scripts
Let me know if you have any question. For trial access and subscription please look at the script page - 'Author's Instructions' section.
HOW-TO: Using Data Gathered in Divergence BacktesterHello Everyone,
Here is a small video describing the idea on studying divergence data based on divergence backtester script.
To understand further, you can study some of my older scripts on divergence. You can find them under my profile: www.tradingview.com
Filter only open source scripts so that you will see only free to use scripts with code available. This is not a fully fledged strategy. But, just means for studying the impact of divergence data on price action. Please let me know if you have any questions.
Using Zigzag to find patternsZigzag is my favourite technical indicator. Usage of zigzag is often misunderstood. People try to find tops and bottoms and complain that it repaints. Well, zigzag is supposed to repaint its last pivot and it should not be used finding tops and bottoms to enter and exit at the right time. Then, how do we use zigzags?
Main application of zigzag for me is pattern recognition. Just put zigzag on your chart and observe how easy it will become to identify patterns.
The chart below shows double bottom - confirmed by divergence on lower pivots and continuation on higher pivots (price, strength and volume are all making higher high). Having said that, we need to keep in mind the expectations of double bottom pattern and settle for appropriate risk reward.
How to create fully customisable alerts in pinescriptHi All,
As discussed in the video, below are the steps to define fully customisable alert templates and alerts in pine script. This is a generic idea which can be implemented for any script.
Step 1. What all parameters(keys) need to be sent in alerts.
Step 2. Create a default alert template
Step 3. Create a user input where users can alter the default alert template
Step 4. Define your alert condition.
Step 5. Calculate the values for all the keys
Step 6. In the template, replace all keys with values and send alert
Sample script developed during the video.
//@version=5
indicator("Fully Customizable Alerts", overlay=true)
import HeWhoMustNotBeNamed/RecursiveAlerts/2 as ra
//Step 1. What all parameters(keys) need to be sent in alerts.
keys = array.from("{entry}", "{stop}", "{target1}", "{target2}")
//Step 2. Create a default alert template
template = '{
\t"entry" : {entry},
\t"stop" : {stop},
\t"target1" : {target1},
\t"target2" : {target2}
}'
//Step 3. Create a user input where users can alter the default alert template
inputTemplate = input.text_area(template, 'Alert Template')
//Step 4. Define your alert condition.
ma = ta.sma(close, 20)
condition = ta.crossover(close, ma)
atr = ta.atr(14)
if(condition)
//Step 5. Calculate the values for all the keys
entry = high + atr
stop = low - atr
risk = entry - stop
target1 = entry + risk
target2 = entry + 2*risk
//Step 6. In the template, replace all keys with values and send alert
values = array.from(str .tostring(entry), str .tostring(stop), str .tostring(target1), str .tostring(target2))
alertMessage = ra.updateAlertTemplate(inputTemplate, keys, values)
alert(alertMessage, alert.freq_once_per_bar)
plot(ma, "Moving Average")
HOW-TO: Use external filters on Auto Harmonic Pattern UltimateXHello Everyone,
In this video, I have explained following things:
1. What is a filter indicator and how it can be used
2. Example demonstration of Relative Bandwidth Filter to define trade no-trade zones based on volatility.
3. How to use filters along with Auto Harmonic Pattern UltimateX or any other script which follows similar design for external filters.
4. How to develop your own filter based on different conditions which can be used with AHPUx or other scripts which are designed to use the Filters.
Please let me know if you have any questions.
Tutorial - Convert an indicator into strategy in pineHello Everyone,
I just made this video because, this question came up many times in Pine QA. In this video we are trying to load default Bollinger Band indicator from Tradingview and convert it into strategy.
Below are the steps
Load the indicator on chart
Click on source code (curly brackets next to indicator title) to load the code into your pine editor.
Make copy of the script. Remove the indicator on chart and load your copy of the script from pine editor
Replace indicator call with strategy call
Define your entry/exit conditions for long and short
Add strategy.entry, strategy.exit, strategy.close calls based on the conditions to generate trades on chart
Useful references
Pine Reference Manual
www.tradingview.com
Strategy template in the linked ideas.
Enjoy :)
Risk/Reward & probability calculation based on historical statsThere are two contracting triangles on the chart. Both broken downside. Now, lets see the historical results of trades based on contracting triangles on bearish side for BTC on daily chart
Based on this,
Probability of price reaching 25300 before hitting 42700 is 30-33%
Risk reward for the bearish side is 0.64
Probability of price reaching 18903 before 50736 is 58-60%
Risk reward for the bearish side is again 0.65
Hence, the inverse of it will be stats for long side.
Probability of price reaching 42700 before hitting 25300 is 67-70%
Risk reward for the bullish side is 1/0.64 = 1.56
Probability of price reaching 50736 before hitting 18903 is 58-60%
Risk reward for the bullish side is 1/0.65 = 1.53
Full chart below:
Which side you are going to chose for short term speculation :)
PLS - possible bull runHighlights
Regular deep pullbacks and recover to ATH
Consistency in number of days to reclaim ATH and extension to new ATH.
Broken downward trend line. Under the support of lower pivot trend line. Also broken last resistance derived from double hidden divergence.
Lastly, clear double bottom and broken neck line.
Time to recover back to ATH - historical glanceBrief glance on historical deep drawdowns and recovery timelines to ATH from BABA. Recovery time is generally slower and took 1.5 to 2 times more than going down.
Conclusion: Don't be in hurry to buy the dip. There will be enough time for recovery. Wait for better confirmations.
HOW-TO: Customize Alerts in Auto Harmonic ScriptsMaking this video on setting alert in the invite only scripts
Auto-Harmonic-Pattern-Ultimate-Trendoscope
Auto-Harmonic-Projection-Ultimate-Trendoscope
Auto-TrendLines-and-Support-Resistance-Ultimate-Trendoscope
For value placeholders, please visit the description and updates done in 11th and 12th Feb for Harmonic Pattern scripts. And 20th Feb for Auto Trendline script.
How to capture chart snapshot in tradingview-telegram alert botHello traders,
In the last video we learnt How to create simple web-hook to send alerts to telegram . In this tutorial, we will try to build a bit more on it and to also include chart snapshots along with plain alert messages.
Webhook code is updated in the replit repository here: replit.com
Once, setup, run the repl and capture base URL
⬜ Webhook API
Webhook post request URL format below:
https:///webhook?jsonRequest=&tblfmt;=&chart;=&loginRequired;=
jsonRequest - true/false. Set it to true only if you are sending alerts in the form of json. If set to true and the alert message is not in json format, it will throw error
tblfmt - Values taken from python library tabulate . Defines how to display the json message in tabular format. Applicable only if jsonRequest is true
chart - Chart URL from tradingview for which snapshot need to be captured
loginRequired - true/false. Use this only if you are using a private non shared chart for snapshot or if your chart contains invite only scripts which needs to be shown in the chart snapshot.
⬜ Capturing Chart URL
Note: Make sure you create different chart for different instruments which you are trying to get alert. Also make sure your chart is saved and all the indicators are in palce.
⬜ Testing on postman
⬜ Creating the alert
Fundamental and statistical analysis method - ExplainedHi All,
I have been asked by few in comments and personally to post fundamental analysis of few other companies in similar way as that of FB and PYPL (as per linked ideas). Since, I will not be able to take all the requests, I thought I will make a video explaining how to do it yourself :)
⬜ Following things are discussed in the video
🎲 Earnings
Not significant unless the gap is too much. Things to look for are:
If the recent earnings and revenue has met expectation/estimation
If the next earning/revenue estimates are higher/lower than current one.
Cyclical nature of quarterly earnings - check results and estimations of last two years of same quarter
🎲 Quality
Can use open source script Quality-Screen from community library.
Color coded based on standards and very generic method.
May also need to consider that some of these stats may be industry and sector based and may require comparison among similar stocks.
Overall - if green/lime good, if lots of red/orange - bad. Silver - in between.
🎲 Relative Growth
Can use open source script Relative-Growth-Screen from community library.
Applies Bollinger bands/ Keltener channel to define whether they are relatively high or low. Can also use RSI - but, have not tried :)
Measures growth over past few years.
🎲 Drawdown from ATH
Price drawdown from ATH and historical drawdown levels. Can use open source script Drawdown-Range from community library.
Tells what is the current price drawdown from ATH.
Provides details on historical drawdown levels and ranges.
🎲 Drawdown comparison - price vs fundamentals
Percentile-Price-vs-Fundamentals is the utility I built to carry out the comparison. I am not sure if there are any other comparable tools. Tool is useful for comparing if price drawdown is justified with the drop of fundamentals or if this is an overreaction.
⬜ Please note
▶ News events and probability of future potentials are not taken into consideration. Objective here is to work solely based on the readily available stats.
▶ It is unreliable use this method for short term trading as we cannot be sure when the things going to price in or if they have already priced in.
▶ Not a financial advise. Just an idea based on the research I have done so far. Constructive criticism welcome. Happy to learn from others.
Fundamental analysis on FBVery similar to yesterday's post on PYPL. Similar methodology and tools used.
Disclaimer: I do not hold FB and may not hold going forward as well. Massive price drop on earnings prompted me to dig a little more and do this analysis. All the methods are derived from free and open source scripts aimed at finding statistical and fundamental edge.
Point of this analysis is to understand if the massive price drop is justified or if this is an overreaction based on fundamentals and stats.
🎲 Earnings
Reported revenue and profit for this quarter is not too far from the estimated guidance. 🟡
Guidance for future earnings and revenue is weak. 25% drop in Q1 earnings estimates whereas 15% drop in Q1 revenue estimates. 🔴
Last year Q1 had similar drop where EPS dropped by 16% and revenue dropped by 10%. Hence, this drop may be season. 🟡
🎲 Financial stability
There is no doubt that financial position of FB is still very strong with low levels of debt and strong overall returns and margin. 🟢
🎲 Growth Projections
Based on the history, growth isn't concerning point too. However net income and book value seems to be stagnating and rate of increase of earnings and revenue seems to be dropping. This may not be concern for companies such as FB which are too big. 🟡
🎲 Drawdown from ATH
Present drawdown from ATH is around 36% and according to stats, this drop is 90th percentile. Meaning stock has had such a drawdown for only 10% of its trading time in the history. This may mean bargain for those who are willing to invest on the basis of value. 🟢
🎲 Comparison with fundamentals
Drop in fundamentals does not look too alarming. 🟢
Please note that range mentioned is percentile range. Book value per share is at 3.6 percentile even though it is not too far from peak. This is because not often FB's book value dropped in the overall history - which itself is quite impressive.
Let me know your views in the comment people!!
Fundamental analysis on PYPL! Disclaimer: I do not hold any PYPL and may not hold them going forward as well. But, 17% drop over earnings got my interest into having a look into fundamentals. Please note all the analysis done here are derived from the scripts I have written - all of them are open source and free to use.
Let's dig deeper.
🎲 Earnings
News items highlights poor earnings and economic outlook. While economic outlook is unchanged, earnings can be read as below
Earnings miss by 1% 🟠
Revenue exceeds by 0.29% 🟡
Future earnings is expected to go down by 10% 🔴
Future revenue is expected to drop by 5% 🔴
Overall 10-20% drop can be considered as expected. We need to also keep in mind that for growth based stocks, revenue is more important than earnings. But, we cannot exactly say how much of this is already priced in as the stock had significant drop from last 6 months.
🎲 Financial Health
This is derived from the open source script Quality-Screen . The script colour codes the financial metrics listed based on what is considered as healthy/unhealthy as per norms.
We can say overall health of company is very good. 🟢
🎲 Growth Trajectory
Overall growth trajectory is still up. This is derived from open source script Relative-Growth-Screen . Script plots financial growth parameters on Bollinger bands to identify the overall trajectory over long term. This makes sure that short term weakness in growth numbers does not impact the overall stats.
Overall revenue and book value per share seems to be increasing. However, EPS and YoY revenue growth seems to be stagnating. Reduced revenue can have higher impact on stock price for growth stocks.
With this, we can say overall growth trajectory is mildly low. 🟠
🎲 Drawdown from All time high
Below stat is derived from an open source script Drawdown-Range
The stats percentile dropdown from ATH. As we can see in the outcome. PYPL at present is down 44% from ATH. It is still not considering pre-market price. Otherwise, the drawdown from ATH is 55%. As we can see in the chart, this is at 100th percentile. Which means, very rarely PYPL had such kind of drawdown from its all time high in its history of stock price.
This means, price is at record discount level. Which can be very good for value investors. 🟢
🎲 Drawdown from ATH of fundamentals
This is again another fundamentals based stat derived from the open source script Percentile-Price-vs-Fundamentals
The script compares drop in fundaments with that of drop in price to understand if the price drop is justifiable or if it is an overreaction.
From the details highlighted, it does indeed look like price drop is bit overreaction. 🟢
This stat does not consider earnings and revenue estimates into picture. Hence, the impact of this may be limited if there is huge variation between present earnings and estimated guidance for next earnings.
My views on this stock is neutral as being trend follower, I never try to catch a falling knife. But, if you are looking for value based bargains, this can be good pick for you.
All the best and let me know your views in the comments :)