Know Your PitchforksPitchfork is drawn when price forms ABC pattern. Pitchfork draws a series of parallel lines in the direction of trend which can be used for support and resistance.
There are many methods of drawing pitchfork. In all cases, a line joining BC will make the base of pitchfork and fork lines are drawn from different points of the base. All the fork lines will be parallel. But, the handle of the base defines the direction of fork lines. Classification of pitchfork is mainly based on the starting and ending points of the handle.
🎲 Regular Types
Here, end of the handle is always fixed and it will be the mid point of B and C.
🎯 Andrews Pitchfork
Handle starts from A and joins the base at mid of B and C.
Forks are drawn based on fib ratios from the handle
🎯 Schiff Pitchfork
Handle starts from Bar of A and price of middle of AB and joins the base at mid of B and C
Forks are drawn based on fib ratios from the handle
🎯 Modified Schiff Pitchfork
Handle starts from mid of A and B and joins the base at mid of B and C
Forks are drawn based on fib ratios from the handle
🎲 Inside Types
Here, C will act as end of the handle which joins the Base BC .
🎯 Andrews Pitchfork (Inside)
Handle starts from A and joins the base at C
Forks are drawn based on fib ratios from the handle
🎯 Schiff Pitchfork (Inside)
Handle starts from Bar of A and price of (A+B)/2 and joins the base at C
Forks are drawn based on fib ratios from the handle
🎯 Modified Schiff Pitchfork (Inside)
Handle starts from mid of A and B and joins the base at C
Forks are drawn based on fib ratios from the handle
Feel free to explore the open source indicator Recursive Auto-Pitchfork
Trendoscope
Using scatterplot to understand the impact of RSI eventHello Everyone,
In this video we have discussed following things.
Scatter plot and implementation in Pine using heat map representation on tables.
Different quadrants and what it means.
RSI use case implemented in the indicator - RSI Impact Heat Map
How to use different settings and how to interpret the derived output.
General belief is when RSI crosses over 70, it is considered as overbought and people expect price to drop and when RSI crosses under 30, it is considered oversold and people expect price to move up. But, using this indicator, we can measure and plot the outcome of these events as scatter plot and use that to understand if these sentiments about overbought/oversold is right.
This can also be used with any entry condition. I look forward to developing a generic library for this so that other developers can make use of this to test their own criteria.
Thanks for watching this video. Let me know if you have any questions :)
Tradingview Telegram Webhook Bot with Chart Snapshot (Revised)Hello Everyone,
In this video, we will try to go through revised implementation of Tradingview-Telegram-Bot which can be used to send alert messages from tradingview to telegram along with current chart snapshot.
🎲 Base
Initial version of the same idea are as below:
How-to-create-simple-web-hook-to-send-alerts-to-Telegram
How-to-capture-chart-snapshot-in-tradingview-telegram-alert-bot
🎲 Prerequisite
Before proceeding with the current video, please watch the first video - How-to-create-simple-web-hook-to-send-alerts-to-Telegram which covers lots of basic things such as
Creating Telegram Bot using botfather and capturing required information such as TOKEN and CHANNEL
Basic usage of replit - a cloud based hosting service which lets us define our webhooks with little to no cost.
Postman - tool which is required to test the webhooks created
Other information such as keeping the bot alive via cronjob, using the webhooks in tradingview alert widget etc.
🎲 Setup
Clone/fork replit repo
Set mandatory environment variables CHANNEL and TOKEN
Set optional environment variables username/password or sessionid
Run the bot and start using webhooks
🎲 Usage
Webhook URL will be of the format.
https://Tradingview-Telegram-Bot. .repl.co/webhook?
🎲 Important Query parameters
jsonRequest - can be set as true/false. Default is false. If set to true, the payload should be a standard json. Output to telegram will be sent in tabular format. If not set or if set to false, output to telegram will be clear text.
tblfmt - table format to be used when jsonRequest is set to true. Default is plain. The values are exactly same as the ones required for tabulate package.
chart - Send the chart id if required to send chart snapshot along with alert message. For this to work - chart needs to be either a shared chart or environment variables for tvusername and tvpassword should be set to the user who has access to given chart.
ticker - Chart ticker. You no longer need to use different chart for different tickers. You can have a common chart and pass ticker to it so that chart will automatically switch to given ticker before taking screenshot
delivery - Taking chart snapshot takes time. This also delays the delivery of alert message. To avoid this, we can use this option - delivery=asap so that alert message will be sent as soon as possible and chart is sent later. If this parameter is not set, then both the messages will be delivered together.
🎲 Repository URLs
Tradingview-Telegram-Bot-Github
Tradingview-Telegram-Bot-Replit
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.
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.
Wyckoff distribution pattern - bull case!!Been thinking of building an algorithm for Wyckoff distribution detection. But, for now, just expressing my thoughts via this idea.
While zigzag can be basic building block, using modified channels may help further in avoiding fakeouts. In this example, we can also see that OBV and RSI has divergence. Let's see if this results in a fakeout or continue to complete wyckoff distribution pattern.
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 :)
Relation between Win Ratio and Risk RewardHello Everyone,
In this video, I have tried explaining the relationship between win ratio and risk reward.
🎲 Two sides of the coin
People often asked me if a strategy win rate is less than 50% then why do we need to follow it? And also we can see in social media - lots of people claiming 90%+ win ratio for their strategy.
There is also another set of people who are more infatuated with how much percent profit they can get out of strategy. In social media, we can see people bragging about 1000% + profit trades.
The question here is, is it really possible to achieve this consistently or is the expectation to achieve such success reliable?
Simple answer for this is yes, it is possible to achieve both 99% win rate and 1000%+ profitability. But, it is almost impossible to achieve both together. Thing we need to understand is,
We can have 99% win rate and still lose money!!
We can have 1000% profitable trades and still lose money!!
How??
That's because people claiming both these things do not talk about other side of the coin.
Example 1 : Option Selling for premium
Selling options is very popular trading strategy which can often have very high win rates. But, the risk reward for this is very low.
You may get premium of $1 where you will be risking $100 on every trade. With that, you will lose money even if you have 99% win rate.
99 X $1 = 99 profit
1 X $100 = 100 loss
----------------------
$1 Loss
----------------------
Example 2 : High Leverage Trades
When you are trading with high leverage, profits and losses are magnified. This may lead to lots of losses and also some trades with huge profit.
Lets say you are targeting 1000% win per trade with 100X leverage. This means, your position is liquidated upon 1% price drop or less. So, your threshold for withstanding drawdown in a trade is less. To make 1000% profit, you the price need to go up by 10%
Risk = $1
Leverage = 100X
Buy price = 100
Your position will liquidate if price hits 99. So, by just 1% drop.
To achieve 1000% profit, price need to go up by 10%
This means, your expectations of profit per trade is very high. This also mean, you are most likely to have more failed trades than wins. So, lets say you will end up with Win ratio of 5% with this expectation. The equation can look something like this.
5 X $10 = 50 profit
95 X $1 = 95 loss
-----------------------
$45 loss
-----------------------
🎲 The balance
What we learn from above examples is that there is no meaning of considering only Win Ratio or only Risk Reward while trying to build your strategy. What you need to consider is the combination of both together.
Here is a formula to understand how much win ratio do you need to breakeven with given risk reward.
Win Ratio = 1/(Risk Reward+1)
Similarly here is a formula to understand how much Risk Reward you should target to breakeven with given win ratio.
Risk Reward = 1/(Win Ratio -1)
Here is google sheet containing the formula applied on various values. docs.google.com
You can use this formula to understand overall profitability while building or evaluating strategies.
Hope this is helpful. Thanks very much.
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")
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 :)
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.
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 :)
The game is ON!!Negatives
Broken trendline
Unhealthy trend over past two years
Bearish sentiment over increase in interest rate
Positives
Just above a critical support area
In potential reversal zone
Too much bearish sentiment and possible exhaustion
Probabilities
If drops below 15000, can slip another 1k
close above 15350 either today or tomorrow might lead to quick recovery
DOGE - Hourly vs DailyDaily Chart - Bullish Sentiment
Broken resistance
Broken declining pivot high trendline
Bullish Gartley pattern setup - but already have run up to target 1
Hourly Chart - Mildly bearish sentiment
Seems to be rejecting under horizontal resistance
High volume on previous extreme candle - may signify temporary exhaustion
Bearish Harmonic Patterns in play
Support ahead from both trend lines and horizontal support level.
Trading plan
Short position followed by long position as shown in the chart below.
You can skip short position and just place a limit order for retest.
Plan B - if short position hits stoploss