Equilibrium Candles + Pattern [Honestcowboy]The Equilibrium Candles is a very simple trend continuation or reversal strategy depending on your settings.
How an Equilibrium Candle is created:
We calculate the equilibrium by measuring the mid point between highest and lowest point over X amount of bars back.
This now is the opening price for each bar and will be considered a green bar if price closes above equilibrium.
Bars get shaded by checking if regular candle close is higher than open etc. So you still see what the normal candles are doing.
Why are they useful?
The equilibrium is calculated the same as Baseline in Ichimoku Cloud. Which provides a point where price is very likely to retrace to. This script visualises the distance between close and equilibrium using candles. To provide a clear visual of how price relates to this equilibrium point.
This also makes it more straightforward to develop strategies based on this simple concept and makes the trader purely focus on this relationship and not think of any Ichimoku Cloud theories.
Script uses a very simple pattern to enter trades:
It will count how many candles have been one directional (above or below equilibrium)
Based on user input after X candles (7 by default) script shows we are in a trend (bg colors)
On the first pullback (candle closes on other side of equilibrium) it will look to enter a trade.
Places a stop order at the high of the candle if bullish trend or reverse if bearish trend.
If based on user input after X opposite candles (2 by default) order is not filled will cancel it and look for a new trend.
Use Reverse Logic:
There is a use reverse logic in the settings which on default is turned on. It will turn long orders into short orders making the stop orders become limit orders. It will use the normal long SL as target for the short. And TP as stop for the short. This to provide a means to reverse equity curve in case your pair is mean reverting by nature instead of trending.
ATR Calculation:
Averaged ATR, which is using ta.percentile_nearest_rank of 60% of a normal ATR (14 period) over the last 200 bars. This in simple words finds a value slightly above the mean ATR value over that period.
Big Candle Exit Logic:
Using Averaged ATR the script will check if a candle closes X times that ATR from the equilibrium point. This is then considered an overextension and all trades are closed.
This is also based on user input.
Simple trade management logic:
Checks if the user has selected to use TP and SL, or/and big candle exit.
Places a TP and SL based on averaged ATR at a multiplier based on user Input.
Closes trade if there is a Big Candle Exit or an opposite direction signal from indicator.
Script can be fully automated to MT5
There are risk settings in % and symbol settings provided at the bottom of the indicator. The script will send alert to MT5 broker trying to mimic the execution that happens on tradingview. There are always delays when using a bridge to MT5 broker and there could be errors so be mindful of that. This script sends alerts in format so they can be read by tradingview.to which is a bridge between the platforms.
Use the all alert function calls feature when setting up alerts and make sure you provide the right webhook if you want to use this approach.
There is also a simple buy and sell alert feature if you don't want to fully automate but still get alerts. These are available in the dropdown when creating an alert.
Almost every setting in this indicator has a tooltip added to it. So if any setting is not clear hover over the (?) icon on the right of the setting.
The backtest uses a 4% exposure per trade and a 10 point slippage. I did not include a commission cause I'm not personaly aware what the commissions are on most forex brokers. I'm only aware of minimal slippage to use in a backtest. Trading conditions vary per broker you use so always pay close attention to trading costs on your own broker. Use a full automation at your own risk and discretion and do proper backtesting.
Automation
ORB Heikin Ashi SPY 5min Correlation StrategyOverview:
The ORB (Opening Range Breakout) strategy combined with Heikin Ashi candles and Relative Volume (RVOL) indicator aims to capitalize on significant price movements that occur shortly after the market opens. This strategy identifies breakouts above or below the opening range, using Heikin Ashi candles for smoother price visualization and RVOL to gauge the strength of the breakout.
Components:
Opening Range Breakout (ORB): The strategy starts by defining the opening range, typically the first few minutes of the trading session. It then identifies breakouts above the high or below the low of this range as potential entry points.
Heikin Ashi Candles: Heikin Ashi candles are used to provide a smoother representation of price movements compared to traditional candlesticks. By averaging open, close, high, and low prices of the previous candle, Heikin Ashi candles reduce noise and highlight trends more effectively.
Relative Volume (RVOL): RVOL compares the current volume of a stock to its average volume over a specified period. It helps traders identify abnormal trading activity, which can signal potential price movements.
Candle for correlation : In this case we are using SPY candles. It can also use different asset
Strategy Execution:
Initialization: The strategy initializes by setting up variables and parameters, including the ORB period, session timings, and Heikin Ashi candle settings.
ORB Calculation: It calculates the opening range by identifying the high and low prices during the specified session time. These values serve as the initial reference points for potential breakouts. For this we are looking for the first 30 min of the US opening session.
After that we are going to use the next 2 hours to check for breakout opportunities.
Heikin Ashi Transformation: Optionally, the strategy transforms traditional candlestick data into Heikin Ashi format for smoother visualization and trend identification.
Breakout Identification: It continuously monitors price movements within the session and checks if the current high breaches the ORB high or if the current low breaches the ORB low. These events trigger potential long or short entry signals, respectively.
RVOL Analysis: Simultaneously, the strategy evaluates the relative volume of the asset to gauge the strength of the breakout. A surge in volume accompanying the breakout confirms the validity of the signal. In this case we are looking for at least a 1 value of the division between currentVolume and pastVolume
Entry and Exit Conditions: When a breakout occurs and is confirmed by RVOL and is within our session time, the strategy enters a long or short position accordingly. It does not have a stop loss or a takie profit level, instead it will always exit at the end of the trading session, 5 minutes before
Position Sizing and Commissions: For the purpose of this backtest, the strategy allocated 10% of the capital for each trade and assumes a trading commission of 0.01$ per share ( twice the IBKR broker values)
Session End: At the end of the trading session, the strategy closes all open positions to avoid overnight exposure.
Conclusion:
The combination of ORB breakout strategy, Heikin Ashi candles, and RVOL provides traders with a robust framework for identifying and capitalizing on early trends in the market. By leveraging these technical indicators together, traders can make more informed decisions and improve the overall performance of their trading strategies. However, like any trading strategy, it's essential to backtest thoroughly and adapt the strategy to different market conditions to ensure its effectiveness over time.
Heikin Ashi SupertrendAbout this Strategy
This supertrend strategy uses the Heikin Ashi candles to generate the supertrend but enters and exits trades using normal candle close prices. If you use the standard built in Supertrend indicator on Heikin Ashi candles, it will produce very unrealistic backtesting results because it uses the Heikin Ashi prices instead of the real prices. However, by signaling the supertrend reversals using Heikin Ashi while using standard candle close prices for the entries and exits, it corrects the backtesting errors and gives you a more realistic equity curve. You should set the chart to use standard candles and then hide them (the strategy creates the candles).
This strategy includes:
Plotting of Heikin Ashi candles
Heikin Ashi Supertrend
Long and Short Entry Signals
Move stop loss after trade is X% in profit
Profit Target
Stop Loss
Built in Alertatron automation
Alertatron Trade Automation Integration
For Alertatron integration, be sure to configure the strategy settings and "Enable Webhook Messages" before creating an alert with {{strategy.order.alert_message}} in the body of your alert message. Be sure to enable webhooks and point it to your Incoming Alertatron webhook URL.
Notes
While this strategy does pretty well during trending markets, It's worth noting that the Buy and Hold ROI is much better during peak times of the bull market
Not financial advice. Do not risk more than you can afford to lose.
SuperTrend Multi Time Frame Long and Short Trading Strategy
Hello All
This is non-repainting Supertrend Multi Time Frame script, I got so many request on Supertrend with Multi Time Frame. This is for all of them ..I am making it open for all so you can change its coding according to your need.
How the Basic Indicator works
SuperTrend is one of the most common ATR based trailing stop indicators.
In this version you can change the ATR calculation method from the settings. Default method is RMA.
The indicator is easy to use and gives an accurate reading about an ongoing trend. It is constructed with two parameters, namely period and multiplier. The default values used while constructing a Supertrend indicator are 10 for average true range or trading period and three for its multiplier.
The average true range (ATR) plays an important role in 'Supertrend' as the indicator uses ATR to calculate its value. The ATR indicator signals the degree of price volatility .
The buy and sell signals are generated when the indicator starts plotting either on top of the closing price or below the closing price. A buy signal is generated when the ‘Supertrend’ closes above the price and a sell signal is generated when it closes below the closing price.
It also suggests that the trend is shifting from descending mode to ascending mode. Contrary to this, when a ‘Supertrend’ closes above the price, it generates a sell signal as the colour of the indicator changes into red.
A ‘Supertrend’ indicator can be used on spot, futures, options or forex, or even crypto markets and also on daily, weekly and hourly charts as well, but generally, it fails in a sideways-moving market.
How the Strategy works
This is developed based on SuperTrend.
Use two time frame for confirm all entry signals.
Two time frame SuperTrend works as Trailing stop for both long and short positions.
More securely execute orders, because it is wait until confine two time frames(example : daily and 30min)
Each time frame developed as customisable for user to any timeframe.
User can choose trading position side from Long, Short, and Both.
Custom Stop Loss level, user can enter Stop Loss percentage based on timeframe using.
Multiple Take Profit levels with customisable TP price percentage and position size.
Back-testing with custom time frame.
This strategy is develop for specially for automation purpose.
The strategy includes:
Entry for Long and Short.
Take Profit.
Stop Loss.
Trailing Stop Loss.
Position Size.
Exit Signal.
Risk Management Feature.
Backtesting.
Trading Alerts.
Use the strategy with alerts
This strategy is alert-ready. All you have to do is:
Go on a pair you would like to trade
Create an alert
Select the strategy as a Trigger
Wait for new orders to be sent to you
This is develop for specially for automating trading on any exchange, if you need to get that automating service for this strategy or any Tradingview strategy or indicator please contact me I am have 8 year experience on that field.
I hope you enjoy it!
Thanks,
Ranga
Trailing Stop SnippetThis is an example snippet that should allow for adding a trailing stop and trailing stop activation to almost any script.
You can use it by setting a trailing stop alone. This will provide you standard trailing stop functionality allowing you to lock in profits and increase your stop-loss as the price moves in your direction.
You can also set the trailing stop activation to trigger the original trailing stop at a certain level. "Once price rises 5%, set a trailing stop at break even". This would be set as 5 and 5 in the settings.
AlphaTrend For ProfitViewThis strategy is based on the AlphaTrend indicator by KivancOzbilgic A full description of this algorithm functionality may be found by clicking the linked image above.
Changes and/or additions:
It is now a backtestable strategy
Updated alert trigger logic
Easy integration with ProfitView to use this algorithm for automated trading
When you create an alert, and you are using ProfitView, select " alert() function calls only " as the condition option. If you would rather set your own custom alert message, select " Order fills only " instead.
There is a selectable setting in the options to trigger alert() function calls immediately, that you may use to see what text it will send.
EMA Stoch Strategy For ProfitViewThis strategy will enter positions when the set stochastic conditions are met, and uses the moving average to filter the direction of the trades (long/short). The background is used to illustrate the strength of the stochastic values.
The following is a step by step guide in order to automate the trading of the strategy with ProfitView:
In the indicator settings, set the desired stochastic and ema values, and the stochastic condition you want to use to enter a trade.
In the indicator, set which exchange, symbol, and account to execute trades on.
In the indicator, set the PV Alert names you intend to use. If you want to use the same names as provided in the pastebin below, you may set the three names to Market Long, Market Short, TP SL Hit.
In PV, create two new PV Alerts in the PV Alert tab in accordance to these specifics pastebin.com .
On the Tradingview chart you want the indicator run on, create a new TV alert with this script as its condition, and specify the alert to "alert() function calls only".
RSI Rising Crypto Trending StrategyThis is crypto and stock market trending strategy designed for long timeframes such as 4h+
From my tests it looks like it works better to trade crypto against crypto than trading against fiat.
Indicators used:
RSI for rising/falling of the trend
BB sidemarket
ROC sidemarket
Rules for entry
For long: RSI values are rising, and bb and roc tells us we are not in a sidemarket
For long: RSI values are falling, and bb and roc tells us we are not in a sidemarket
Rules for exit
We exit when we receive an opposite direction.
Cuation: Because this strategy uses no risk management, I recommend you takje care with it.
If you have any questions, let me know !
Crypto Scalper Divergence Macd Psar Ema 200This is a very efficient crypto scalper adapted to very short timeframes, however it can be optimized for other timeframes and assests as well.
Its components are
MACD
P SAR
EMA 200
Risk management
Rules for entry:
For short : we have an uptrend on PSAR , histogram is positive (divergence MACD) and close of a candle is below EMA 200
For long : we dont have an uptrend on PSAR, histogram is negative(divergence MACD) and close of a candle is above EMA 200
Rules for exit:
We exit when we either find a reverse condition than the entry one, or based on stop loss/take profit that are calculated on % movements of the price.
If you have any questions, let me know !
High/Low Channel Multi averages Crypto Swing strategyThis is a swing strategy designed for trending markets such as crypto and stock, with big timeframes , like 8h.
For this strategy we take SMA, EMA, VWMA, ALMA, SMMA, LSMA and VWMA and make an apply them all to both HIGH and LOW separately and make 2 averages, 1 applied to high and the other applied to low.
With them we make a channel.
Rules for entry
For long: close of a candle is above avg applied to high.
For short: close of a candle is below avg applied to low.
Rules for exit
We exit when we either hit TP or SL or when we receive a different condition than the entry one.(long- > short and viceversa)
If you have any questions, let me know !
3 RSI 6sma/ema ribbon crypto strategyThis is a very efficient swing trading strategy designed for crypto long timeframes like 2h+.
Initially we have 3 RSI .
AFter that we use them as source for 6 SMA/EMA for each RSI, 5, 30, 50, 70, 90, 100. With those we create a ribbon that we are going to use in order to check the direction of the trend.
Rules for entry:
For long : if either all the SMA/EMA's from the 2nd RSI are telling us to go long, or all the all SMA/EMA's from the 3rd rsi are telling us to go long F
For short : if either all the SMA/EMA's from the 2nd RSI are telling us to go short, or all the all SMA/EMA's from the 3rd rsi are telling us to go short
We exit when we get an opposite condition than the entry one.
Caution: this strategy has no risk management inside, so use it with caution. If you have any questions , let me know !
BTC Candle Correlation Strategy This is a special strategy adapted for crypto market, which instead of using the current chart candles, we use inside calculation a candle from different charts.
For best usage I recommend a big timeframe like 1-4h+.
In this case we take the high, low, open and close candles from different brokers for BTC, and with it we form up the candle that we are going to use for the logic of entry.
At the same time we are going to create an upper and lower bands using a moving average and the difference between high and low.
So in a way to put it, if BTC triggers a sell or buy order, we input instead these orders on the current chart, like in this example with ETH.
Rules for entry
For long : if we have a crossover of the btc source value with the upper band .
For short: if we have a crossunder of the btc source vale with the lower band.
For exit, we do it when we receive a different signal than the initial one.
This strategy does not have any other risk management inside, so use it with caution.
If you have any other questions, let me know !
Gunbot - Bbands - UnlockedThis is a repost, the first version was locked and I am unable to unlock it. So I'm simply publishing it anew.
Original Post
Original Description
This is more of a test run than anything. Gunbot approximation courtesy of Vosechu and the original can be found here.
MP ZeroLag EMANew script based on zlema. Hopefully responds better tot ake advantage of margin trading. As usual, commands for both spot trading and margin trading are included, just need to comment or uncomment (using // ) which you prefer. They are just labels so both work in the same way (long/buy, short/sell). Also added some flair to pretty it up a bit, and yes, those divergences are in fact functional, but not really part of the script (disclosure- the divergences are taken from DonovanWall's ideas, full credit here). There is a "new stuff" section, which you CAN use, but right now it was for art and introduced way too many functions at once to be of any use, but feel free to explore as an Easter Egg :)
Autoview friendly in design :)
As usual, all proceeds go to the betterment of these scripts as well as my upcoming surgery (Carpel Tunnel Syndrome, yuck)
1Dsg49Zt2FQ9BnUHrmXQwvhL5dd3teqa7g
ltc addy- LYUpgsHSHnKeYdNaj9bu9prK4QsnJXEQtP
pinkcoin addy- 2PoeXyAk3rF9FmMC8azme2mGzMYsEiZ5eS
Moving Average Cross and/or Bbands botHello TradingView and world!
This is one of our latest concepts for an actual bot builder. This script comes with a bunch of features that we're hoping will alleviate a lot of the stress and confusion around using and building strategies here on TV. Especially if the end-goal is to automate the strategies using Autoview.
This is a combination of 2 strategies, and gives you full control of each component within the script.
The 2 strategies are:
2 Moving Averages == if close is greater than moving average and moving average 1 is greater than moving average 2
Bolling Bands == if close is less than lower or greater than upper
Features / Settings included :
- Ability to change settings from a commodity market (default) to an altcoin or forex market.
- Backtest time period selector component
- Heiken Ashi Candles on/off
- Moving Average Strategy on/off
- Bollinger Bands Strategy on/off
- Both Moving Average settings can be adjusted
- Bollinger Bands length and multiplier can be adjusted.
- Pyramiding Greater Than, Equal To, or Less Than
- Trailing Stop with the ability to set a price in which the Trailing Stop activate
- Take Profit on/off and editable
- Stop Loss on/off and editable
- Margin Call on/off dependent on Leverage which is editable
- If pyramiding is used, the strategy will calculate and display your average on the chart
- Profit and Loss visuals added to the chart
You can watch a video here on how all the settings can be used and work together.
www.youtube.com
You can learn more about Autoview here:
autoview.with.pink
Get your invite and join us in slack here:
slack.with.pink
How to automate this strategy for free... Version 2Hello fellow traders and automation lovers.
It has been about 2 years since we originally created Autoview to connect your exchanges/brokers with your TradingView alerts. We've since added multiple exchanges, parameters and have built a large community filled with awesome, passionate traders.
One of the first strategies we built was sadly not a viable one for trading due to it using built-in variables that resulted in the backtest results being inaccurate in comparison to placing live trades. Luckily, we did not encounter repainting until a few strategies in, however, there was a point where we published a few of them as well. We will be going through all of our scripts again to not only eliminate any repainting and update to version 3, but to also include all the code snippets that we've learned to use over the years that allow for accurate backtesting and live trading.
The first script we are redoing is our How to automate this strategy for free using a chrome extension. .
Easter egg: This includes a new snippet of code that makes controlling how many orders you pyramid within a study fast and easy.
We look forward to bringing all of our scripts and delving deep into Pine again :)
Happy Trading
Autoview
MACD, backtest 2015+ only, cut in half and doubledThis is only a slight modification to the existing "MACD Strategy" strategy plugin!
found the default MACD strategy to be lacking, although impressive for its simplicity. I added "year>2014" to the IF buy/sell conditions so it will only backtest from 2015 and beyond ** .
I also had a problem with the standard MACD trading late, per se. To that end I modified the inputs for fast/slow/signal to double. Example: my defaults are 10, 21, 10 so I put 20, 42, 20 in. This has the effect of making a 30min interval the same as 1 hour at 10,21,10. So if you want to backtest at 4hr, you would set your time interval to 2hr on the main chart. This is a handy way to make shorter time periods more useful even regardless of strategy/testing, since you can view 15min with alot less noise but a better response.
Used on BTCCNY OKcoin, with the chart set at 45 min (so really 90min in the strategy) this gave me a percent profitable of 42% and a profit factor of 1.998 on 189 trades.
Personally, I like to set the length/signals to 30,63,30. Meaning you need to triple the time, it allows for much better use of shorter time periods and the backtests are remarkably profitable. (i.e. 15min chart view = 45min on script, 30min= 1.5hr on script)
** If you want more specific time periods you need to try plugging in different bar values: replace "year" with "n" and "2014" with "5500". The bars are based on unix time I believe so you will need to play around with the number for n, with n being the numbers of bars.
How to automate this strategy for free using a chrome extension.Hey everyone,
Recently we developed a chrome extension for automating TradingView strategies using the alerts they provide. Initially we were charging a monthly fee for the extension, but we have now decided to make it FREE for everyone. So to display the power of automating strategies via TradingView, we figured we would also provide a profitable strategy along with the custom alert script and commands for the alerts so you can easily cut and paste to begin trading for profit while you sleep.
Step 1:
You are going to need to download the Chrome Extension called AutoView. You can get the extension for free by following this link: bit.ly ( I had to shorten the link as it contains Google and TV automatically converts it to a symbol)
Step 2: Go to your chrome extension page, and under the new extension you'll see a "settings" button. In the setting you will have to connect and give permission to the exchange 1broker allowing the extension to place your orders automatically when triggered by an alert.
Step 3: Setup the strategy and custom script for the alerts in TradingView. The attached script is the strategy, you can play with the settings yourself to try and get better numbers/performance if you please.
This following script is for the custom alerts:
//@version=2
study("4All-Alert", shorttitle="Alerts")
src = close
len = input(4, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsin = input(5)
sn = 100 - rsin
ln = 0 + rsin
short = crossover(rsi, sn) ? 1 : 0
long = crossunder(rsi, ln) ? 1 : 0
plot(long, "Long", color=green)
plot(short, "Short", color=red)
Now that you have the extension installed, the custom strategy and alert scripts in place, you simply need to create the alerts.
To get the alerts to communicate with the extension properly, there is a specific syntax that you will need to put in the message of the alert. You can find more details about the syntax here : gist.github.com
For this specific strategy, I use the Alerts script, long/short greater than 0.9 on close.
In the message for a long place this as your message:
Long
c=order b=short
c=position b=short l=200 t=market
b=long q=0.01 l=200 t=market tp=13 sl=25
and for the short...
Short
c=order b=long
c=position b=long l=200 t=market
b=short q=0.01 l=200 t=market tp=13 sl=25
If you'll notice in my above messages, compared to the strategy my tp and sl (take profit and stop loss) vary by a few pips. This is to cover the market opens and spread on 1broker. You can change the tp and sl in the strategy to the above and see that the overall profit will not vary much at all.
I hope this all makes sense and it is enough to not only make some people money, but to show the power of coming up with your own strategy and automating it using TradingView alerts and the free Chrome Extension AutoView.
ps. I highly recommend upgrading your TradingView account so you have access to back testing and multiple alerts.
There is really no reason you won't cover the cost and then some on a monthly basis using the tools provided.
Best of luck and happy trading.
Note: The extension currently allows for automation on 2 exchanges; 1broker and Okcoin. If you do not have accounts there, we'd appreciate you signing up using our referral links.
www.okcoin.com
1broker.com