VIDYA Trend StrategyOne of the most common messages I get is people reaching out asking for quantitative strategies that trade cryptocurrency. This has compelled me to write this script and article, to help provide a quantitative/technical perspective on why I believe most strategies people write for crypto fail catastrophically, and how one might build measures within their strategies that help reduce the risk of that happening. For those that don't trade crypto, know that these approaches are applicable to any market.
I will start off by qualifying up that I mainly trade stocks and ETFs, and I believe that if you trade crypto, you should only be playing with money you are okay with losing. Most published crypto strategies I have seen "work" when the market is going up, and fail catastrophically when it is not. There are far more people trying to sell you a strategy than there are people providing 5-10+ year backtest results on their strategies, with slippage and commissions included, showing how they generated alpha and beat buy/hold. I understand that this community has some really talented people that can create some really awesome things, but I am saying that the vast majority of what you find on the internet will not be strategies that create alpha over the long term.
So, why do so many of these strategies fail?
There is an assumption many people make that cryptocurrency will act just like stocks and ETFs, and it does not. ETF returns have more of a Gaussian probability distribution. Because of this, ETFs have a short term mean reverting behavior that can be capitalized on consistently. Many technical indicators are built to take advantage of this on the equities market. Many people apply them to crypto. Many of those people are drawn down 60-70% right now while there are mean reversion strategies up YTD on equities, even though the equities market is down. Crypto has many more "tail events" that occur 3-4+ standard deviations from the mean.
There is a correlation in many equities and ETF markets for how long an asset continues to do well when it is currently doing well. This is known as momentum, and that correlation and time-horizon is different for different assets. Many technical indicators are built based on this behavior, and then people apply them to cryptocurrency with little risk management assuming they behave the same and and on the same time horizon, without pulling in the statistics to verify if that is actually the case. They do not.
People do not take into account the brokerage commissions and slippage. Brokerage commissions are particularly high with cryptocurrency. The irony here isn't lost to me. When you factor in trading costs, it blows up most short-term trading strategies that might otherwise look profitable.
There is an assumption that it will "always come back" and that you "HODL" through the crash and "buy more." This is why Three Arrows Capital, a $10 billion dollar crypto hedge fund is now in bankruptcy, and no one can find the owners. This is also why many that trade crypto are drawn down 60-70% right now. There are bad risk practices in place, like thinking the martingale gambling strategy is the same as dollar cost averaging while also using those terms interchangeably. They are not the same. The 1st will blow up your trade account, and the 2nd will reduce timing risk. Many people are systematically blowing up their trade accounts/strategies by using martingale and calling it dollar cost averaging. The more risk you are exposing yourself too, the more important your risk management strategy is.
There is an odd assumption some have that you can buy anything and win with technical/quantitative analysis. Technical analysis does not tell you what you should buy, it just tells you when. If you are running a strategy that is going long on an asset that lost 80% of its value in the last year, then your strategy is probably down. That same strategy might be up on a different asset. One might consider a different methodology on choosing assets to trade.
Lastly, most strategies are over-fit, or curve-fit. The more complicated and more parameters/settings you have in your model, the more likely it is just fit to historical data and will not perform similar in live trading. This is one of the reasons why I like simple models with few parameters. They are less likely to be over-fit to historical data. If the strategy only works with 1 set of parameters, and there isn't a range of parameters around it that create alpha, then your strategy is over-fit and is probably not suitable for live trading.
So, what can I do about all of this!?
I created the VIDYA Trend Strategy to provide an example of how one might create a basic model with a basic risk management strategy that might generate long term alpha on a volatile asset, like cryptocurrency. This is one (of many) risk management strategies that can reduce the volatility of your returns when trading any asset. I chose the Variable Index Dynamic Average (VIDYA) for this example because it's calculation filters out some market noise by taking into account the volatility of the underlying asset. I chose a trend following strategy because regressions are capturing behaviors that are not just specific to the equities market.
The more volatile an asset, the more you have to back-off the short term price movement to effectively trend-follow it. Otherwise, you are constantly buying into short term trends that don't represent the trend of the asset, then they reverse and loose money. This is why I am applying a trend following strategy to a 4 hour chart and not a 4 minute chart. It is also important to note that following these long term trends on a volatile asset exposes you to additional risk. So, how might one mitigate some of that risk?
One of the ways of reducing timing risk is scaling into a trade. This is different from "doubling down" or "trippling down." It is really a basic application of dollar cost averaging to reduce timing risk, although DCA would typically happen over a longer time period. If it is really a trend you are following, it will probably still be a trend tomorrow. Trend following strategies have lower win rates because the beginning of a trend often reverses. The more volatile the asset, the more likely that is to happen. However, we can reduce risk of buying into a reversal by slowly scaling into the trend with a small % of equity per trade.
Our example "VIDYA Trend Strategy" executes this by looking at a medium-term, volatility adjusted trend on a 4 hour chart. The script scales into it with 4% of the account equity every 4-hours that the trend is still up. This means you become fully invested after 25 trades/bars. It also means that early in the trade, when you might be more likely to experience a reversal, most of your account equity is not invested and those losses are much smaller. The script sells 100% of the position when it detects a trend reversal. The slower you scale into a trade, the less volatile your equity curve will be. This model also includes slippage and commissions that you can adjust under the "settings" menu.
This fundamental concept of reducing timing risk by scaling into a trade can be applied to any market.
Disclaimer: This is not financial advice. Open-source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. If you would like to implement a version of any script, I would recommend making significant additions/modifications to the strategy & risk management functions. If you don’t know how to program in Pine, then hire a Pine-coder. We can help!
Educational
2x take profit, move stop loss to entryTwo take profit targets moving stop loss to entry after first take profit hit
This strategy shows a method to achieve the following trade management:
1) Open a position with two take profit targets
2) When first take profit is hit, move the stop loss to entry price
3) Position is closed when either second take profit is hit or position is stopped out at entry
Trading Conditions
The trading conditions used in this script are for illustrative purposes only and are not meant to be profitable.
Bollinger Bands
Used to show areas where price is moving outside of the normal range
Stochastic
Used to show overbought and oversold conditions.
Green dots are plotted when the K line crosses over its SMA. Red dots are plotted when the K line crosses under its SMA.
The option to use overbought/oversold thresholds is again illustrative.
BEST Strategy Template AutoviewHello Traders
I've build a strategy template building for you the AUTOVIEW commands
I made this template based on this documentation: use.autoview.with.pink
You can select whether you want to use an SL or not, a TP or not, using the borrow/repay feature (only for Binance), ... and it will build dynamically the Autoview commands and will send them when entry/exit alerts trigger.
The template accept SL/TP in percentage or pips/USD distance from the entry price
MAGICAL !!!! (not really, just some dumb coding)
Users will have to specify from the settings:
- the Autoview account name
- the symbol name: I couldn't capture it from the chart because sometimes the symbol name on the broker side is different than the one from the TradingView side
- the position size
- the broker name (Tradovate, Binance, Bitmex, FTX, ...)
- if you want to send the alerts to your DEMO or LIVE account
- a debug mode to check if your alerts are well formatted
- and a few other interesting options...
If you want to use it, you'll have to update the dummy entries logic lines 97-98 and replacing those two lines by your own stuff
I'll make the ProfitView and 3Commas and Alertatron versions shortly.
Basically the same script but with the commands built for those 3 automation third-parties.
Best regards
Dave
RELATIVE VALUE TRADE MANAGEMENT WEBHOOKThis script it's created to send open-close signals via webhook. It allows you to open a relative value position based in the relative graph. You can set the TP and SL levels and the script will send the signal to your exchange.
Due a pine limitations it is necessary apply the script in the 2 different actives and set the alerts. You can just do the relative analysis and then go to the first asset and set the script. Create your alert and then just go to the other asset and create the alert. It doesn't necessary to change anything in the script because the levels are the same.
It is also possible to do the analysis using the script, deploying the relative graph, but could be annoying sometimes due scales.
Positions will be placed at close always.
THIS IS IMPORTANT: I use Zignaly as a exhange so if you are using Binance or other YOU MUST CHANGE the code. If you know the JSON format that It requires would be easy.
Here is tips in all the important imputs. But let me explain the most important.
The MANDATORY fields are:
Ticker IDs: Here you must write the EXACT ID code for the active. Caps included.
Example : BINANCE:SUSHIUSDTPERP
It is also important select the correct market side. If you want to be long of ANY active you must write that ID in the LONG ID. For short positions is the same.
Time frame: Here you can select the time frame of the graph (not the current active graph, I mean the relative one.) The orders will be send using that time frame. I recommend to do the analysis in other window and then use the script to trigger the order in the time frame that you want.
Money management: In these fields you can select the qty that you will lose if the SL level is reach. Based in a determinated amount of currency or in a % of your capital.
Dates: It is important to select the start date. If the order is already open, we must look for the moment where the activation price was reached. If the order is unopened it is better to select the current date, so the order will be triggered when the entry level is reached.
Ids: If you have current open position you can set here that ID to send the correct order to the exchange.
To set the alert just call the function {{{strategy.order.alert_message}}}
Joker Trailing TP BotTrailing Take Profit is used by the traders to increase their gains when the prices moves in a favorable direction. Let’s have a look at what is Trailing Take Profit and how it works.
What Is a Trailing Take Profit?
Trailing Take Profit is a term largely used in crypto, whereas you may encounter the term Trailing Stop in traditional trading describing almost the same thing, So what’s the difference between Trailing Take Profit and Trailing Stop? Trailing Stop is a type of Stop Loss automatically moving in the same direction as the asset’s price. Trailing Take Profit is nothing else than Trailing Stop activated after initial Take Profit is reached.
The main difference between these two is that Trailing Take Profit takes the profit in any case (altough it might be later annihilated by Trailing Stop). Thus, Trailing Take Profit reduces the risks that might’ve occurred using Trailing Stop alone. Trailing Take Profit is bound to the maximum of Take Profit price instead of just a price increase/decrease.
As you might notice, the terms Trailing Take Profit and Stop Loss are quite similar. To avoid confusion, in this article we will be talking about Trailing Take Profit as defined above.
Trailing Take Profit only moves in one direction. It is designed to lock in profit and limit losses. The trailing profit only moves up (in case of a long strategy) once the price has surpassed previous high and a new high has been established. If the trailing take profit moves up, it cannot move back down, thus securing the profit and preventing losses.
Trailing Take Profit allows the trade to remain open and continue to profit as long as the price is moving in the investor’s favor. If the price changes direction and the change surpasses the previously set percentage the order will be closed.
How Does it Work?
For example if you buy BTC at the price of 10000, if you set a Take Profit at 11000 and a Trailing Take Profit at 5% :
If the price goes up to 10500, nothing happens because the Take Profit at 11000 has not been reached.
Then if the BTC price goes up top 11000, a Stop Order at 10450 will be set.
Then if the BTC price goes down to 10500, the Stop Order stays at 104500.
Then if the BTC price goes up to 12000, the Stop Order moves to 11400.
Then if the BTC price goes down to 11000, the Stop Order at 11400 is executed.
You see that without Trailing Take Profit, the buy order would have been sold at 11000. Thus, a trader would miss an earning opportunity at 11400.
Dual Fibonacci Zone & Ranged Vol DCA Strategy - R3c0nTraderWhat does this do?
This is for educational purposes and allows one to backtest two Fibonacci Zones simultaneously. This also includes an option for Ranged Volume as a parameter.
Pre-requisites:
First off, this is a Long only strategy as I wrote it with DCA in mind. It cannot be used for shorting. Shorting defeats the purpose of a DCA bot which has a goal that is Long a position not Short a position. If you want to short, there are plenty of free scripts out there that do this.
You must have some base knowledge or experience with Fibonacci trading, understanding what is ADX, +DI (and -DI), etc.
You can use this script without a 3Commas account and see how 3Commas DCA Bot would perform. However, I highly recommend inexperienced uses get a free account and going through the tutorials, FAQ's and knowledgebase. This would give you a base understanding of the settings you will see in this strategy and why you will need to know them. Only then should you try testing this strategy with a paper bot.
Background
After I had created and released "Fibonacci Zone DCA Strategy", I began expanding and testing other ideas.
The first idea was to add Ranged Volume to the Fibonacci Zone DCA strategy which I wanted for providing further confirmation before entering a trade. The second idea was to add a second Fibonacci Zone that was just as configurable as the first Fibonacci Zone. I managed to add both and they can be easily enabled or disabled via the strategy settings menu.
Things Got Real Interesting
Things got real interesting when I started testing strategies with two Fibonacci zones. Here's a quick list of what I found I was able to do:
Mix and match exit strategies. I could set the Fib-1 zone strategy to exit with a take profit % and separately set the Fib-2 zone strategy to exit when the price crosses the top-high fib border
Trade the trend. A common phrase amongst traders is "the Trend is your friend" and with the help of an additional Fib Zone, I was able to trade the trend more often by using two different Fib Zone strategies which if configured properly can shorten time to re-deploy capital, increase number of closed trades, and in some cases increase net profit.
Trade both bull market uptrends and bear market downtrends in the same strategy. I found I could configure one Fib Zone strategy to be really good in uptrends and another Fib Zone strategy to be really good in downtrends. In some cases, with both Fib Zone strategies enabled together in a single strategy I got better results than if the strategies were backtested separately.
There are many other trade strategies I am finding with this. One could be to trade a convergence or divergence of the two different Fib Zones. This could possibly be achieved by setting one strategy to have different Fibonacci length.
Credits:
Thank you "EvoCrypto" for granting me permission to use "Ranged Volume" to create this strategy
Thank you "eykpunter" for granting me permission to use "Fibonacci Zones" to create this strategy
Thank you "junyou0424" for granting me permission to use "DCA Bot with SuperTrend Emulator" which I used for adding bot inputs, calculations, and strategy
BEST Strategy Template w/ Custom SL/TP Size - EducationalHello traders
I'm getting this question at least once per week: "how to define a custom exit quantity for my stop loss and a different one for my take profit"
Instead of answering every day the same question in my DMs, I've decided to publish an educational strategy template script using this
Features
- Select to use or not the SL and/or TP
- Define how many pips/USD the SL/TP should be set at from the entry
- Define what quantity percentage you want to close at SL and/or at TP (lines 301 to 320 in the code)
- Classical custom trailing stop where the SL is moved to breakeven once the TP is hit
- Get real-time backtesting stats based on the options you've selected
Update
You might not know it yet but from last week (or maybe the week before), the qty/qty_percent from the strategy.exit function refers now to the initial position size (and not the remaining position size like before)
For example:
strategy.exit("EX1", qty_percent = 50, stop = constant)
strategy.exit("EX2", qty_percent = 20, stop = constant)
What happened before
After "EX1" reaches SL levels, "EX2" exits 20% from the % of the remaining position size.
If the initial position size = 100 contracts
EX1 exits 50 contracts
EX2 exits 20% of 50 contracts = 10 contracts
What's happening now
After "EX1" reaches SL levels, "EX2" exits 20% from the % of the original position size.
If the initial position size = 100 contracts
EX1 exits 50 contracts
EX2 exits 20 (20% of 100 contracts) contracts
I think this is an improvement and I really enjoy this new behavior.
See you in a few days with another post :)
ALL THE BEST
Dave
Buy and hold strategyA simple buy and hold strategy. A short or a long position can be chosen. The start date will determine the date where your position will start and end date is the date it will end. This works well as a baseline to your other existing strategies since buy and hold is just the simplest strategy available.
Fibonacci Zone DCA Strategy - R3c0nTraderCredits:
Thank you "eykpunter" for granting me permission to use "Fibonacci Zones" to create this strategy
Thank you "junyou0424" for granting me permission to use "DCA Bot with SuperTrend Emulator" which I used for adding bot inputs, calculations, and strategy
Pre-requisites:
You can use this script without a 3Commas account and see how 3Commas DCA Bot would perform. However, I highly recommend signing up for their free account, going through their training, and testing this strategy with a paper bot. This would give you a base understanding of the settings you will see in this strategy and why you will need to know them.
What can this do?
First off, this is a Long only strategy as I wrote it with DCA in mind. It cannot be used for shorting. Shorting defeats the purpose of a DCA bot which has a goal that is Long a position not Short a position. If you want to short, there are plenty of free scripts out there that do this.
I created this script out of curiosity and I wanted to see how a strategy based on “Fibonacci” levels would work with a 3Commas DCA bot. I came across "eykpunter’s" "Fibonacci Zones" study and in TradingView and I found it to be a very interesting concept. The "Fib Zones" in his study are basically a "Donchian Channel" of 4 Fibonacci lines. These are the High @ 0.236, Center High @ 0.382, Center Low @ 0.618, and Low @ 0.764.
The Fib Zones in this strategy can be used as conditions to open a trade as well as closing a trade. There is also the option to close a trade based on a Target Take Profit (%).
Advanced Fibonacci trading is also supported by specifying additional parameters for Trade Entry and Exit.
For example, for order entry, you can increase the minimum trend strength to open an order via the "minimum ADX value" option. You can also further limit order entry by selecting the option to "Only open trades on bullish +DI" (Positive Directional Index).
Or you can play the contrarian. For example, I would look for "buying the dip" opportunities by doing the following under "Trade Entry Settings":
Set the "Min ADX value to open trade" to zero
Set the option "Open a trade when the price moves" to "1-To the bottom of Downtrend Fib zone" or "2-Higher than the top of the Downtrend Fib zone"
Uncheck option "Only open trades on bullish +DI"
Set the 'Min ADX value to open trade' to Zero
Set the 'Max +DI value to open trade' to a value between 10-20.
For Trade Exit settings, I can use a "Target Take Profit (%)" or one of the High Fib levels to close the trade.
Here's an example result when using a Contrarian-Fibonacci-Zone-DCA strategy:
Explanation of Chart lines and colors on chart
Six Options for Entering a Fibonacci Trade
Open a trade when the price moves:
1-To the bottom of Downtrend Fib zone
2-Higher than the top of the Downtrend Fib zone
3-Higher than the bottom of Ranging Fib Zone
4-Higher than the top of Ranging Fib Zone
5-Higher than the bottom of Uptrend Fib Zone
6-To the top of Uptrend Fib Zone
Three Options for Exiting a Fibonacci Trade
Take profit using:
"Target Take Profit (%)"
"High Fibonacci Border-1"
"High Fibonacci Border-2"
Short Selling EMA Cross (By Coinrule)BINANCE:AVAXUSDT
This short selling script works best in periods of downtrends and general bearish market conditions, with the ultimate goal to sell as the the price decreases further and buy back before a rebound.
This script can work well on coins you are planning to hodl for long-term and works especially well whilst using an automated bot that can execute your trades for you. It allows you to hedge your investment by allocating a % of your coins to trade with, whilst not risking your entire holding. This mitigates unrealised losses from hodling as it provides additional cash from the profits made. You can then choose to to hodl this cash, or use it to reinvest when the market reaches attractive buying levels.
Entry
The exponential moving average ( EMA ) 20 and EMA 50 have been used for the variables determining the entry to the short. EMAs can operate better than simple moving averages due to the additional weighting placed on the most recent data points, whereas simple moving averages weight all the data the same. This means that price is tracked more closely and the most recent volatile moves can be captured and exploited more efficiently using EMAs.
Our backtesting data revealed that the most profitable timeframe was the 30-minute timeframe, this also enabled a good frequency of trades and high profitability.
A fast (shorter term) exponential moving average , in this strategy the EMA 20, crossing under a slow (longer term) moving average, in this example the EMA 50, signals the price of an asset has started to trend to the downside, as the most recent data signals price is declining compared to earlier data. The entry acts on this principle and executes when the EMA 20 crosses under the EMA 50.
Enter Short: EMA 20 crosses under EMA 50.
Exit
This script utilises a take profit and stop loss for the exit. The take profit is set at -8% and the stop loss is set at +16% from the entry price. This would normally be a poor trade due to the risk:reward equalling 0.5. However, when looking at the backtesting data, the high profitability of the strategy (93.33%) leads to increased confidence and showcases the high probability of success according to historical data.
The take profit (-8%) and the stop loss (+16%) of the strategy are widely placed to ensure the move is captured without being stopped out due to relief rallies. The stop loss also plays a role of mitigating losses and minimising risk of being stuck in a short position once there has been a fundamental trend reversal and the market has become bullish .
Exit Short: -8% price decrease from entry price.
OR
Exit Short: +16% price increase from entry price.
Tip: Research what coins have consistent and large token unlocks / highly inflationary tokenomics, and target these during bear markets to short as they will most likely have substantial selling pressure that outweighs demand - leading to declining prices.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
The backtesting data was recorded from December 1st 2021, just as the market was beginning its downtrend. We therefore recommend analysing the market conditions prior to utilising this strategy as it operates best on weak coins during downtrends and bearish conditions.
Mean reversionSimple mean reversion strategy.
Strategy aims to find three bullish or bearish candle pattern which ends with strong move. Position will be open until we get close above previous highs.
Strategy uses also simple moving average to filter short positions.
This strategy works well with QQQ and daily time frame but it seems to do fairly well intraday also.
User can modify moving average length and how strong is the move of the last candle.
This strategy is inspired a strategy by hackertrader. The original idea by QuantpT.
Traling.SL.TargetTrailing SL and Target
I have seen few requests in PineScripters telegram group asking questions about implementation of trailing stop-loss (SL) and targets. This script is one of the way to implement the same.
This script is developed based on dark color theme and is best viewed using dark color theme.
How and where can this script be used:
The script is built to demonstrate how one can implement the trailing SL and target, so by referring the script one can mimic the approach and add trailing SL and target implementation in their own strategy.
How it works:
To demonstrate the SL and target implementation, i have considered simple EMA crossover strategy.
Key Input Parameters
Method to use for SL/Target trailing:
1. % Based Target and SL - Used to calculate trailing based on parameters defined under group '% Based Target SL'
2. Fixed point Based Target and SL - Used to calculate trailing based on parameters defined under group 'Fixed point Based Target and SL'
% Based Target and SL:
Initial profit % - This is used to calculate target when trade is initiated
Initial SL % - This is used to calculate SL when trade is initiated
Initiate trailing % - This parameter determines, when to start trailing SL and target.
Trail profit by % - Target would be trailed by % specified as this parameter
Trail SL by % - SL would be trailed by % specified as this parameter
e.g.
Trade type: - Long
Trade price: 10000
initial profit %: 1
Initial SL %: 1
Initiate trailing %: 0.5
Trail profit by %: 0.3
Trail SL by %: 0.4
Calculations based on above:
initial profit %: 10100 (trade price + 1%)
Initial SL %: 9900 (trade price - 1%)
Initiate trailing %: 10049.5 (initial profit - 0.5%)
Trail profit by %: 10130 (initial profit + 0.3%)
Trail SL by %: 9939.6 (initial SL + 0.4%)
For next iteration of Trailing SL and target above calculated values will be taken as a base and next set of values will be calculated. these calculations will continue till the trade is exited either on price reaching profit or SL point.
Fixed point Based Target and SL:
Initial profit target points - To derive initial target, parameter value is added to trade price in case of long trade.
Initial SL points - To derive SL point, parameter value is subtracted from trade price
Initiate trailing points - To derive start of trailing logic, parameter value is subtracted from initial profit point.
Trail profit by points - In case of long trade, parameter value is added to the profit target to derive new trailed profit target.
Trail SL by % - In case of long trade, parameter value is added to the SL initial point to derive new trailed SL.
Calculation of Trailing SL and target will continue till the trade is exited either on price reaching profit or SL point.
Plots displayed on the chart:
Apart from default trade markings i have added 3 shapes on the chart to describe working of Trailing SL and targets.
Diamond shape marks - These are added on the chart when trade is initiated. These shapes gives additional trade information by way of 'tooltip'. This information can be viewed by placing mouse pointer on the shape.
Circle shape marks - These are added on the chart whenever Trailing SL and targets are calculated. These shapes gives additional trade information by way of 'tooltip'. This information can be viewed by placing mouse pointer on the shape. You will also notice a number displayed just above or below circle denoting Trailing iteration.
Labels up and label down shapes - These are dynamically placed on the chart whenever trade is in progress. These labels will display ongoing trades, Target and SL points.
Simple_PyramidingA simple Pyramiding / DCA Strategy. Everyday at a specified time a position is opened. The individual position is closed when a take profit is triggered. Optionally a stop loss can be activated, or the option to close the position at the and of the time frame. You can specify the max amount of open positions. The equity will be divided through the max amount of open positions.
This strategy is a result of an exploration into working with time sessions, pyramiding, for loops and possibilities to trigger individual take profits (profit) and stop loss levels (stop). This strategy is by no means a worked out and reliable strategy. Please feel free to experiment with the code in your indicators and strategies.
Straight Trend V1Hello everyone,
We are proud to present you our "Straight Trend" Strategy.
Strategy is use a specified timeline's opening price as reference and draw a line between the current price and trend line.
Trend line is smoothed with last X times of highest and lowest values ( Donchian Methodology) in order to create less noise and fake alerts , therefore creates a channel of current prices time based opening price.
The timeline can be adjusted according to your specifications in the settings.
------
Why opening price ?
We are traders ,no matter what we do ,we always make a benchmark at the end of a day , week or at the end of a specified time line.
Example :
X commodity's price increased %15 in last days or Y commodity's price dropped %30 in last 2 weeks etc. etc.
Thats why the opening price have a hidden and much more important role in our trading sessions.
------
After the channel is created we remove the unnecessary lines from our output by filtering the direction with closing price.
IF the closing price is higher than Chanel reference price and direction goes upward the script gives you a BUY signal.
The same methodology is applied for SELL operations.
When to Take Profit?
We put a setting for profit percentage in scripts setting you can adjust the ratio as your choices.
When to Stop Loss or change direction of the trade?
The Straight Trends previously mentioned channel's inverse line was set as STOP LOSS and direction changer in the strategy with "STR-X" Marker.
Note : Strategy is much more effective with heikin-ashi bars due methodology of heikin ashi and with this bars it creates less signals with more accuracy, use at your own discretion.
Please don't hesitate to write us if you need support or assistance, we also appreciate your feedbacks.
Please be advised that this strategy is published with Educational Purposes and it is not a investment advice.
Thank you in advance.
stoch supertrd atr 200maThis strategy combines Supertrend, 200 EMA, Stochastic, and an ATR stop loss indicator. For buy conditions, the Stochastic has to be below the 20 level, price has to be above the 200 Ema and the Supertrend has to be green. For sell conditions, it has to be the opposite. the Stochastic has to be above the 80 level, price has to be below the 200 Ema and the Supertrend has to be red.
Oversold RSI with Tight Stop-Loss Strategy (by Coinrule)KRAKEN:LINKUSD
This is one of the best strategies that can be used to get familiar with technical indicators and start to include them in your rules on Coinrule .
ENTRY
1. This trading system uses the RSI (Relative Strength Index) to anticipate good points to enter positions. RSI is a technical indicator frequently used in trading. It works by measuring the speed and change of price movements to determine whether a coin is oversold (indicating a good entry point) or overbought (indicating a point of exit/entry for a short position). The RSI oscillates between 0 and 100 and is traditionally considered overbought when over 70 and oversold when below 30.
2. To pick the right moment to buy, the strategy enters a trade when the RSI falls below 30 indicating the coin is oversold and primed for a trend reversal.
EXIT
The strategy then exits the position when the price appreciates 7% from the point of entry. The position also maintains a tight stop-loss and closes the position if the price depreciates 1% from the entry price. The idea behind this is to cut your losing trades fast and let your winners ride.
The best time frame for this strategy based on our back testing data is the daily. Shorter time frames can also work well on certain coins, however in our experience, the daily works best. Feel free to experiment with this script and test it on a variety of your coins! With our back testing data a trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange by volume. In the example shown, this strategy made a handsome net profit of 52.6% on Chainlink with 66.67% of trades being profitable.
You can execute this strategy on your favorite exchanges with Coinrule .
Ranged Volume DCA Strategy - R3c0nTraderUpdate: Republishing this as Public Open-Source script.
Credits:
Thank you "EvoCrypto" for granting me permission to use "Ranged Volume" to create this strategy.
Thank you "junyou0424" for granting me permission to use "DCA Bot with SuperTrend Emulator" which I used for adding bot inputs, calculations, and strategy
What does this do?
This script is mainly used for backtesting a Ranged Volume strategy to see how a 3Commas bot would perform.
I created this script out of necessity and I wanted a way to test a 3Commas DCA bot with a strategy based on “Volume.”
I came across "EvoCrypto’s" "Ranged Volume" study and strategy in TradingView and I liked it. I wanted to configure it so it can be used for DCA bot backtesting. I used parts from "junyou0424’s" "DCA Bot with SuperTrend Emulator" to add the following:
1. The Start Time and End Time
2. Price deviation to open safety orders (%)
3. Target Take Profit (%)
4. Trailing deviation
5. Base Order and Safety Order
6. Safety order volume scale
7. Safety order step scale
8. Max safety orders
In addition to the above, I also added chart indicators for "Take Profit" as well as "Safety Order"
Pre-requisites:
You can use this script without a 3Commas account and see how 3Commas DCA Bot and Ranged Volume strategy would perform vs. a non-DCA strategy. However, I highly recommend signing up for their free account and going through their training. This would give you a base understanding on the settings you will see in this strategy and why you will need to know them.
That said these are the pre-requisites I suggest you have:
1. Base Knowledge of 3Commas DCA bots
2. Base knowledge of settings such as “Max safety trades count”, “safety order volume scale” and “safety order step scale”. If these are alien to you, I suggest you read up on these.
3. Knowledge of setting up a Single-pair 3Commas bot for receiving custom TradingView signal.
4. A paper-bot to test your ideas. (Do not use a real money bot until you have tested it sufficiently with a paper-bot. You alone are responsible for your results!)
5. Add the study I created called "R3c0nTrader’s Ranged Volume Study” which adds a separate chart in its own pane showing the volume spikes. It will also generate the “buy” signals for your bot. NOTE: The study also has the same color scheme as this strategy and having the colors in both the strategy and the study will make things easier to see. If you use EvoCrypto’s Ranged Volume Study instead, just keep in mind that the colors won’t match, and you will have to manually match them.
6. Make your buy signals from your strategy are the same as in your study! To do this, use the same “Volume Range Length” you entered in the STRATEGY and enter that value for the “Volume Range Length” in the STUDY. Also ensure you have the same settings for “Heikin Ashi” (On or Off).
Comparisons of Ranged Volume Strategy vs Ranged Volume DCA Strategy
BTCUSD
Beware of Strategies that claim super high profits. This can easily be done by lowering the initial capital to something unrealistic. If I did that with this strategy and set the initial capital $100 and base order size to $100, I get a net profit of 2,864% which is not realistic.
How to Use
1. On the “Inputs” tab:
a. Set your Start and End Time to backtest against.
b. Set your “Volume Range Length” (number of bars to look back)
c. “Heikin Ashi Colors” – Usually I leave this enabled
d. “Show Bar Colors” – Leave enabled
e. “Show Break-Out” – Leave enabled
f. “Show Range” – Leave enabled
g. Set your other inputs which are those settings you would find in your 3Commas bot that you want to test (e.g., Price deviation to open safety orders, Target Take Profit, Base order, Safety order, etc.).
h. Quick Example for BTCUSD on 2hr chart:
i. Price deviation to open safety orders (%) = 6
ii. Target Take Profit (%) = 14
iii. Trailing deviation = 0
iv. Base order = 100
v. Safety order = 200
vi. Safety order volume scale = 2
vii. Safety order step scale = 1.4
viii. Max safety order = 5
2. On the “Properties” tab, set your initial capital, base currency, etc.
a. Initial capital – Default is 10,000 (Please use realistic values here. The amount here should be able to cover ALL your safety orders if they were triggered. Ideally, you should have funds left over and not use all trade capital.)
b. Base currency – Select your currency
c. Order Size - Not used. Use the “Inputs” tab to change your base order size.
d. Leave “Pyramiding” set to 999. This acts as a ceiling to the “Max safety orders” on the “Inputs” tab. It must always be higher than your “Max safety orders.” For example, if you set your “Max safety orders” to “4” and “Pyramiding” to “4” then it effectively means you have “3” “Max safety orders” and not “4” because it is counting each successive entry including the initial order.
e. “Commission” - Optional
f. “Verify price for limit orders” – Leave at zero. This does not change anything that I can tell.
g. Optional - Enter a value for “Commission”
h. Slippage – Optional. Slippage does not occur in backtesting but does occur in real trading but it can be simulated. Example use case for tracking performance of a real money bot: You enter the start date and time of your bot’s trade into this strategy and you notice some values are a little off due to slippage (average price, take profit, safety orders are not lining up) then you would go back here and increase the slippage until those lines up close enough with your actuals.
i. Margin for long positions – I don’t use this honestly.
j. Margin for short positions – I don’t use this honestly.
k. Recalculate “After order is filled” and “On every tick” – I don’t use this honestly.
3. “Style” tab
a. Ranged Volume Bar Coloring - You must disable bar coloring in any studies you added or this may not work properly
i. Color 0 – Default Yellow; appears when a volume breakout occurs
ii. Color 1 – Default Red; appears when a volume breakdown occurs
iii. Color 2 – Light Blue; appears when Close is higher than the Open
iv. Color 3 – Dark Blue; appears when the Close is lower than the Open
b. Take profit – Default Green; take profit line
c. Safety order – Default Light Blue; safety order line
d. No Safety Orders left – Default Red; when a trade runs out of safety orders, the line turns red and there is no safety orders left underneath to catch any further falling price movements.
e. Avg Position Price – Default Orange; your average position price for any given trade.
f. Take Profit Plot Area – Default Green; creates a highlighted area for your take profit
g. SO Plot Area – Default Light Blue; creates a highlighted area for your safety orders
h. Trades on chart – Show or hide your trades on the chart
i. Signal labels – Show or hide the trade signal labels on the chart
j. Quantity – Show or hide the trade quantity on the chart
Explanation of Chart lines and colors on chart
TradeIQ Darvas Box BacktestThis script has been made to backtest the strategy explained in this video link:
www.youtube.com
Publicly available scripts explained in the video were copy pasted and therefore merged into one single script. Open and short entries were made according to the rules of the video.
MA cross strategyI created an sma (10/30) strategy.
The script is under construction and can be changed, since i'm looking for a more profitable strategy.
If you have ideas to make it more profitable, please comment.
It is possible to change everything to your own needs.
MilleMachineHello traders,
I hereby present to you the second stage of my journey to finding a reliable, profitable trading strategy.
The "Millemachine" is based on the "Millebot", my previous published strategy. This means the backbone of the strategy is still the same: a trend following system. Instead of using a fixed TP and SL, a trailing stoploss is now used. To limit the losses when the trend weakens, the trailing stoploss automatically gets smaller, as it is based on the ATR.
A new utility is you can now easily switch between indicators on which the decision making is based. This allows the user to discover which indicators work best for entry, long/short switching and stoploss configuration.
The strategy has been proven to be very profitable in trending markets, but can suffer losses during ranging market. To make the system more robust, the strategy cannot solely rely on a trending system. Other systems must be added.
I believe that a good trading bot must consist of more than 4 different strategies, based on different systems. This is what I am currently working on.
My goal for publishing this strategy is to help other traders build their own. In my journey I found it difficult to find a good strategy that employs a decent risk management, which is truly essential for having good, consistent results. Also, a realistic commission needs to be defined to have a realistic performance prediction. This weighs on the profitability and therefore is often set at 0 by authors of other strategies, which I find misleading.
If you have found this strategy informative or useful, please leave a comment.
Greetings Michael
Follow The Ranging HullThis is a scalping strategy, trying to make quick points based on momentum and trend trading.
Entry Points are when either the range filter or the the following line changes colour. And the Hull is in that same direction.
--The Strategy Only enters on range filter entry point for now.
This Strategy has been tested on the NASDAQ 1 min, And works best with low timeframes.
Set the IsStrategy on the settings to true, to activate the strategy.
Make sure the Dates are correct .
Credits:
Hull Suite by InSilico www.tradingview.com
Range Filter Buy and Sell 5 min www.tradingview.com
Follow Line Indicator by Dreadblitz www.tradingview.com
CoinFlip Indicator + StrategyFlip a coin every Monday.
Heads, go long. Tail, go short. Stoploss at 1 ATR, and Take profit at 1 ATR too. 1:1 risk to reward ratio.
After backtesting 2018, 2019, and 2020 with 28 major currency pairs. We are getting close to a 50% win rate with an 8% standard deviation.
Believe it or not, this simple performs better than lots of the popular indicators out there.
Don't believe me? Test it out yourself!!
Use this as a baseline for your backtest and expose all your other crappy indicators :)
HOW TO USE:
As an indicator:
1. Use a daily chart
2. Green arrow below chart, go long, set a stop-loss at 1 x ATR, and take profit at 1 x ATR
3. Red arrow above chart, go short, set a stop-loss at 1 x ATR, and take profit at 1 x ATR
As an indicator:
1. In setting, set a year to test (default to 2020)
2. Go to the strategy tester and observe the stats
P.s. You can also set the period of the ATR to another value other than 14 periods.
Accurate BUY & SELL 5 mins TF by RRAlways trade using 5 mins Time frame of chart.
For Buy entry always buy 1 point above the candle closing price & SL would be previous candle low or 30 points.
For Sell Entry Always Sell 1 point below the candle opening price & SL would be previous candle high or 30 points.
Do not take trades using 3 mins Time frame, as there is lot of noise. It works best with 5 mins Time frame.
I have adjusted/set according my trading pattern, if needed use the settings options to set accordingly .
Removed range highlighter to keep the chart simple.
Original Version credits to ZacVaughn
Actual Version i just set alerts and change the parameters for Crude OIL 5min Chart.
NO REPAINT.
Wait For Barclose