Inside Bar Strategy w/ SL"Inside bars are a two -bar pattern. They can indicate either a continuation of the
existing move or a reversal. A continuation occurs when there is no significant
support or resistance level in sight, while a reversal occurs close to a strong sup-
port or resistance level...
...A lot of traders are aware of inside bars but few manage to make money with
them. Why is this so? It goes back to interpreting price action. A lot of traders look
to trade in geometric ways. What I mean is that they search for fancy shapes on a
chart and think that this is what represents true price action.
This is not the case. A shape is just a shape. The formation by itself means
nothing unless underlying order flow backs it up. This is why it’s extremely
important that you look for inside bars when a trend is already in place.
The best place to look for them is in the beginning of trends."
Candlestick Analysis
FTB Strategy (Automated)Hey traders!
This is a profitable strategy script I created to teach my students how to automate their scripts using 3rd party APIs (more info available in my profile link at the bottom of this page).
What Is This?
This strategy is called the "Follow The Bear" strategy.
It's a forex trading strategy designed for one purpose and one purpose only: to take advantage of a recurring pattern on EURUSD's 1-Hour chart during the European market open.
The basic explanation is this:
During the European open we want to see a rally followed by a swing high shooting star / reversal pinbar candle. This typically means that traders buying EURUSD during the European/London open are now trapped long, and as price begins to retrace they are forced to sell, fueling a short-term retracement.
This strategy takes advantage of that pattern by aggressively selling short with a tight stop-loss above the pinbar candle and a conservative target.
There are many ways to trade this pattern, but this script represents my personal method for trading it.
It is not 100% accurate (no strategy is), but it does have a considerably high win rate over the past 6+ years considering its simplicity and I've been trading it for several months and can attest to its edge over the markets (at least through the Oanda data feed which is what I use).
The strategy rules are this:
Market: EURUSD
Timeframe: 1-Hour
Direction: Short Only
Timezone: 6AM-10AM GMT
Days: Tuesday, Wednesday, Thursday
Entry: Close of Pinbar Setup
Stop: 2 pips above signal candle
Target: 1:1
Risk: Up to you (backtest first! I use 1%)
The rule for the pinbar/shooting star candle pattern is that the candle must both open and close in the lower 50% of the bar's total size.
Automation
This script is already prepared to be auto-traded through a 3rd-party API that was created to relay TradingView alerts to your broker to execute and manage trades.
Sorry for the lack of information - due to TradingView's house rules I cannot go into any more detail here, but if you're interested in automating this script there is more info available in the resources offered under my profile link at the bottom of this page.
Disclaimer
The material and the resources offered here are for educational purposes only. Always do your own research and only execute trades based on your own personal judgement.
Trading foreign currencies can be a challenging and potentially profitable opportunity for investors. However, before deciding to participate in the forex market, you should carefully consider your investment objectives, level of experience, and risk appetite. Most importantly, do not invest money you cannot afford to lose.
There is considerable exposure to risk in any foreign exchange transaction. Any transaction involving currencies involves risks including, but not limited to, the potential for changing political and/or economic conditions that may substantially affect the price or liquidity of a currency, investments in foreign exchange speculation may also be susceptible to sharp rises and falls as the relevant market values fluctuate.
The leveraged nature of forex trading means that any market movement will have an equally proportional effect on your deposited funds. This may work against you as well as for you. Not only may investors get back less than they invested, but in the case of higher risk strategies, investors may lose the entirety of their investment. It is for this reason that when speculating in such markets it is advisable to use only risk capital.
Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. Past performance is not indicative of future results. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts.
Consecutive Up/Down Strategy with Reverse and SLExtension of the built-in strategy by TradingView. The strategy buys after an X amount of
consecutive bullish bars and viceversa for selling. This logic can be reversed and a Stop Loss
with Take Profit can be added. There's also an option to adapt the SL into a Trailing Stop.
Positive Bars % StrategyBased on the calculations by ZenAndTheArtOfTrading. I added stop loss, take profit and reverse code lines.
The Positive Bars % calculates the number of green (positive) bars, relative to a look back period, defined
by the user. If the percentage is low, it means that there was a bigger number of red candles in the
lookback period. The strategy goes long when the percentage is high and short when it's low.
This logic can be reversed with positive results on different time frames.
2nd Grade StrategyThis is a strategy to complement the 2GT indicator. It utilises the same rules as 2GT.
This is comprises of multiple popularly used indicators to help decide on whether to go long or short. This indicator will overlay the MA lines and background colours on your chart.
The heikin-ashi colour will be shown as the background colour. This will help you identify a trend more easily while using bars, candles, hollow candles, etc. When the background is green, it means that it is a green HA and vice versa.
The blue MA line is for showing the short-term trend. The red MA line is for showing the medium-term trend. You can select the moving average flavour of your choice in the settings.
The yellow MA line is the long-term trend that is mainly used as a filter to indicate bullish/bearish trend. The MA type for this filter can be different from the short/mid term MA.
This indicator will also show Stochastic crossovers (GC, DC, BC) on the chart. This will help to always keep your eye on the chart candles.
In the settings, you can also turn on/off bullish/bearish signals.
Rules for bullish signals on this indicator:-
1. MA: Blue > Red > Yellow (FastMA > SlowMA > FilterMA)
2. Stochastic: K > D and both are heading upwards
3. 2nd Green HA
When 2 out of the 3 rules are met, the candle background will be Aqua in colour. When all 3 rules are met, the candle background will be Green .
Rules for bearish signals on this indicator:-
1. MA: Yellow > Red > Blue (FilterMA > SlowMA > FastMA)
2. Stochastic: D > K and both are heading downwards
3. 2nd Red HA
When 2 out of the 3 rules are met, the candle background will be Orange in colour. When all 3 rules are met, the candle background will be Red .
Do note that you can hide any of these elements in via the settings.
If you find this useful, do smash the LIKE and FOLLOW button.
WSLM
Big Bar Strategy// This strategy detects and uses big bars to enter a position. When the Big Bar
// is bearish (red candle) the position will be long and viceversa
// for short positions. The stop loss (optional) is placed on the low of the
// candle used to trigger the position and user inputs allow you to modify the
// size of the SL. Take profit is placed on a reward ratio of 1. User can also modify
// the size of the bar body used to determine if we have a real Big Bar and
// filter out Doji bars. Big Bars are determined relative to the previous X period size,
// which can also be modified, as well as the required size of the Big Bar relative to this period average.
open>open[1]=BUY_else_SELLsimple script. enter rule is open>open =BUY_else_SELL (open means open price 1 candle ago, so basically its if price now greater than price 1 candle ago...)
exit rule is Trailing Stop.
1 trade per candle, here on daily chart BTCUSDT with binance commision included in result.
254 million percent profit....
😲
MA Emperor insiliconot StrategyConverted EmperorBTC's EMA crossover indicator for easy backtesting and added ability to:
Specify time period for backtesting
Specify order quantity
Toggle original indicators (default off)
Quoting EmperorBTC:
Entry is to be made when the
1. Cross over gives a P(Positive Sign) and the candle completely closes above the cross-over
2. When the Heikin Ashi turns green and the next green HA candle goes above the previous green HA candle.
3. The price should be at-least above the 0.236 Level from the Swing high.
Kindly note that the strategy only attempts to do check number 1, where it ensures the entry opens above the cross-over.
Hammers & Stars StrategyOverview
This script trades basic hammer and shooting star candlestick patterns.
It's an extremely simple strategy with minimal filters, and according to my personal manual backtesting and automated trading results, performs best on the Daily chart on certain forex pairs.
It is intended to be traded on the forex markets but theoretically should work on all markets (especially if you optimize the settings).
The script also comes with complete AutoView automation for Oanda.
Make sure you've connected AutoView to TradingView and Oanda, then simply set an alert using the "alert() function calls only" condition and it will automatically execute trades based on whatever settings you've selected (only recommended for experienced traders - use at your own risk!)
If you're not sure how to set up AutoView, search "The Art of Trading AutoView Guide" on YouTube to find my detailed video guide.
Check out my website and YouTube channel for more information, scripts, resources and free Pine Script & trading lessons (link in my profile).
Best of luck with your trading!
- Matt / The Art of Trading
Settings Menu
Tooltips are included explaining what the various settings do, but here's a quick summary:
Strategy Settings
>= ATR Filter: Minimum size of entry candle compared to ATR
<= ATR Filter: Maximum size of entry candle compared to ATR
Stop Loss ATR: Stop loss multiplier (x ATR)
R:R: Risk:Reward profile
Fib Level: Used to calculate upper/lower third of candle. (For example, setting it to 0.5 will mean hammers must close >= 50% mark of the total candle size)
Start Date Filter: Date & time to begin trading from
End Date Filter: Date & time to stop trading
AutoView Oanda Settings
Use Oanda Demo: If turned on then oandapractice broker prefix will be used for AutoView alerts (demo account). If turned off then live account will be used
Use Limit Order: If turned on then AutoView will use limit orders. If turned off then market orders will be used (recommended to use limit order to mitigate spread issues)
Days To Leave Limit Order: This is your GTD setting (good til day)
Account Balance: Your account balance (used for calculating position size)
Account Currency: Your account balance currency (used for calculating position size)
Risk Per Trade %: Your risk per trade as a % of your account balance
All Candlestick Patterns StrategyThis strategy uses the tradingview built in candlestick recognition.
Marubozu Forex Price actionHi, today I bring you a price action strategy/indicator for Forex, made out for Marubozu candle type.
For the entries of it check if we have a long or a short marubozu.
For exit we have for long when the actual candle is green and the last previous two were red.
For exit we have for short, when the actual candle is red and the last previous two were green.
If you have any questions private message me !
Doji swing strategyThis is a simple strategy based on Doji star candlestick
This strategy is suited for big time frames, like 4h -1Day and so on.
It places two orders: long at doji star high or previous candle high and short at doji star low or previous candle low.
It can also be applied volume average, in order to filter between trades .
This strategy works very well with high time frames like Weekly TF because it eliminates the noise in doji formation.
It also has inside a risk management made of SL/TP , or if not prefered it can exit based on a exit condition.
If you have any questions, please let me know !
Pinescript v4 - The Holy Grail (Trailing Stop)After studying several other scripts, I believe I have found the Holy Grail! (Or perhaps I've just found a bug with Tradingview's Pinescript v4 language) Anyhow, I'm publishing this script in the hope that someone smarter than myself could shed some light on the fact that adding a trailing stop to any strategy seems to make it miraculously...no that's an understatement...incredulously, stupendously, mind-bendingly profitable. I'm talking about INSANE profit factors, higher than 200x, with drawdowns of <10%. Sounds too good to be true? Maybe it is...or you could hook it up to your LIVE broker, and pray it doesn't explode. This is an upgraded version of my original Pin Bar Strategy.
Recommended Chart Settings:
Asset Class: Forex
Time Frame: H1
Long Entry Conditions:
a) Exponential Moving Average Fan up trend
b) Presence of a Bullish Pin Bar
c) Pin Bar pierces the Exponential Moving Average Fan
Short Entry Conditions:
a) Exponential Moving Average down trend
b) Presence of a Bearish Pin Bar
c) Pin Bar pierces the Exponential Moving Average Fan
Exit Conditions:
a) Trailing stop is hit
b) Moving Averages cross-back (optional)
c) It's the weekend
Default Robot Settings:
Equity Risk (%): 3 //how much account balance to risk per trade
Stop Loss (x*ATR, Float): 0.5 //stoploss = x * ATR, you can change x
Stop Loss Trail Points (Pips): 1 //the magic sauce, not sure how this works
Stop Loss Trail Offset (Pips): 1 //the magic sauce, not sure how this works
Slow SMA (Period): 50 //slow moving average period
Medium EMA (Period): 18 //medium exponential moving average period
Fast EMA (Period): 6 //fast exponential moving average period
ATR (Period): 14 // average true range period
Cancel Entry After X Bars (Period): 3 //cancel the order after x bars not triggered, you can change x
Backtest Results (2019 to 2020, H1, Default Settings):
AUDUSD - 1604% profit, 239.6 profit factor, 4.9% drawdown (INSANE)
NZDUSD - 1688.7% profit, 100.3 profit factor, 2.5% drawdown
GBPUSD - 1168.8% profit, 98.7 profit factor, 0% drawdown
USDJPY - 900.7% profit, 93.7 profit factor, 4.9% drawdown
USDCAD - 819% profit, 31.7 profit factor, 8.1% drawdown
EURUSD - 685.6% profit, 26.8 profit factor, 5.9% drawdown
USDCHF - 1008% profit, 18.7 profit factor, 8.6% drawdown
GBPJPY - 1173.4% profit, 16.1 profit factor, 7.9% drawdown
EURAUD - 613.3% profit, 14.4 profit factor, 9.8% drawdown
AUDJPY - 1619% profit, 11.26 profit factor, 9.1% drawdown
EURJPY - 897.2% profit, 6 profit factor, 13.8% drawdown
EURGBP - 608.9% profit, 5.3 profit factor, 9.8% drawdown (NOT TOO SHABBY)
As you can clearly see above, this forex robot is projected by the Tradingview backtester to be INSANELY profitable for all common forex pairs. So what was the difference between this strategy and my previous strategies? Check my code and look for "trail_points" and "trail_offset"; you can even look them up in the PineScript v4 documentation. They specify a trailing stop as the exit condition, which automatically closes the trade if price reverses against you.
I however suspect that the backtester is not properly calculating intra-bar price movement, and is using a simplified model. With this simplfied approach, the trailing stop code becomes some sort of "holy grail" generator, making every trade entered profitable.
Risk Warning:
This is a forex trading strategy that involves high risk of equity loss, and backtest performance will not equal future results. You agree to use this script at your own risk.
Hint:
To get more realistic results, and *maybe* overcome the intrabar simulation error, change the settings to: "Stop Loss Trail Points (pips)": 100
I am not sure if this eradicates the bug, but the entries and exits look more proper, and the profit factors are more believable.
Soldiers Pattern ModifiedThis can be perceived as modified 3 soldiers, relaxed NR4 or even extended harami candlestick pattern.
Works for any instrument and any timeframe.
The idea is to find out any number of candles having their individual highs and lows, all within high and low range of base candle.
The count of soldiers and if they must be of same color, both can be configured.
Additional configurable settings is to add further check of having body of soldiers as well within body of base candle.
Trading strategy: Trade high or low breakout of base candle, having other as stop loss, for a risk reward ratio of 1:2.
Reversal closing priceThe reversal closing price (RCP) is a candlestick pattern which follows two simples rules:
the low price of current candle needs to be lower than the low price of the last 2 candles
the closing price of current candle needes to be higher than the closing price of the last candle
This generates a signal for a long position. For a short position, the conditions are inverted:
the high price of current candle needs to be higher than the high price of the last 2 candles
the closing price of current candle needes to be lower than the closing price of the last candle
Since RCP is a trend follower indicator, the strategy is programmed in such a way that long positions are only placed if the short period EMA is above the long period EMA, and short positions are only placed if the short EMA is bellow the long EMA. Both periods are configurable, and should be ajusted for each asset.
This strategy uses a fixed stop loss and take profit, and the it's ratio is configurable. The stop price is one tick lower than the lowest price of X candles prior to the order execution for long positions, while in short positions it's one tick higher than the higher price. The amount of candles to lookback (X) is configurable. Both stop and take profit prices are displayed, the first as a red line, and the second as a green line.
This is the setting that I've found to work best with TVC:SPX , but you may find a better setting. While the RCP is universal, it's placement depends on the trend and it's strenght, something that is very heterogeneous among assets.
I really wish that I was able to place images, but I don't have PRO, so text will have to do.
This strategy was designed by Alexandre Wolwacz, a.k.a. Stormer.
Gap Down Reversal StrategyA "Gap down Reversal" is when the current days candle, opens, below the prior days close, and "finishes up" on the day with the close greater than the open. This type of price action can provide traders with favorable entry points to trade long, as anyone who was short the prior day, can get squeezed or panic out of the trade as they would see profits erode quickly from the gap down at the open.
Strategy results are shown on SHOP with 10k starting capital and 10k per trade. The strategy enters at next days close after the gap down reversal fires off, and a 5% trailing stop order is also executed. This is important to understand when experimenting with different trailing stops on different symbols and observing results to find the most viable strategy. The discretionary trader may choose to enter at the close, or at the next days open, so understand results are not calculated for those entry points.
You also may alter the start date of the strategy, so you can include, or exclude certain dates.
Experiment with different stops and symbols! More volatile symbols most likely will need looser stops and Vice Versa. Concentrate on symbols in up trends, as "the dips" usually get consistently bought in these names, but hard reversals in downtrends can happen as well.
Any questions/concerns please let me know and happy trading.
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.
StarbuxI made this in starbucks .
Bullish hammer trading signal algorithm
using MACD for trend determination and holding period.
BEST Engulfing + Breakout StrategyHello traders
This is a simple algorithm for a Tradingview strategy tracking a convergence of 2 unrelated indicators.
Convergence is the solution to my trading problems.
It's a puzzle with infinite possibilities and only a few working combinations.
Here's one that I like
- Engulfing pattern
- Price vs Moving average for detecting a breakout
Definition
Take out the notebooks :) and some coffee (good for focus). I'm bullish in coffee
The engulfing pattern is a two-candle reversal pattern.
The second candle completely ‘engulfs’ the real body of the first one, without regard to the length of the tail shadows.
The bullish Engulfing pattern appears in a downtrend and is a combination of one red candle followed by a larger green candle
The bearish Engulfing pattern appears in a downtrend and is a combination of one green candle followed by a larger red candle
Example: imgur.com
We're bored sir... what's the point of all this?
In summary, an engulfing is a pattern to track reversals. (the whole TradingView audience stands up now giving a standing ovation)
Adding the Price vs Moving average filters allows to track reversals with momentums (half of the audience collapsed because this is too awesome)
Ok sir... you picked up my interest
I included some cool backtest filters:
- date range filtering
- flexible take profit in USD value (plotted in blue)
- flexible stop loss in USD value (plotted in red)
All the best
Dave
Strategy Test - Cancel Limit Order and Position SizingWhile working thru another project had the need to troubleshoot the canceling of a limit order syntax/process as well as work thru the code and logic to automagically set the position sizing based off two user inputs (Amount to Risk in USD and Leverage to Use) and the potential entry and stop levels for an inside bar candle pattern in this scenario. Once we find the distance between the entry and stop level we can figure out the stop percentage amount which matches up with what a user would see manually drawing using the long or short tool in tradingview. Once we have the user inputs and levels we can get an amount to be used in later qty= type of places in zeeee pine script....
Noro's BottomSensivity v0.6 strategy + rsi + AlarmThe original indicator is Noro's BottomSensivity v0.6
I simply turned noro's bottom sensibility 6.0 indicator, which I consider a great tool to find market bottom, into a strategy.
I also added an additional RSI filter with inputs that can be set by the user for entry and exit from the market.
I have tried to insert an alarm so that I can be notified when this particular purchase condition is formed.
I also tried to insert an additional filter that would allow me to make further pyramid purchases only after a certain percentage of drawdown from the first entry so as to reduce the average purchase price but I was not able ... if someone could implement this I would appreciate it.
Well..this is the first time that I try to program / modify a strategy / indicator, there are certainly some gross errors (as in my English too), please forgive me, I will appreciate the corrections that more experienced users will want to make.
I wish you all a good day, pfjons
Heiken Ashi BF Heiken Ashi candles help us to identify a trend.
This strategy simply enters a long when the Heiken Ashi candles turn green and a short when they turn red.
Because of the way BTC price moves in medium term trends, this simple strategy seems effective.
There is a rate of change function applied to avoid some of the choppy sideways action (thanks again to kiasaki for the code)
There is a 2% fixed stop loss applied and an optional take-profit setting. You can change both in the settings.
As you can see from the code, this strategy does not enter trades based on the Heiken Ashi closes, rather the actual price close. This is an important distinction since the HA closes are based on an average of the OHLC values so attempting to enter at that price may not always be possible. There are some "strategies" that use this information to try and con people by appearing to have awesome entries that are actually not attainable in all cases.
Green = Long
Red = Short
White = No trade
Candle Patterns StrategyThe script allows you to test popular candlestick patterns on various instruments and timeframes. In addition, you can configure risk management (if the value is zero, it means the function is disabled), and you can also specify the time of the trading session (for example, so that the positions are not transferred to the next day).
The author is grateful to JayRogers and Phi35, their code examples helped a lot in writing the strategy.