Grid Like StrategyIt is possible to use progressive position sizing in order to recover from past losses, a well-known position sizing system being the "martingale", which consists of doubling your position size after a loss, this allows you to recover any previous losses in a losing streak + winning an extra. This system has seen a lot of attention from the trading community (mostly from beginners), and many strategies have been designed around the martingale, one of them being "grid trading strategies".
While such strategies often shows promising results on paper, they are often subjects to many frictions during live trading that makes them totally unusable and dangerous to the trader. The motivations behind posting such a strategy isn't to glorify such systems, but rather to present the problems behind them, many users come to me with their ideas and glorious ways to make money, sometimes they present strategies using the martingale, and it is important to present the flaws of this methodology rather than blindly saying "you shouldn't use it".
Strategy Settings
Point determines the "grid" size and should be adjusted accordingly to the scale of the symbol you are applying the strategy to. Higher value would require larger price movements in order to trigger a trade, as such higher values will generate fewer trades.
The order size determines the number of contracts/shares to purchase.
The martingale multiplier determines the factor by which the position size is multiplied after a loss, using values higher to 2 will "squarify" your balance, while a value of 1 would use a constant position sizing.
Finally, the anti-martingale parameter determines whether the strategy uses a reverse martingale or not, if set to true then the position size is multiplied after any wins.
The Grid
Grid strategies are commons and do not present huge problems until we use certain position sizing methods such as the martingale. A martingale is extremely sensitive to any kind of friction (frictional costs, slippage...etc), the grid strategy aims to provide a stable and simple environment where a martingale might possibly behave well.
The goal of a simple grid strategy is to go long once the price crossover a certain level, a take profit is set at the level above the current one and stop loss is placed at the level below the current one, in a winning scenario the price reach the take profit, the position is closed and a new one is opened with the same setup. In a losing scenario, the price reaches the stop loss level, the position is closed and a short one is opened, the take profit is set at the level below the current one, and a stop loss is set at the level above the current one. Note that all levels are equally spaced.
It follows from this strategy that wins and losses should be constant over time, as such our balance would evolve in a linear fashion. This is a great setup for a martingale, as we are theoretically assured to recover all the looses in a losing streak.
Martingale - Exponential Decays - Risk/Reward
By using a martingale we double our position size (exposure) each time we lose a trade, if we look at our balance when using a martingale we see significant drawdowns, with our balance peaking down significantly. The martingale sequence is subject to exponential growth, as such using a martingale makes our balance exposed to exponential decays, that's really bad, we could basically lose all the initially invested capital in a short amount of time, it follows from this that the theoretical success of a martingale is determined by what is the maximum losing streak you can endure
Now consider how a martingale affects our risk-reward ratio, assuming unity position sizing our martingale sequence can be described by 2^(x-1) , using this formula we would get the amount of shares/contracts we need to purchase at the x trade of a losing streak, we would need to purchase 256 contracts in order to recover from a losing streak of size 9, this is enormous when you take into account that your wins are way smaller, the risk-reward ratio is totally unfair.
Of course, some users might think that a losing streak of size 9 is pretty unlikely, if the probability of winning and losing are both equal to 0.5, then the probability of 9 consecutive losses is equal to 0.5^9 , there are approximately 0.2% of chance of having such large losing streak, note however that under a ranging market such case scenario could happen, but we will see later that the length of a losing streak is not the only problem.
Other Problems
Having a capital large enough to tank 9any number of consecutive losses is not the only thing one should focus on, as we have to take into account market prices and trading dynamics, that's where the ugly part start.
Our first problem is frictional costs, one example being the spread, but this is a common problem for any strategy, however here a martingale is extra sensitive to it, if the strategy does not account for it then we will still double our positions costs but we might not recover all the losses of a losing streak, instead we would be recovering only a proportion of it, under such scenario you would be certain to lose over time.
Another problem are gaps, market price might open under a stop-loss without triggering it, and this is a big no-no.
Equity of the strategy on AMD, in a desired scenario the equity at the second arrow should have been at a higher position than the equity at the first arrow.
In order for the strategy to be more effective, we would need to trade a market that does not close, such as the cryptocurrency market. Finally, we might be affected by slippage, altho only extreme values might drastically affect our balance.
The Anti Martingale
The strategy lets you use an anti-martingale, which double the position size after a win instead of a loss, the goal here is not to recover from a losing strike but instead to profit from a potential winning streak.
Here we are exposing your balance to exponential gross but you might also lose a trade at the end a winning streak, you will generally want to reinitialize your position size after a few wins instead of waiting for the end of a streak.
Alternative
You can use other-kind of progressions for position sizing, such as a linear one, increasing your position size by a constant number each time you lose. More gentle progressions will recover a proportion of your losses in a losing streak.
You can also simulate the effect of a martingale without doubling your position size by doubling your target profit, if for example you have a 10$ profit-target/stop-loss and lose a trade, you can use a 20$ profit target to recover from the lost trade + gain a profit of 10$. While this approach does not introduce exponential decay in your balance, you are betting on the market reaching your take profits, considering the fact that you are doubling their size you are expecting market volatility to increase drastically over time, as such this approach would not be extremely effective for high losing streak.
Conclusion
You will see a lot of auto-trading strategies that are based on a grid approach, they might even use a martingale. While the backtests will look appealing, you should think twice before using such kind of strategy, remember that frictional costs will be a huge challenge for the strategy, and that it assumes that the trader has an important initial capital. We have also seen that the risk/reward ratio is theoretically the worst you can have on a strategy, having a low reward and a high risk. This does not mean that progressive position sizing is bad, but it should not be pushed to the extreme.
It is nice to note that the martingale is originally a betting system designed for casino games, which unlike trading are not subject to frictional costs, but even casino players don't use it, so why would you?
Thx for reading
GRID
[HM] HORIZONTAL GRID ROUNDED (VOLATILITY BASED)The purpose of this indicator is to draw a horizontal grid having in mind:
- rounded price levels instead tradingview standard grid, zoom-based;
- calculated by volatility, using daily ATR;
- independent of timeframe in use, locked to DAILY calculations.
Further improvements are intended.
Wish this could be useful. Any questions, feel free to comment.
CoGrid ManagementThis strategy uses grid levels determined by pivot points based on the selected time period.
It's useful for swing trading without leverage, spot trading or for Hold management.
If the price goes down we buy and if it continues to go down we keep buying improving the average price.
When the price rises above the average entry price, we sell and if it continues to rise, we continue to sell.
It works for any pair as long as Buys and Sells quantities are adjusted correctly.
In these times of great economic change, good luck to everyone 🍀
BoilerRoomColdCaller - 3Commas Grid Bot SignalThis is very similar to 3Commas' grid bot, the range is from the previous 7 days' lowest low decreased by 3% to the previous 7 days' highest high increased by 3%, you can also adjust if you want 7 days' highest/lowest close price as your range or highest high and lowest low as your range. 10 buys and 10 sells within the range, the unit price would be (high-low)/19.
The buy signals and the sell signals will be triggered if:
- The previous close is below one specific green line (buy line), and the current close is above that specific green line, or
- The previous close is above one specific green line (buy line), and the current close is below that specific green line
Thus, whether the price is dropping below these lines or rising above these lines, a buy or sell signal will be triggered when they cross green or red lines. Your entry price will be the next open price after this candle's close reaches the lines.
Big thanks to @glaz, who helped me a lot with this script. Please give a like button and share if you like this script. Let me know if you have questions, thanks guys.
Cyato Grid Basic Buy & Sell [BACKTEST]Private indicator
This Grid bot strategy creates buy orders when the price goes down one level or more, and sell order when the price goes up one level or more.
To avoid useless trades, the lastest traded level is disabled until another level is crossed.
To create the grid, one upper level and one lower level is calculated. Those 2 levels are either given by the user using "MANUAL" mode or automatically calculated by an AI. The space between these two levels are then divided equally into several steps, creating the grid. The number of steps is chosen by the user, from 3 to 20.
HOW IT WORKS
This is the Backtest version meaning this is the one you should use with the Strategy Tester (more below).
Select either "MANUAL" or "AI" mode.
When using "MANUAL", you have to configure an upper level and a lower level.
When using "AI", the upper and lower level are automatically calculated from last 7 days high/low plus a 3% deviation. You can configure the timeframe and the deviation.
Select the grid quantity, from 3 to 20.
Example with 3:
Example with 10:
Example with 20:
You can choose between "Once Per Bar Close" or "Once Per Bar" alert type.
"Once Per Bar Close" will wait candle close to confirm a trade.
"Once Per Bar" will trigger a trade if the price crossed a step anytime inside a candle. Note that the backtest will still use bar close price in its calculation.
BACKTESTING
The strategy will buy 1 contract when a BUY signal appears and sell 1 contract when a SELL signal appears.
Here 1 contract = 1 BTC
The strategy can buy up to 20 contracts. Pyramiding is enabled.
The Backtest info panel is here to show how many trades are open in the backtest.
I know very well that a backtest has no value if several trades are left open. That is why I coded a feature to close all open trades at once on the last candle. This feature can be turned on and off.
To get this indicator, use the link in my signature below, thanks!
Cyato Grid Basic Buy & Sell [ALERTSETUP]Private indicator
This Grid bot strategy creates buy orders when the price goes down one level or more, and sell order when the price goes up one level or more.
To avoid useless trades, the lastest traded level is disabled until another level is crossed.
To create the grid, one upper level and one lower level is calculated. Those 2 levels are either given by the user using "MANUAL" mode or automatically calculated by an AI. The space between these two levels are then divided equally into several steps, creating the grid. The number of steps is choosen by the user, from 3 to 20.
How it Works
This is the Alert Setup version meaning this is the one you should use to create alerts (more below).
Select either "MANUAL" or "AI" mode.
When using "MANUAL", you have to configure an upper level and a lower level.
When using "AI", the upper and lower level are automatically calculated from last swing high/low.
Select the grid quantity, from 3 to 20.
Example with 3:
Example with 10:
Example with 20:
Creating the Alerts
When opening the alert popup, select "Cyato Grid" in the condition.
Make sure to use the option "Once per bar close" in order to stay in sync with the graphics on chart. (Only use "Once per bar" if you really know what you are doing).
Available alerts:
- BUY : Buy alert. Green label on chart.
- SELL: Sell alert. Red label on chart.
To get this indicator, use the link in my signature below, thanks!
Example - How to create multiple level gridsExample on how to create custom grids with variable N lines/labels:
ck - 3commas GRID bot VisualisationHi,
This is a very quick script indicator to show the “grid” for an active (or one you are planning to manually configure) 3commas Grid bot.
To use, you’ll need to go to your Grid bot page in 3commas and enter the Upper and Lower Limit Values, either from the “manual” section if you are planning a new Grid bot, or from an open Grid trade by clicking the monthly button and using the Upper value (in green) and the Lower value (in red).
Have fun!
Multi Bar OHLC Compare Panel (Floating Grid)Multi Bar OHLC Compare Panel by RagingRocketBull 2019
version 1.0
This indicator lets you compare OHLCV values from several specified bars. Bars can be dynamic/persistent.
You can also use it as an alternate OHLC panel if you don't like small font of the native TradingView panel.
It uses Pinescript v4 to output data dynamically as string labels in a horiz/vertical grid.
Features:
- Floating Panel with customizable horiz/vertical layout and grid spacing
- Support for up to 5 OHLC bars (highlighted with markers)
- Outputs Bar #/index, OHLCV, Bar Change Value/%, Exchange/Ticker, Timeframe, Timestamp strings
- Dynamic (fixed offset)/Persistent bars (fixed time)
- Show/Hide parts of strings
- Full output string customization, including text size, date/time format and delimiters
- 2 Anchor points for panel offset: cur bar high or range high
- Bar Change can change color
Usage:
- specify at least 1 bar index as OHLC source
- select anchor point to position the panel
- select horiz/vertical grid layout
- adjust horiz/vertical spacing
- customize output strings as needed
Notes:
- this indicator uses Pinescript v3 Compatibity Framework
- both bars 1,2 are required for log scale adjustment to work
- you can't attach the panel to screen's top/bottom and must use offset/anchor because, unlike plotshape, string labels don't support yloc=yloc.top/bottom, only yloc.above/belowbar
- you can't precisely align strings in a grid because there's no label.get_width/height to calculate mid/left points, only get_x/y/text. Alignment will break depending on string length, zoom and change color option on/off
- bar change is rendered as a separate label when change color is enabled (2 panels total) and merged into the main panel when disabled (single panel)
- you can't change the order of strings as playing with the natural order of things isn't the best of ideas
- you can modify the script to compare up to 50 OHLC bars, but do you need that much power? Of course, you do.
- you can't set color/style for string labels in Style UI, so a few extra settings were added.
- bar index is limited to 5000 for free accounts (10000 for paid), will show an error when exceeded, also when it exceeds the total number of bars in history
- in persistent bars mode all bars with index > 0 are considered persistent, bar 0 always remains a dynamic bar
- persistent bars' offset is reset: in replay mode on exit or when price reaches cur bar, or when panel layout is changed from h to v in both replay/realtime modes
- initial pos of each persistent bar relative to the first realtime bar anchor doesn't change during session - new persistent bars introduced during session are attached to the most recent cur bar anchor
P.S. Everything is proceeding as I have foreseen
Gann GridA script to draw Gann Grid given Cycle start point, Cycle space (size), Cycle type ( Bullish / Bearish ), Cycle shape, Time levels space and Grid size
The lines are customizable you can change their style and color
When you increase the size you may see that the Grids at the beginning are getting removed, that's pretty normal because TradingView has a limit of 55 line per indicator you won't need the old grids anyway but if you want you can decrease the size and they will show again
My Telegram :- @Kirolos_T
GRID RELOADED 1.0Script for grid trading on Bitmex XBTUSD 5min
A quick description for the input parameters. I can detail privately the ones that are important:
Points between two same dir trades = how much the price must change before a new DCA can happen
Points between SHORTS = same for short trades
Global Take Profit points = take profit for all open positions expressed in the same units as the price
Global Stop Loss points = same as for profit
Take Profit points decrease per bar = this is how much the target global profit decreases each bar toward zero
Trend up to start a trade long = wait for the DEMA to show a long slope before opening new long positions
Max long position = max n. of long positions
Check trend on trade = wait for a positive/negative bar before long/short
Min Stochastic overbought/sold for trade = wait for the stochastic to be below/above this before long/short
Limit Orders long % below close price = place limit orders % before current price. the order could be left pending.
DEMA 1 Length = periods of DEMA for trends
HA Candles = toggle a pattern match to enter trades
RSI_GridUses oversold/overbought conditions of RSI on multiple time frames to provide buy/sell signals.
Important points:
1. The highest time frame of the grid should be the one you are viewing on the chart. This helps avoid false signals.
2. The time frame inputs work on minutes, so if you want a 2 hour time frame you should input 120.
3. This DOES re-paint, but only up to the highest tf. For example, using the default settings, you should have a 1H chart and refresh the chart with F5 each hourly candle switch.
4. The red indicates oversold, green is overbought, grey is within normal range. The default alert condition is 4, this means when 4 time frames print overbought/sold and the next candle prints with less than 4 in an overbought/sold condition, an alert will trigger.
5. Pink is buy, blue is sell.
This is still a work in progress, but I kind of abandoned it once I realised how Tradingview plots indicators based on two different times (past and present). I can link an article if you are interested in the reasons why TV does this.
🕟𝕄🕗𝕋🕛𝔽 Madness MTF Grid by 🇨🇷🇾🇵🇹🇴🇷🇹🇭🇾🇭🇲🇸Here is a short description. This indicator being free will not have documentation for ALL things. Just the basics. There are 5 indicators included in it which I will not go into how each one works. There is ALOT of info on all the indicators included in here, just use google for that.
📊For each "row" of colored bands this represents one indicator. This is meant to be used on the 15m (or less) timeframe, and it looks up into higher TF's. It is meant to be maximized, so have this open in one tab and the chart on another. Dual Monitors are best. All options and Time frames are fully configurable inputs.
📈Indicators from top to bottom are:
1.)Polarity Filtration - 6 Timeframes
2.) Price Volume Trend - 4 Timeframes
3.) Stochastic RSI - 4 Timeframe Grid, and Current Timeframe in lines/ribbons
4.) MACD Crossovers - 8 Timeframes
5.)SuperTrend - 4 Timeframes
⏲Inside each larger "band" there are smaller rows. Each of these small rows represents one timeframe (30m, 60, 2h, 4h, etc) What timeframes you choose for them is completely configurable althought the current setup is already ideal to trade on 15m
⏲For these smaller rows the ones on top are highest timeframe(i.e. 4h) and the bottom small rows are lowest timeframe
⏲So each small row is like being able to check that indicator many timeframes at once. This will help you determine overall trends without switching to different timeframes on your chart all the time
📈The last piece of the puzzle is the background color. This background color is whether the chart is going up or down on the 1 hour heiken Ashi candle chart. Heiken ashi always shows up or down based on how they draw the candles, so its another useful trend indicator
👍If you enjoy MTF Madness all I ask in return is that you like the indicator and follow me on tradingview (profile here: www.tradingview.com)
❓If you have any questions, join us in the telegram chat in my signature!
CTC BTFD V3In cryptocurrency trading, It is normal that the price will retrace more than 70% in bear market. The bear market, the coin will be accumulated for the next bull market to come. To benefit in this situation, we need to buy low. The price must be low enough before we can enter the market.
This CTC BTFD Grid system is designed to proof the concept. It works exceptionally well on nearly all crypto. The ruls is simple. buy the fucking dip. Wait for 50% retracement or more before enter the market.
Neo BitMEX Futures Hedge Grid Alerts Premium v1.0This indicator was made to streamline finding the optimal entry to cash and carry/hedge on a futures contract when margin trading.
Explanation of the indicator:
This indicator has built-in alert conditions that you can use to give you email alerts, in-browser sound alerts, or SMS alerts. These alerts are based upon futures prices being in contango or backwardation.
From top to bottom, the grid shows XBTU18, XBTZ18, OkEx's Quarterlies (OKCOIN:BTCUSD3M), and CME's futures.
Red: Futures are trading above your defined range (default 1%) of spot
Maroon: Futures are trading above twice your defined range of spot
Lime: Futures are trading below your defined range (default 1%) of spot
Green: Futures are trading below twice your defined range of spot
What's configurable:
% to trigger
Grid size
Bar color toggle
Label toggle
Spot/index source (Bitfinex's BTCUSD, BitMEX's XBTUSD, and BitMEX's XBT Index are available)
Pricing:
Currently this standalone indicator is 0.007 BTC for lifetime use.
Example of use:
On 4 May 2018, BitMEX's XBTU18 was trading >2% above perpetual swap. The grid alerts signaled that and if one were long on bitcoin spot on any exchange, then it would have been a good idea to hedge a short on XBTU18. Eventually from there the premium gap was closed while bitcoin fell.
Here is the indicator shown with bar coloring and labels.
BottomFinder MTF Madness - 5x MTF Grid IndicatorsHello Again Trading View!
Bottom Finder Team here bringing another delicious indicator, this time to help spot those trends! This version is closed for Beta Testing with our subscribers only for the next few weeks. After beta improvements it will be released free to anyone who signs up as a free member on our site.
This is meant to be used on the 15m timeframe, and it looks up into higher TF's. It is meant to be maximized, so have this open in one tab and the chart on another. Dual Monitors are best. All options and Time frames are fully configurable inputs.
Indicators from top to bottom are:
1.)Polarity Filtration - 6 Timeframes
2.)Price Volume Trend - 4 Timeframes
3.)Stochastic RSI - 4 Timeframe Grid, and Current Timeframe in lines/ribbons
4.)MACD Crossovers - 8 Timeframes
5.)SuperTrend - 4 Timeframes
And last...
6.)Background Color indicator is up/down (green/red) price on 1 Hour Heiken Ashi candle chart.
No more swapping back and forth between timeframes!
For access to this and many other exclusive indicators - you can visit our telegram and ask about becoming a subscriber. All our paid indicators have a reasonable lifetime cap price. Once you reach it, indicator is yours for life - no more subscription.
DepthHouse RSI Grid MTFDepthHouse RSI Grid MTF is used to determine overbought and oversold levels based on the RSI across multiple time frames.
The default time frames are the 30m, 2H, 8H and 16H however these are completely adjustable.
This indicator also allows the user to select which RSI band to display based on the time frame.
The default is set to the current time frame, however the user can select any of the other four time frames.
OverBought & Oversold Levels are also entirely adjustable.
Meaning you can adjust the 30, 70 ranges, and it will alter the overbought and oversold values across ALL timeframes.
How to get:
As you can see this is an invite only script. In the coming month this indicator, along with many others will become pay to use only. (website on my profile page)
However all my indicators will be FREE until May 1, 2018 . So please try them out!
To take advantage of this free trial:
Just leave a comment!
IF you are viewing this after May 1st. Please feel free to send me a PM or visit my website.
Parabolic SAR MTF GridShow a grid with Parabolic SAR in 5 timeframes. Shows an alert when the Parabolic SAR show the same direction for all 5 timeframes.
MTF Polarity Grid [DW]This is an experimental study designed to track directional polarities across multiple timeframes and express them as a simple two color grid.
The polarity in this calculation is determined by divergence between a fast and slow McGinley Dynamic.
Your current resolution's polarity is the top row, the rows below are are for higher timeframes of your choice.
[RS]Stop Hunt Levels V0Request for SpreadEagle71:
Stop Hunt Levels adapted from:
www.investopedia.com
configuration:
smoothing: smooths/average the source higher value will remove spikes but delay the speed of adjusting
source: source to compare crossing lines.
Rounding Value: value space of the grid.
Entry Window Size: Space for entrys.