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
Custom
DecisionPoint Volume Swenlin Trading Oscillator [LazyBear]This is the volume version of "DecisionPoint Breadth Swenlin Trading Oscillator"
DecisionPoint Swenlin Trading Oscillator can be used to identify short-term tops and bottoms. You can read about the interpretation of the signals (& gotchas) in the link below.
I have added support for NYSE / NASD / AMEX and also a combined mode. You can specify custom advancing/declining volume symbols too.
More Info:
DBSTO:
Article: stockcharts.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Having both Swenlin Breadth and Volume oscillators help spot the divergences quickly:
DecisionPoint Breadth Swenlin Trading Oscillator [LazyBear]DecisionPoint Swenlin Trading Oscillator can be used to identify short-term tops and bottoms. This is a breadth indicator. STO is designed to be calculated using either issues or volume, I will post a follow up indicator that makes use of volume.
You can read about the interpretation of the signals (& gotchas) in the link below.
I have added support for NYSE / NASD / AMEX and also a combined mode. You can specify custom advancing/declining mkt symbols too.
More Info:
stockcharts.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
DecisionPoint Price Momentum Oscillator [LazyBear]The DecisionPoint Price Momentum Oscillator (PMO) is an oscillator based on a Rate of Change calculation that is smoothed twice with custom exponential moving averages. Because the PMO is normalized, it can also be used as a relative strength tool.
PMO can be used in many ways:
- PMO can be used to determine the OB/OS state. While the +2.5 to -2.5 is the usual range for broad stock market indexes, each price index will have its own “signature” range. You may have to tune this for your instrument.
- PMO triggers buy/sell on signal crossovers and ZERO crossovers.
- Common patterns like BullKiss, BearKiss are useful to track. See the link below for more info.
- Divergences.
- Histo-only mode that can be used similar to MACD-Histo.
I have exposed all params as configurable. Have fun tuning :) Don't forget to share what you found for your instrument.
More Info:
stockcharts.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Some Sample Charts:
TWTR:
MSFT:
GOOGL:
Adaptive Ergodic Candlestick Oscillator [LazyBear]This updates Blau's excellent Candlestick oscillator to be adaptive by using the length of a scaled stochastic indicator and an exponent (for calculating the smoothing coefficient) to obtain the moving average.
Check out the options page for configurable variables.
More info on Ergodic Oscillator:
Book: "Momentum, Direction and Divergence" by William Blau
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Apirine Slow RSI [LazyBear]The slow relative strength index (SRSI) indicator created by Vitali Apirine is a momentum price oscillator similar to RSI in its application and interpretation. Oscillating between 0 and 100, it generates both OB/OS signals and midline (50) cross over signals and divergences.
As author suggests, bullish/bearish divergences generated by SRSI are not as effective during strong trends. To avoid fading an established trend, the system is used in conjunction with a trend confirmation tool like ADX indicator.
You can configure the OB/OS levels, default are 70/30.
More info:
The slow relative strength index, TASC 2015-07
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers Smoothed Adaptive Momentum [LazyBear]Bored of Ehlers yet? :) I still have plenty of Ehlers in my collection, was thinking of publishing one of his Fishers or Adaptive RVI next, but @ChartArt requested Smoothed Adaptive Momentum (SAM), so here we go...
This is my 200th script (not including the variations and other custom scripts I shared over PM). My complete list of indicators here - bit.ly
Now, about the indicator :)
This smoothed adaptive momentum is straightforward to use (per Ehlers original rules). If it crosses above zero buy the next open, if it crosses below zero sell the next open. Of course, I strongly suggest filtering the signals.
Finally, here's an Ehlers-only chart to help determine where BTC is heading :P
More info:
- Ehlers CG Oscillator:
- Cybernetic Analysis for Stocks and Futures (Ehlers)
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
--Updated chart--
Here's the chart with barcolors ON (forgot to turn it on in the published one)
Ehlers Adaptive CG Indicator [LazyBear]Lets go with another adaptive indicator today. BTW, this is my 199th script (1 more and I am planning to work on my other backlogs).
This is the adaptive version of Ehlers' Center Of Gravity (CG) (already published, check "More info" below). Idea behind making something "adaptive" is to calculate it using dynamic cycle period inputs instead of static setting. In adaptive CG, Ehlers uses the dominant cycle period as the length in computation of alpha.
According to Ehlers this should be more responsive than the non-adaptive version. Buy and sell signals should often occur one bar earlier than for the non-adaptive version.
I have the usual options in place. Check out plain CC for comparison.
Here's a quick comparison between CG and Adaptive CG:
More info:
- Ehlers CG Oscillator:
- Cybernetic Analysis for Stocks and Futures (Ehlers)
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers Adaptive Cyber Cycle Indicator [LazyBear]Another famous Ehlers indicator.
This is the adaptive version of Ehlers' Cyber Cycle (CC) (already published, check "More info" below). Idea behind making something "adaptive" is to calculate it using dynamic cycle period inputs instead of static setting. In adaptive cyber cycle, Ehlers uses the dominant cycle period as the length in computation of alpha.
According to Ehlers this should be more responsive than the non-adaptive version. Buy and sell signals should often occur one bar earlier than for the non-adaptive version.
I have the usual options in place. Check out plain CC for comparison.
More info:
- Cyber Cycle Indicator:
- Cybernetic Analysis for Stocks and Futures (Ehlers)
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers Stochastic CG Oscillator [LazyBear]Another one from Ehlers.
Ehlers likes the idea behind StochRSI so much, he dedicated a full chapter in his book (linked below) on how stoch works with his "superlative" (his words, not mine) indicators. This is stoch of his CG oscillator.
Standard stochastic oscillator uses fixed period for calculations and does not adjust to the constantly changing market cycle length. Stochastic CG Oscillator does not have such a drawback.
Use this like normal stochRSI osc (Uncheck "Fill Osc/Trigger" option, sample chart below)
More info:
- CG oscillator:
- Cybernetic Analysis for Stocks and Futures (Ehlers)
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers MESA Adaptive Moving Average [LazyBear]Another one to add to Ehlers collection.
The MESA Adaptive Moving Average (MAMA) adapts to price movement based on the rate of change of phase as measured by the Hilbert Transform Discriminator. This method features a fast attack average and a slow decay average so that composite average rapidly ratchets behind price changes and holds the average value until the next ratchet occurs. Consider FAMA (Following AMA) as the signal.
Here are some of the options:
Fill MAMA/FAMA region (ribbon mode):
Mark Crossovers:
The above options (along with the bar colors) allow this to be used as a standalone system.
BTW, John Ehlers calls MAMA, "Mother of all Adaptive Moving Averages", lemme know what you think :)
More info:
- MESA Adaptive Moving Average, Stocks and Commodities Magazine, August 2001
- MAMA: www.mesasoftware.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers Simple Cycle Indicator [LazyBear]One of the early cycle indicators from John Ehlers.
Ehlers suggests using this with ITrend (see linked PDF below). Osc/signal crosses identify entry/exit points.
Options page has the usual set of configurable params.
More info:
- Simple Cycle Indicator: www.mesasoftware.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers Instantaneous Trend [LazyBear]One more to add to the Ehlers collection.
Ehlers Instantaneous Trendline, by John Ehlers, identifies the market trend by doing removing cycle component. I think, this simplicity is what makes it attractive :) To understand Ehlers's thought process behind this, refer to the PDF linked below.
There are atleast 6 variations of this ITrend. This version is from his early presentations.
Is this better than a simple HMA? May be, May be not. I will leave it to you to decide :)
I have added options to show this as a ribbon, and to color bars based on ITrend. Check out the options page.
More info:
- ITrend: www.mesasoftware.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers Center of Gravity Oscillator [LazyBear]As part of my "Ehler's Indicators week", here's one more.
CG Oscillator, by John Ehlers, provides a smoothed, essentially zero lag oscillator for identifying market turning points. The "CG" in the name of the oscillator refers to "Center Of Gravity" of the prices over the window of observation.
Entry/Exit are based on the osc/signal crossovers. Enabling the "Color bars" options helps in easily identifying crossovers.
More info:
- CG osc (pdf): www.mesasoftware.com
- TASC Article: traders.com
- Cybernetic Analysis for Stocks and Futures (Ehlers, 2004)
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Premier RSI Oscillator [LazyBear]This is a modified form of PSO (original idea by Lee Leibfarth), to use RSI as the input.
This provides a quick response to changes in market direction. This highly sensitive indicator allows for early anticipation of price turns and can be used to establish definitive trading zones that identify potential trading opportunities.
Entry/Exit rules are the same as PSO. Enabling bar colors makes it easy to identify the entry/exits too (Refer to my comment below for more points to keep in mind regarding colors)
Here's a comparison against normal RSI.
More info:
PSO:
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Ehlers Cyber Cycle Indicator [LazyBear]The Cyber Cycle Indicator, developed by John Ehlers, is used for isolating the cycle component of the market from its trend counterpart. Unlike other oscillators like RSI, Cyber Cycle Indicator's wave has a variable amplitude.
Use the osc/signal crossover for entry/exit points. You can enable highlighting the crossovers by using region fills (via options page). I have also added an option to color the bars based on this.
Actually I have lot of Ehlers indicators in my to-publish backlog, will try to prioritize them over the others in the pipeline. Lets have an Ehlers week for indicators :)
More info:
Cybernetic Analysis for Stocks and Futures
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
ATR Pips [LazyBear]This is ATR in pips. This was requested by user @ElixiumCapital. ATRPIPs in his words:
"ATR PIPs is useful for finding markets with your desired amount of volatility, for example I prefer to trade forex pairs with the highest amount of volatility in the past 5 days, setting the length parameter to 5 days. And setting my stop loss at 25% to 33% of the the indicators value."
I have added options to show a BB around ATR, as well as normal ATR (not in PIPs). All the parameters are configurable.
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
DiNapoli MACD & Stoch [LazyBear] --- Updated: May 19 2015 ----
Applicable only If you are setting up alerts:
I noticed I have switched the plot names. Histo shd be the MACD and DMACD shd be the Signal.
Replace lines 16 & 17 with these to get the correct names. NOTE that no functionality is affected, just the names.
plot(r, style=columns, color=r>0?green:red, transp=80, title="Dinapoli MACD")
plot(s, color=teal, linewidth=2, title="Trigger")
--- Original Description ---
These two indicators are from one of my favorite books - DiNapoli's Levels. These are custom MACD and Stoch used by him. There are more indicators - Detrended Osc, DisplacedMA - that he uses, will publish them all later.
The settings of normal MACD/Stoch can be tuned to obtain these DiNapoli indicators, or if you are lazy (like me!) just use these :)
DiNapoli Preferred Stoch source: pastebin.com
More info:
www.amazon.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Absolute Strength Index Oscillator [LazyBear]This oscillator is derived from Absolute Strength Index, originally developed by Tudor Marcelin (Art Invest).
I made it an oscillator mainly to make it easy to identify the divergences and price-flows. There is not much documentation available online for Absolute Strength Index afaik, lets hope Mr.Tudor comes across this and provides us a detailed writeup :)
Quick testing showed lots of good signals (with minimal lag). Let me know what you guys find in your testing.
Indicator options support coloring bars based on the oscillator/signal values, and a histogram-only mode.
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Composite Momentum Index [LazyBear]This is a composite oscillator derived from modified 5/10/20 Chande's Dynamic Momentum Index values.
Volatility is factored in, by design. Look for OB/OS extremes and divergences.
I added the green/red ribbon look to make it easy to read :)
More info:
www.investopedia.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
High-Low Index [LazyBear]-- Fixed ---
Source: pastebin.com
Fixes an issue with "Combined" mode, using wrong symbols.
--- Original ---
The High-Low Index is a breadth indicator based on Record High Percent, which is based on new 52-week highs and new 52-week lows.
Readings below 50 indicate that there were more new lows than new highs. Readings above 50 indicate that there were more new highs than new lows. 0 indicates there were zero new highs (0% new highs). 100 indicates there was at least 1 new high and no new lows (100% new highs). 50 indicates that new highs and new lows were equal (50% new highs).
Readings consistently above 70 usually coincide with a strong uptrend. Readings consistently below 30 usually coincide with a strong downtrend.
More info:
stockcharts.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Just noticed @Greeny has already published this -> Linking it here.
Zweig Market Breadth Thrust Indicator [LazyBear]The Breadth Thrust (BT) indicator is a market momentum indicator developed by Dr. Martin Zweig. According to Dr. Zweig a Breadth Thrust occurs when, during a 10-day period, the Breadth Thrust indicator rises from below 40 percent to above 61.5 percent.
A "Thrust" indicates that the stock market has rapidly changed from an oversold condition to one of strength, but has not yet become overbought. This is very rare and has happened only a few times. Dr. Zweig also points out that most bull markets begin with a Breadth Thrust.
All parameters are configurable. You can draw BT for NYSE, NASDAQ, AMEX or based on combined data (i.e., AMEX+NYSE+NASD). There is also a "CUSTOM" mode supported, so you can enter your own ADV/DEC symbols.
More info:
Definition: www.investopedia.com
A Breadth Thrust Signal: www.mcoscillator.com
A Rare "Zweig" Buy Signal: www.moneyshow.com
Zweig Breadth Thrust: recessionalert.com
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Firefly Oscillator [LazyBear]This is a modified version of a public Amibroker indicator, called Firefly.
I disabled the additional smoothing (you can enable it via options page) and updated the visual rendering (simple 3D look, histo, bar colors et al). Also, have added an option to show enclosing BB.
You can trade this like any other oscillator -- 80/20 OB/OS levels, divergences, ...
Here's a chart showing some possible customizations that are supported:
Do let me know what you guys think.
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com