Bollinger bubble | Forex editionBollinger bubble is an edition for forex market. Work better en JPY pairs.
We buy when a candle open & close outside the lower bollingers band and we target the last highest point on the last 10 candles.
And we sell when a candle open & close outside the higher bollingers band we the target the last lowest point on the last 10 candles.
Volatility
Bollinger bubble | Stock EditionBollinger bubble is an edition for market like CAC40, DJ30, ..
The market are uptrend with the inflation, this edition only buy (you have less risk then sell)
We buy when a candle open & close outside the lower bollingers band and we target the last highest point on the last 10 candles.
PROSTRATS Pine Script for Swing TradingThis is a simple script for swing trading. It uses my 2 favorite indicators; the Choppiness Index as well as Fibonacci Retracement. This script is meant to run on the 4 hour time frame, in my case I use BTCUSD. It will buy when 2 conditions are met. The first is that the Choppiness Index is above 54.5 on the Daily Time frame, which means the price has potential to swing high or low. I used the security() function to ensure this takes place on the daily time frame because larger time frames tend to dominate smaller time frames in terms of overall swings. The second condition is that the price has to cross above the 1 level of the Fibonacci Retracement. This ensures that the swing is going to be an upwards swing, as opposed to a downwards one. The measure I took to ensure that the Fibonacci Retracement level of 1 is above the 0 level is to make sure that the r value of the 1 level is greater than the r value of the 0 level.
The sell condition is programmed to execute when either the price crosses above the 1.618 level(profit target) or cross below the 0 level(stop loss).
Bollinger Band with RSI
Using combination bollinger band and RSI indicator as guide to predict price volatility and the best entry point. The strategy logic is pretty straightforward where we're interested with close price that touches the lower bollinger band ; there are only two scenarios that will happened after the price reaches the lower band; the price might rebound from the lower bollinger band or drop lower and continue downtrend. To confirm the price movement, we use a second indicator which is the RSI to further investigate the price trend. For example, if the price reaches the lower bollinger band but the RSI value is not in the oversold region, we can conclude that the price will go lower and continue downtrend. If the RSI value is in the oversold region, we can use this price area as our entry point.
Stop loss is necessary to avoid losing too much capital if the RSI value lingers too long in the oversold region.
Best take profit area is when the price rebound above the middle bollinger band area/upper bollinger band or when the RSI reaches overbought region; whichever comes first.
Long entry:
RSI < 30 & close price < lower bollinger band
Exit entry:
RSI > 70
Default stop loss: -25%
B-Xtrender [Backtest Edition] @QuantTherapyToday I have published a Backtest edition of one of my scripts.
For anyone looking into the indicators please have in the source below where the logic behind the indicator is nicely explained also the source of the inspiration of me coding it in tradingview.
ifta.org
Strategy
Entry when both bars are in alignment both green = long / both red = short
Exit when one is against your direction of trade
TSL will also kick in and exit when the percentage is breached
Moving Average is there to filter entries. Will allow entry only when active when the price is above (long-only) or below ( short-only )
Hope you are having a great day !
Moving Regression Band Breakout strategyFollowing the introduction of the Moving Regression Prediction Bands indicator (see link below), I'd like to propose how to utilize it in a simple band breakout strategy :
Go long after the candle closes above the upper band . The lower band (alternatively, the lower band minus the 14-period ATR or the central line ) will serve as a support line .
Exit as soon as the candle closes below the support line .
To manage the risk of false breakouts, a fixed stop loss is set to the value of the support line at the time of opening a position. When the support line moves above the position opening price, shift the stop loss to breakeven.
The same logic but in reverse applies to short positions.
As an option, it is possible to allow long entries only when the slope of the Moving Regression curve is positive (and short entries when the slope is negative).
Model parameters:
Length and Polynomial Order define the lag and smoothness of the model.
Multiplier specifies the width of the channel.
As the default model parameter values, I set those that I found to provide optimal risk / reward ratio on the daily timeframe (for both trending and range-bound market). However, the settings are very flexible and can be well-adjusted to particular market conditions. Feel free to play around and leave feedback in the comments!
Here's the original Moving Regression Prediction Bands script:
Please help to make Larry Williams' volatility breakthrough.Hello Traders!
I'm going to backtest Larry Williams' volatility breakthrough strategy.
However, contrary to my expectation, orders at certain bars are made the next day.
Is there anything I missed at my pine script code?
Please give me any tiny tips.
Thank you!!
RSI-VWAP Indicator %█ OVERALL
Simple and effective script that, as you already know, uses vwap as source of the rsi, and with good results as long as the market has no long-term downtrend.
RsiVwap = rsi (vwap (close), Length)
The default settings are for BTC in a 30 minute time frame. For other pairs and time frames you just have to play with the settings.
█ FEATURES
• The option to start trading from a certain date has been added.
• To make the profit more progressive, a percentage of your equity is used for entries and a percentage of your position is used for closings.
• The option to trade in Spot mode has been added, since, for the TradingView backtest, the money is infinite and if you do not limit it somehow,
it would offer you much better profits than the live trading.
QuantityOnLong = Spot ? (EquityPercent / 100) * ((strategy.equity / close) - strategy.position_size) : (EquityPercent / 100) * (strategy.equity / close)
• The option to stop the system when the drawdown exceeds the fixed limit has been added.
Drawdown, as you already know, is a very important measure of risk in trading systems.
The maximum drawdown will tell us what the maximum loss of a trading system has been during a period. This maximum loss is determined by:
strategy.risk.max_drawdown(Risk, strategy.percent_of_equity)
• Leverage plotted on labels added.
█ ALERTS
To enjoy the benefits of automatic trading, TradingView alerts can be used as direct buy-sell orders on spot, or long-close orders with leverage.
Currently there are Chrome extensions that act as a bridge between TradingView and your Exchange or Broker.
This is an example of syntax for this type of extensions. Copy and paste a message like this into the alert window:
{{strategy.order.action}} @ {{strategy.order.price}} | e = {{exchange}} a = account s = {{ticker}} b = {{strategy.order.action}} {{strategy.order.alert_message}}
█ NOTE
Certain Risks of Live Algorithmic Trading You Should Know:
• Backtesting cannot assure actual results.
• The relevant market might fail or behave unexpectedly.
• Your broker may experience failures in its infrastructure, fail to execute your orders in a correct or timely fashion or reject your orders.
• The system you use for generating trading orders, communicating those orders to your broker, and receiving queries and trading results from your broker may fail.
• Time lag at various point in live trading might cause unexpected behavior.
• The systems of third parties in addition to those of the provider from which we obtain various services, your broker, and the applicable securities market may fail or malfunction.
█ THANKS
Thanks to TradingView, its Pine code, its community and especially those Pine wizards who post their ideas that helps us to learn.
If the world is heading toward a equitable new world economic order, let's get rich first ...
Happy trading!
KAMA Strategy - Kaufman's Adaptive Moving AverageThis strategy combines Kaufman's Adaptive Moving Average for entry with optional KAMA, PSAR, and Trailing ATR stops for exits.
Kaufman's Adaptive Moving Average is, in my opinion, a gem among the plethora of indicators. It is underrated considering it offers a solution that intuitively makes a lot of sense. When I first read about it, it was a real 'aha!' moment. Look at the top, pink line. Notice how during trending times it follows the trend quickly and closely, but during choppy, non-trending periods, the KAMA stays absolutely flat? Interesting! To trade with it, we simply follow the direction the KAMA is pointing. Is it up? Go long. Is it down? Go short. Is it flat? Hold on.
How does it manage to quickly follow real trends like a fast EMA but ignore choppy conditions that would whipsaw a fast EMA back and forth? It analyses whether recent price moves are significant relative to recent noise and then adapts the length of the EMA window accordingly. If price movement is big compared to the recent noise, the EMA window gets smaller. If price movement is relatively small or average compared to the recent noise, the EMA window gets bigger. In practice it means:
The KAMA would be flat if a 20 point upwards move occurred during a period that has had, on average, regular 20 point moves BUT
the KAMA would point up if a 20 point move occurred during a period that has, on average, had moves of only around 5 points.
In other words, it's a slow EMA during choppy flat / quiet flat periods, and a fast EMA as soon as significant volatility occurs. Perfect!
-----
The Strategy
The strategy is more than just a KAMA indicator. It contains:
KAMA exit (optional)
ATR trailing stop loss exit (optional)
PSAR stop loss exit (optional)
KAMA filter for entry and exits
All features are adjustable in the strategy settings
The Technical Details:
Check out the strategy's 'Inputs' panel. The buy and sell signals are based on the 'KAMA 1' there.
KAMA 1: Length -- 14 is the default. This is the length of the window the KAMA looks back over. In this instance, it c
KAMA 1: Fast KAMA Length -- 2 is the default. This is the tightest the EMA length is allowed to get. It will tend towards this length when volatility is high.
KAMA 1: Slow KAMA Length -- 20 is the default. This is the biggest the EMA length is allowed to get. It will tend towards this length when volatility is low.
KAMA Filter
The strategy buys when the KAMA begins to point up and sells when the KAMA points down. Generally, the KAMA is very good at filtering out the noise itself - it will go flat during noisy/choppy periods. But to add another layer of safety, its author, Perry Kaufman, proposed a KAMA filter. It works by taking the standard deviation of returns over the length of the the 'KAMA 1: Length' I mentioned above and multiplying it by an 'Entry Filter' (1 by default) and 'Exit Filter' (0.5 by default). The entry condition to go long is that the KAMA is pointing up and and it moved up more than 1 x St. Dev. of Returns. The exit condition is when the KAMA is pointing down and it moved down by more than 0.5 x St. Dev. of Returns.
Thanks
Thanks to ChuckBanger, cheatcountry, millerrh, and racer8 for parts of the code. I was able to build upon their good work.
-----
I hope this strategy is helpful to you.
Do you have any thoughts, ideas, or questions? Let me know in the comments or send me a message! I'd be glad to help you out.
If you need an indicator or strategy to be built or customised for you, let me know! I'll be glad to help and it'll probably be cheaper than you think!
MACD 50x Leveraged Strategy Real Equity Simulation Hello, I wrote this script to merge the two scripts I shared before.
The aim here is to see the real value of the state of the capital as a result of leveraged transactions and to combine both long and short directions.
Scripts :
MACD Long 50x Leverage Strategy :
MACD Short 50x Leverage Strategy :
The parameters have not changed so they are the same as the previous two scripts:
Adding margin: Forbidden or not specified. (Add Margin : No)
Position Size : %1 (0.01) (For each trade)
Stop-Loss : %2 (For each trade)
Long : Crossover(delta,0) (Standard MACD)
Long Exit : Long Stop Level or Short Entry
(In the case of Long Stop, all trades are closed and no positions are opened in short direction.)
Short : Crossunder(delta,0) (Standard MACD)
Short Exit : Short Stop or Long Entry
(In the case of Short Stop, all trades are closed and no positions are opened in the long direction.)
NOTE :
This is a simulation made using standard parameters, showing the state of the balance in very simple rules with leveraged transactions only.
The nice thing here is the direct observation of the results by making modifications on the strategy parameters.
Regards.
Built-in Kelly ratio for dynamic position sizingThis is the defaut keltners channel strategy with a few additions.
The main purpose is to show how we include the Kelly ratio into our scripts for dynamic position sizing based on the performance of the strategy on a per trade basis.
We've also included the usual take-profit and stop-loss parameters in the event you want to play a little :)
We hope this helps you advance your personal system.
Happy Trading!
LAGging span leaves Bollinger Bands strategyAbstract
This script points out the positions a lagging span leaves a Bollinger Band.
This script does not plot a lagging span but moves the Bollinger Band forward.
You can find profit opportunities by combining this script and risk management.
Introduction
Bollinger Bands is a popular indicator.
It contains a moving average, an upper band and a lower band.
The moving average can indicate trend, the upper band and the lower band can indicate if the price is far away from the moving average.
However, in trading markets, anything can happen.
Both continuation and reversal are possible when the price touches the moving average, the upper band or the lower band.
Therefore, many traders adjust the parameters of the Bollinder Band or add other indicators to improve their trading strategies.
@Daveatt et. al. provided an idea that uses a lagging span.
A lagging span is a line chart. It displays the reference price but in earlier time.
For example, if the offset of a lagging span is 26 days, the value of the lagging span on 29 days ago is the reference price 3 days ago.
A lagging span is a part of Ichimoku Cloud.
It can compare the price to the earlier price and the values of indicators in the past.
To compare the price to the values of indicators in the past, we can also shift indicators forward instead of adding a lagging span into the chart.
This script uses shift-the-indicators-forward method.
In other words, this script plots the Bollinger Band forward so that the price can be compared to the values of the Bollinger Band in the past.
Computing and Adjusting
(1) Compute Moving Average
(2) Compute Standard Derivation
(3) Upper Band = Moving Average + Standard Derivation * Multi
(4) Lower Band = Moving Average - Standard Derivation * Multi
(5) Shift the Bollinger Band forward according to the offset parameter.
(6) Mark the points the price leaves the shifted Bollinger Band
(7) Compute the most possible loss and profit before the next opposite signal.
Parameters
source : the data for computing the bollinger band. can be open, high, low, close or their combination.
length : how many days are calculated by the bollinger band
mult : the distance from the moving average to the upper band and the distance from the moving average to the upper band is equal to ( mult * standard derivation ) .
x_offset : the offset of the lagging span
Conclusion
This script can find signals for potential breakout or trend continuation.
If you want to use this signal well, you need to know when to cut loss and protect the profit.
Reference
@Daveatt , Bollinger bands/Lagging span cross , BGyrPgOA , Tradingview 2019
How to trade with Bollinger Bands
How to use Ichimoku Cloud
How to trade with a line chart
MA Candles Supertrend StrategySimple strategy which is derived by below method:
1. Calculate moving average of High, Low, Open and Close and make candles of them.
2. Derive supertrend on the moving average candles.
3. Generate buy and sell signals based on supertrend direction combined with higher timeframe high-low condition
JetzGiantz StrategyThe algorithm for this strategy was provided by JetzGiantz.
It creates buy and sell signals based on the close and open prices of the previous 3 bars, and compares them to the lowest low, or highest high, between the last 3 and 50 bars.
You can select the month and year you wish to backtest.
You can enter the SL and TP values.
There are no other inputs.
Fancy Bollinger Bands Strategy [BigBitsIO]This script is for a Bollinger Band type indicator with built-in TradingView strategy including as many features as I can possibly fit into a Bollinger Band type indicator including a wide variety of options to create the most flexible Bollinger Bands strategy possible.
Features:
- A single custom moving average serving as the middle band.
- Standard MA inputs.
- MA type.
- MA period.
- MA price.
- MA resolution (time frame).
- Visibility toggle.
- MA Candle Type
- Fancy MA inputs.
- Toggle to show only candles included in the MA calculation ("Highlight inclusion") or display entire MA history.
- Toggle to show a ghost trail when Highlight inclusion is toggled on. Displays a shaded version of past MA history before the inclusion period (as seen on snapshot).
- Toggle to show forecast values for the MA.
- Other inputs related to forecasting:
- Forecast bias. (Neutral forecasts MA if the current price remains the same.)
- Forecast period.
- Forecast magnitude.
- Toggle showing details on the screen
- Toggle the visibility of the fill between the upper and lower bands.
- Toggle to use ATR instead of the standard deviation to calculate the location of the upper and lower bands.
- Custom input for the ATR period.
Strategy Features
-Strategy Window - only test during this window
-Take Profit and Stop Loss
-Open and Close conditions, including condition counts and any/all requirements
-Many conditions to choose from that can either be selected to open, close or open and close a position
-Conditions include:
-Price crossing above/below the Upper, Middle, or Lower bands
-Price being above/below the Upper, Middle, or Lower bands
-Bollinger Band width crossing or being above/below custom values
-Percent B crossing or being above/below custom values
This script may contain errors, or out of date code. Please be mindful of updates to the script.
*** DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB. ***
Volatility Bands Reversal Strategy [Long Only]This strategy based on existng indicator available on TV
If finds the reversals for LONG entries ... I have modified the settings to back test it ...
BUY
====
When the price touches lower band , and tries to close above lower band
some signals are mixed up, you can research and look for a confirmation ...
if the middle band is above EMA50 , you can simply follow the strategy BUY signal
but if the middle band is EMA50 , wait for the price to close above middle band
Sell / Close
==========
wait for the sell signa OR close when price touches the upper band
How do you want to close , you can chose in settings. Chnage these values and see the performance
Please note , sell means just closing the existing LONG position , not short selling
Stop Loss
=========
Stop Loss is defaulted to 6%
This is tested in 1HR, 2HR and 4 HRs chart for SPY and QQQ ETFS ...
for long term investing style , 4 Hrs is the best time frme for this strategy
Warning
========
It is not a financial advise , it is for educational purposes only. Please do your own research before taking any trading decission
Advanced Bollinger Bands StrategyAdvanced Bollinger Bands Strategy
Why is it an advanced Bollinger Bands Strategy?
The purpose of Bollinger Bands is to provide a relative definition of high and low prices of a market. By definition, prices are high at the upper band and low at the lower band. This definition can aid in rigorous pattern recognition and is useful in comparing price action to the action of indicators to arrive at systematic trading decisions. Adding a Moving Average filter which only allows trades if MA and Price are outside of the BB increases the probability of profitable trades with the sacrifice of a lower trade-frequency.
Inputs for Bollinger Bands
-> BB Source
-> BB Length
-> BB Multiplier
-> Moving Average Period
-> Moving Average Source
-> Strategy Condition Options:
-> Exit Trades if Price crosses Basis Line
-> Enable Moving Average Filter
VBand StrategyVBand Strategy is simply used Vwap funcation and atr 14 for find the entry and exit points. This simple Strategy.
SPAS - Single Price Action StrategyThis strategy is based on a single price action analysis, where volume and price changes will trigger buy and sell orders. This strategy also can be used in combination with alerts to trigger orders in other exchanges or systems.
Best performance is currently achieved using 4H timeframe.
scalping low lag tema etalCredit for original idea goes to 1 min forex scalping by mikegoryunov
Changes include several lower lag filters (See line 3 for a list)
and values for profit, loss, and trail_points (See lines 48:53)
a, b, & c represent fast, medium, and slow filters. Basic idea is to monitor
crossovers of the three filters to determine buy/sells. Exits occur quickly within
the next time interval.
Note that this may be used for stocks and forex. The time interval can vary widely.
I have concerns about how to incorporate transaction costs with so many transactions.
Crypto Long only Strategy 3h+ timeframeToday I bring another crypto strategy that works greatly with pairs like BTCEUR, ETHEUR, for 3h+ time frames.
Its a risky strategy because we have a hard stop loss of 25% of our capital which can be modified.
The idea behind its simple, we have a candle which is made from open+high+low+close / 4 , and we make the decision based on this one.
We only go long with this strategy .
For entry: if we have 5 ascending candles we enter, and we exit when we have 4 descending candles.
For this example, I used 100% of the initial capital(1000 EUR/USD), with a commission of 0.1% per each deal.
At the same time, the max capital that can be lost in a trade is going to be the equity risk, in this example 25% .
Overall we can see that's more or less around the same level as buy and hold strategy
Buy - Take Profit OR Stop Loss % BasedScript looks back for a certain period of time and than enter when price close above that look back period ema. Once enter it does not care for how many times price cross above or below. Once entered, it will either hit percenatage based take profit of stop loss.