TEMA/HMA/VWMACD - Short Strategy 4HAs we can discover by studying the history of BTCUSD, the fall is always swift. Confirmation of this - today's collapse. In this strategy, an attempt is made to catch such drop by using quick entry and quick exit.
Let's describe what this strategy consists of:
• TEMA (you can find this strategy separately on this page or on platform)
• VWMACD
• HMA
• Take-profit and Stop-losses
Logic:
Firstly we VWMACD (the difference between VWMACD and simple MACD is only in the way of calculating moving average) and plot it as a histogram.
Then HMA is adding as a trend filter. For easy understanding let's plot it now on chart separately.
Next step is to create and add TEMA. After it is needed to subtract slow TEMA from fast TEMA and plot this value around 0 on histogram. This is the main decision for the implementation of the short trade.
ENTRY the trade:
When VMACD is below 0 and price (src = close) is below the HMA and TEMA below 0.
CLOSE the trade:
When VWMACD is upper than 0 or price is upper than HMA or TEMA is upper than 0
You can find more strategies on tradingammo.pro.
Bot
3commas GRID bot VisualisationHello everyone
This is a grid display indicator for a 3-comma grid bot.
Just enter the upper and lower borders of your grid and the number of grid cells in the indicator settings.
It's simple!
The Witcher [30MIN] - AlertsHello,
This is the Witcher Bot
This bot is got best performance at BTCUSDTPERP BINANCE FUTURES
this is bot for leverage 1x,
I tried focusing at highest % profitable trades, bot could be optimalised to even higher profit net.
TP: 1.1
SL: 8.2
Stop-loss unfortunelly have to be high to avoid bear/bull traps
The core of this strategy is trend strenght ( MONEY FLOW INDKES)
Strategy can only open position on strong price movment, to avoid wrong decision
Settings are set for highest profitable trades %
Bot using 10 indicators to trigger basic condtition for long and short :
1) ADX - Is one of the most powerful and accurate trend indicators. ADX measures how strong a trend is, and can give valuable information on whether there is a potential trading opportunity.
2) RSI - value helps strategy to stop trade in right time. When RSI is overbought strategy don't open new longs , also when RSI is oversold strategy don't open new shorts
3) TREND STRENGHT
4) JURIK MOVING AVERAGE - The Jurik Moving Average indicator is one of the surest ways to smoothen price curves within a minimum time lag. The indicator offers currency traders one of the best price filters during strong price moves. In this time, when bitcoin price action is so strong, this indicator is necessary.
5) SAR - The parabolic SAR is a technical indicator used to determine the price direction of an asset, as well as draw attention to when the price direction is changing. SAR supporting bot, to not open new trades when the trends are slowly changing
6) TREND INDICATOR
7) MOMENTUM - Indicator istechnical analysis tool used to determine the strength or weakness of a stock's price. Momentum measures the rate of the rise or fall of stock prices. Common momentum indicators include the relative strength index ( RSI ) and moving average convergence divergence ( MACD ).
8) OBV - On-balance volume (OBV) is a technical trading momentum indicator that uses volume flow to predict changes in stock price.
9) FAST MA - like previous ones this is for better view of trends, and correctly define the trends, also Speed_MA are using for predict the future price action.
10) RANGE FILTER - this indicator is for the better view of trends, define trends, that is important for every bull/bear traps which helps a lot becouse of the very variable trends.
I decided to add momentum indicator to strategy, to make a fast-reacting decision on lower timeframes at extremly price volatility
Also bot got additional EMA scalping option, which increase profit net but, in some situation, that could be risky.
For max security I recommend to turn off this option.
Commision are set at standard binancefutures VIP-0 = 0.04%
After converting strategy into study version, bot is ready for automation.
All the ploting color depends of adx value.
Strategy are not Repainting
For the source code I tried to keep as clean as I could
Enjoy
Zendog V3 backtest DCA bot 3commasMAJOR UPDATE:
- Update to Pinescript v5
- MAJOR refactor for the logic of how orders are placed. BO order is placed when the condition is first encountered and we are not in a deal.
The extra SO orders (if based on price movement) are all placed on the next candle after BO order, instead of each being placed one after another.
Take profit (if percentage) and Stop loss are placed on the first candle after BO order because if BO and TP are on the same candle TV does not execute properly.
These changes should improve strategy accuracy when multiple prices are hit by the same candle.
- NEW FEATURE: Support to Stop deal using an external indicator (i.e. stop long deal when RSI > 80)
- NEW FEATURE: Support to trigger Safety orders using an external indicator (i.e. trigger each additional SO when RSI < 10, regardless of price movement)
The price movement logic may be implemented in the indicator that plots start / end signals. The SO size is calculated using the configuration of steps.
- NEW FEATURE: Safety order command for 3commas bot. This is implemented using Add funds in the quote currency (for pair BTCUSDT the quote currency is USDT)
The SO size is calculated using the configuration of steps, for exact order size (and price) use the built-in Steps table.
- NEW FEATURE: Addition of extra columns to the steps table: Required price for TP, Required % change for TP, Required % change for BEP (Breakeven point)
- Update to steps table to remove prices when Safety orders are not based on % price change
- The code is opensource. I will not be able to sustain merges for the script, but feel free to use and develop your own version and ping me on discord to review them
and maybe include in the original script
Wunderbit HRT BotWunderbit HRT is a proprietary indicator designed to find pivot points in the cryptocurrency market.
Working timeframes from 30 minutes and above.
The indicator is designed to create automated trading strategies using a webhook.
To create a cryptocurrency robot for this indicator, you need:
1. Create alerts and bind the URL to the webhook.
2. Link the Tradingview indicator to automation services.
For signals, alerts are used: LONG and SHORT
Recommendations for the indicator:
1. Use DSA technology for automation.
2. Be sure to disable the "multiple inputs" function.
3. Use an indicator with oscillators or MACD to confirm the entry point.
RSI Average Swing BotThis is a modified RSI version using as a source a big length(50 candles) and an average of all types of sources for candle calculations such as ohlc4, close, high, open, hlc3 and hl2.
In this case we are going to use a 0-1 scale for an easier calculation, where 0.5 is going to be our middle point.
Above 0.5 we consider a bullish possibility.
Below 0.5 we consider a bearish possibility.
I made a small example bot using that initial logic, together with 2 exit points for long or short positions.
If there are any questions, let me know !
Joint Conditions Strategy Suite + TradingConnector alerts bot"Please give us combined alerts with the possibility of having several conditions in place to trigger the alert." - was the top voted request from users under one of the recent blogposts by TradingView.
Ask and you shall receive ;)
TradingView is a great platform, with unmatched set of functionalities, yet this particular combo of features indeed seems not to be in place. Fortunately, TradingView is also very open platform, thanks to PineScript coding language, which enables developing combos like the requried one and plenty of other magic.
I have already published numerous "educational" scripts, showing how to code indicators and alerts with PineScript, but... this is not one of them. This one is for real. READY FOR USE on real markets, also by the non-coding traders. Just take my script, set parameters with dropdowns, backtest the strategy, fire the alerts and execute them.
HOW TO USE IT
In "Settings" popup I tried to mimic the CreateAlert popup dropdowns for selecting logic. Let's say you want to enter Long position at Stochastic KxD crossover. In first line of Long Entry conditions set "StochK" + "Crossing Up" + "StochD". Last field doesn't matter because in 3rd dropdown something else than "value" was selected. In second line you could set "maB" + "Greater Than" + "maC" to filter out those entries which are in direction of the uptrend. And yeah, add ADX>25 to make sure the market is actually moving: "ADX" + "Greater Than" + "value" + "25". All condition lines must be TRUE (or skipped) for the entry to be triggered. Toghether with an alert.
The same for Short entries. Combinations are limitless.
INDICATORS AND MTF (MULTI-TIMEFRAME)
In those dropdowns you can select candle values like open/close/high/low/ohlc4, but also some most popular indicators, which I have pre-built into this script: RSI, various Moving Averages, ADX-DMI, Stochastic and Bollinger Bands for start. You can configure parameters of those indicators also in "Settings" popup, in "Indicator Definitions" section. What's important, you can use any of these indicators from higher timeframe, setting MTF multiplier. So if you applied this indicator to 1h chart, but want to use rsi(close,14) from 4h chart, set MTF to 4. If you want to use current timeframe indicators, keep MTF at 1, which is a default setting here.
Note for coders: to keep focus of this script on joining conditions, entire logic for those indicators has been moved to external library, also open source. I encourage you to dig into the code and see how it's done. I love the addition of libraries concept in PineScript.
CUSTOM INDICATOR
Following the "openness" spirit of my master - which is TradingView itself - my work is also open, in 2 ways:
1. This script is open source. So you can grab it, modify or add any functionalities you want. I cannot and don't want to stop you from doing that. I'm asking for only one favor - please mention this source script in your credits.
2. You can import the plot (series) from any other indicator on TradingView. In Settings popup of my script, scroll down to "Indicator Definitions" section, and select the series of your choice in the first dropdown. Now it is ready to use in conditions dropdowns on top of the Settings popup.
Let me give you an example of that last scenario. Take another script of mine, "Pivot Points on SR lines DEMO". You can find it in "Indicators & Strategies" library or here: (). Attach it to your chart. Now come back to THIS script, open Settings popup and in "Custom Indicator aka Imported Source" select "Pivot Points on SR lines: ...". The way it works - it detects if a pivot point happened on Support/Resistance line from the past and returns 1 for PivotLow and -1 for Pivot High. Now in first Long Entry condition set: "custom indicator" + "Greater Than" + "value" + "0" and long entries will be marked on every pivot low noticed on Support/Resistance line.
ALERTS
Last but not least - the alerts. This script produces alerts on the entries calculated by strategy logic, as marked on the chart by the backtester. Moreover, syntax of those alerts is already prepared and fully compatible with TradingConnector - alerts executing tool (bot), if you want to auto-execute those trades. Apart from installing the tool, you need to set
up the alerts in TradingView, here is how:
open CreateAlert popup
in first dropdown select "Joint Conditions Strategy Template"
in second dropdown select "alert() function calls only"
And that's all. You only need to set one alert for the whole script, not one for Longs and one for Shorts as it was in the past. Also, you don't need to setup closing alerts, because stop-loss/take-profit/trailing-stop information is embedded in the entry alert so your broker receives it as early as possible. Alerts sent will look like this: "long sl=40 tp=80", which is exactly what TradingConnector expects.
Phew, that's all folks. If you think I should add something to this template (maybe other indicators?) please let me know in comments or via DM. Happy trading!
P.S. Pyramiding is not supported in this script.
Disclaimer : I'm not saying above combination of conditions will make you money. Actually none of this can be considered financial advice. It is only a software tool. Use it wisely, be aware of the risk and do your own research!
BTCUSDTPERP MEGABOT 60min [ALERTS VERSION]BINANCE:BTCUSDTPERP
Hello, this is my alerts version of BTCUSDTPERP MEGABOT 60min
THIS BOT IS ONLY FOR BTCUSDTPERP ON BINANCEFUTURES !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This configs are only for this pair on this market,
It depends of volume , and others indicator
Bot is making amazing results at configs
TP - 4.5%
SL - 7%
Strategy using 4 indicators :
ADX
RSI
VOLUME
MACD
ADX - makes a solid view to trend without any scam wick :
Long only on green bars
Shorts only on red bars
That's helps my strategy to define a right trend
there is also a orange option for unidentified trends
RSI - value helps strategy to stop trade in right time
When RSI is overbought strategy don't open new longs
also when RSI is oversold strategy don't open new shorts
Volume - volume is the most important indicator for the strategy,
to avoid open trades on flat chart, new trades are open after a strong volume
wicks
MACD - this indicator is for define the trend
So the way this bot is working is simple
when every arguments are confirmed , then strategy open trades
Enjoy !!!
Linear trendSimple way how to use Linear Regression for trading.
What we use:
• Linear Regression
• EMA 200 as a trend filter
Logic:
Firstly we make two different linear regression movings as oscillator. For this we need to subtract slow moving from fast moving, so we get the single moving around zero. This is the green/red line which appears on the chart.
The trade open when LR cross over the threshold. The trade close when LR cross under the threshold below. Crossing over the threshold is the same as faster moving cross over slower moving.
Also we use EMA as a filter. The trades would be only when the price is over than EMA 200.
WaveTrend 4h/24mWaveTrend 4h/24m is a trading tool based on two WaveTrend timeframes.
For this script the WaveTrend calculations made by LazyBear were used. WaveTrend is a widely used indicator for finding direction of an asset.
The strategy is developed by Youtuber Jayson Casper. The main strategy on the 4 hour and 24 minute timeframes, this will be the default timeframes. Timeframes can be adjusted in the indicator interface.
With Jaysons' we wait for both timeframes to have last printed a green dot for longs, and both timeframes to have last printed a red dot for shorts. When this occurs a green diamond will be printed for longs, a red diamond for shorts.
Make sure to always use the chart from the smallest timeframe you're using, so by defaults use the 24 minute chart.
Features of the indicator:
- WaveTrend Timeframe 1 (Blue/Lightblue wave).
- WaveTrend Timeframe 2 (Blue/Purple line with filled background between the lines).
- VWAP (Yellow wave which is turned off by default)
- Green/Red Diamonds
What to look for?
This script is all about the Green and Red Diamonds.
A Green diamond will be printed when on both the 4 hour and 24 minute timeframe the last printed dot was a green dot.
A Red diamond will be printed when on both the 4 hour and 24 minute timeframe the last printed dot was a red dot.
What are the Green and Red Diamonds based on?
When both VWAP timeframes are ABOVE 0, a green diamond will be printed. This is equivalent to the last dot on both WaveTrend timeframes being a green dot.
When both VWAP timeframes are BELOW 0, a red diamond will be printed. This is equivalent to the last dot on both WaveTrend timeframes being a red dot.
Happy Trading!
Instrument-Z (3Commas Bot)Instrument-Z is what I am currently using as my 3Commas Bot.
It allows you to customize signals from 3 indicators; Crossing MA's, Stochastic RSI, and WaveTrend.
Better yet, it allows you to setup these signals separately depending on whether the Trend MA is going up or down.
So there are 2 sets of inputs for everything, Uptrend inputs and Downtrend inputs.
I have realized that we can't expect a strategy to work the same way in an uptrend vs downtrend, so the inputs should be separated too.
In my testing, separating increased the net profit by 60% on average.
You can select whether you are trading Long or Short.
You can choose your stop loss and take profit levels as well as trade expiration.
You can choose if you only want to trade with the trend (making the opposing signals irrelevant).
The trend is based on the Trend MA.
This script is specifically for cryptocurrencies.
I've noticed that MA crosses on other asset classes are unreliable because the fluctuations are not strong enough to push the MA's across each other in a meaningful way.
If you want to use this as a 3Commas Bot, then you will have to copy the code of the strategy and paste it into your own personal script.
Then you have to change the alert messages at the bottom of the script.
Make sure to change your alert message from this;
{"message_type": "bot", "bot_id": 0000000, "email_token": "0b000a0a-0aa0-00aa-0aa0-000a00000a0a", "delay_seconds": 0}
To this;
{ \"message_type\": \"bot\", \"bot_id\": 0000000, \"email_token\": \"0a000a0a-0aa0-00aa-0aa0-000a00000a0a\", \"delay_seconds\": 0 }
With after each new line and \ before each quotation.
In the Alert setup, select "alert() function calls only".
This indicator is like a middle ground of complexity between the Juicy Trend indicator and the Instrument-A indicator.
And because it does not feature my neural network project, I have made it open script.
Enjoy!
RSI Rising Crypto Trending AlertAlert version of the strategy with the same name
This is crypto and stock market trending strategy designed for long timeframes such as 4h+
From my tests it looks like it works better to trade crypto against crypto than trading against fiat.
Indicators used:
RSI for rising/falling of the trend
BB sidemarket
ROC sidemarket
Rules for entry
For long: RSI values are rising, and bb and roc tells us we are not in a sidemarket
For long: RSI values are falling, and bb and roc tells us we are not in a sidemarket
Rules for exit
We exit when we receive an opposite direction.
Cuation: Because this strategy uses no risk management, I recommend you takje care with it.
If you have any questions, let me know !
TradingGroundhog - Strategy & Fractal V1#-- Public Strategy - No Repaint - Fractals -- Short term
Here I come with another script, more simple than Wavetrend V1. You will love it.
#-- Synopsis --
Another simple idea, on a small time frame (15 min) we buy when the opening price goes below a Bottom fractals and sell when it goes over a Top fractals, but as this script do not use Wavetrends. You should stop by your self to use the script during long lasting downtrends.
I developed the strategy using BTC /EUR 3 MIN BINANCE but it can be applied to many other cryptos, I don't know for forex or others. You can use it for short term (to a month of uptrend) and automated trading.
#-- Graph reading --
And now, how to read it ?
Fractals:
Yellow Flags occur when the opening price goes below a Bottom fractal , it means Buy.
White Flags appear when the opening price goes over a Top fractal , it means Sell.
#-- Parameters --
*** Parameters have been intensively optimized using 10 cryptocurrency markets in order to have potent efficiency for each of them. I would recommend to only change the Can Be touch parameter. For the others, I don't recommend any modifications. The idea behind the script is to be able to switch between markets without having to optimize parameters, less work, easy to target active crypto and therefor limit the risks. ***
Can be touch :
'Filter fractals' : Activate or Disable the filtering fractal operation. If Enable, buy during less risky periods. (Activate is often better)
Can be touch but not necessary :
'VolumeMA' : The Volume corrector used by the fractals
'Extreme window' : The number of price individuals to look for if we want to remove extreme fractals.
Not to touch :
'Long Sop Loss (%)' : The minimal difference of price between a Fractal bottom and the opening price to buy.
#-- Time frame --
Should be used with the following time frames depending on the necessity:
1 MIN
3 MIN (Preferred with the parameters set)
5 MIN
#-- Last words --
The script can be set up to send Tradingview signals to 3comma just by adding comment = " " in strategy.close_all() and strategy.entry().
Good trades !
Disclaimer (As it should always be one to any script)
***
This script is intended for and only to be used for personal purposes only. No such information provided by it constitutes advice or a recommendation for any investment or trading strategy for any specific person. There is no guarantee presented or implied as to the accuracy of specific forecasts, projections, or predictive statements offered by the script. Users of the script agree that its original developer does not take responsibility for any of your investment decisions. Please seek professional advice before trading.
***
# Here are the results from the 20rst of September 2021 with 100% of equity on the BTC /EUR 3 Min and with a capital of 10 000 EUR. So almost, one month.
# As I saw, it goes from +30% to more than +160% (the great SHIB) depending on the selected crypto. It may be negative if you spot a downtrend.
Forex Fractal EMA ScalperThis is a forex scalper designed for very short timeframes 1-5 min max.
At the same time due to the short timeframe, is recommend to re optimize it weekly .
Its components are
Fractals
Triple EMA with different lengths
Rules for entry:
For long : we have an up fractal and all 3 ema are in ascending order
For short: we have a down fractal and all 3 ema are in descending order.
Rules for exit
We exit when we either get a reverse order or when we hit the take profit or stop loss calculated in fixed pips.
Bjorgum AutoTrailOne Time Trade Risk Management
Incorporating the new interactive feature, this script is meant as a one time trailing stop for the active trader to manage positional risk of an ongoing trade. As a crypto trader or Fx trader, many may find themselves in a position late into the evening, or perhaps daily life is calling while a trade progresses in their favor. Adding a trailing stop to a position thats trending can help to keep you in the trade and lock in gains if things turn around when you are unable to react.
To use the trail, the user would add the script to the chart. Once added, a set of crosshairs will appear allowing the user to choose a point to begin. Often choosing to start a trail from a swing high/ low can be an ideal option. This tends to provide some protection for a stop by placing it under support for a long trade or above resistance for a short trade.
Price based trail
The trail will automatically plot and the offset is a factor of the distance from price action selected by the crosshairs. If placed above price action the script will plot a short trail, if placed below it will trail for a long position.
Additionally, there are several other trail types other than price based. There is also percent based, which offsets the trail as a percent from close. A hard stop is placed at the cross hair value, then once the distance is exceeded by the percentage specified, the trail begins.
There are 2 more volatility based trails. There is a PSAR trail which can provide quicker and tighter stops that accelerate with the trend locking in gains faster, and an ATR trail that keeps a distance from price action as a function of volatility. Volatility levels can be adjusted from the menu.
Volatility based trail (ATR)
Volatility based trail (PSAR)
Lastly, within the code for more the more technical savvy, is some starting setups for string alerts to be sent to exchanges via 3rd party or custom API applications. Some string manipulation is required for specific providers to meet their requirements, but there is some building block alerts that will take the ticker symbol, recognize the asset your trading (Fx, Crypto, etc) and take input quantity or exchange names from the settings via inputs.
Complex strings can be built to perform almost any trade related task when to comes to alerts via web hook. A little setup this way with some technology to back your system can mean a semi-automated half man, half machine setup that actually manages your trail stop while you cannot. For those that don’t go this far, there is some basic alert functionality that well trigger when a trail is hit so you can react and make a decision.
Please note that for now, interactive mode is engaged only when the script is added to the chart. Additional stops, or for adjustments to be made it is best to add a new version. Also as real trades could be at play managing an actual position, alerts are designed to go off only once to ensure no duplicate orders are sent meaning alerts are not reoccurring. Once an alert is triggered, a new trail is to be set up.
A modified version of the TradingView built in SAR equation was used in this script. To provide the value of the SAR on the stop candle, it was necessary to alter the equation to extract this value as the regular SAR “flips” at this point. Thank you to TradingView for supplying access to the built in formula so that this SAR could behave the same as the built-in function outside of these alterations
Example of SAR value maintained in trigger candle
Cheers and happy trading.
neutronix community bot ML + Alerts 4h-daily (mod. capissimo)Gm traders,
i have been a python programmer for some years studying artificial intelligence for general purpose; after some time i finally decided to have a look at some finance related stuff and scripts.
Moved by curiosity i've decided to make some but decisive modifications to a script i tried to use initially but without success: the LVQ machine learning strategy.
So after studying the charts and indicators, i have rewritten this script made by Capissimo and added heavy filtering thanks to vwap and vwma, then fixed repaint and other issues.
I hope you enjoy it and that it could increase your possibilities of success in trading.
HOW TO USE THE SCRIPT
Add the script to 3h+ charts like for example BTC 4h, 6h, 8h, 12h, daily. (In order for it to work on shorter timeframes charts you can try to change to lookback window but i dont advise it).
Change only rsi and volfilter(volume filtering) settings to try to find the best winrate. Leave dataset to open. Fyi the winrate isn't 100% accurate but can give you a raw vision of final results.
Use alerts included for trading and and in options click on 'Once per bar'. If you have checked 'Reverse Signals' in the control panel you have got more 'risky' signals so be advised if trading futures and stocks.
Exit trade signals not provided, so it is recommended the use of take profits and stop loss (1.5:1 ratio)
As always, the script is for study purposes. Do not risk more than you can spend!
Original LVQ-based strategy made by capissimo
Modified by gravisxv 13/10/2021
RSI Rising Crypto Trending StrategyThis is crypto and stock market trending strategy designed for long timeframes such as 4h+
From my tests it looks like it works better to trade crypto against crypto than trading against fiat.
Indicators used:
RSI for rising/falling of the trend
BB sidemarket
ROC sidemarket
Rules for entry
For long: RSI values are rising, and bb and roc tells us we are not in a sidemarket
For long: RSI values are falling, and bb and roc tells us we are not in a sidemarket
Rules for exit
We exit when we receive an opposite direction.
Cuation: Because this strategy uses no risk management, I recommend you takje care with it.
If you have any questions, let me know !
Swing VWAP Weekly Stock and Crypto StrategyThis is a simple yet very efficient swing strategy designed for crypto and stock market, using big timeframes.
Its main component is VWAP weekly, so for best scenarios its better to use big timeframes such as 8h+.
The rules for entry are simple:
If our close if above vwap weekly we enter long .
If our close is below vwap weekly we enter short.
We exit from the trade, when a reverse condition than the entry one is triggered.
Because this strategy has no risk management inside, I recommend to be careful with it.
If you have any questions, let me know
3Commas BotBjorgum 3Commas Bot
A strategy in a box to get you started today
With 3rd party API providers growing in popularity, many are turning to automating their strategies on their favorite assets. With so many options and layers of customization possible, TradingView offers a place no better for young or even experienced coders to build a platform from to meet these needs. 3Commas has offered easy access with straight forward TradingView compatibility. Before long many have their brokers hooked up and are ready to send their alerts (or perhaps they have been trying with mixed success for some time now) only they realize there might just be a little bit more to building a strategy that they are comfortable letting out of their sight to trade their money while they eat, sleep, etc. Many may have ideas for entry criteria they are excited to try, but further questions arise... "What about risk mitigation?" "How can I set stop or limit orders?" "Is there not some basic shell of a strategy that has laid some of this out for me to get me going?"
Well now there is just that. This strategy is meant for those that have begun to delve into the world of algorithmic trading providing a template that offers risk defined positions complete with stops, limit orders, and even trailing stops should one so choose to employ any of these criteria. It provides a framework that is easily manipulated (with some basic working knowledge of pine coding) to encompass ones own ideas and entry criteria, while also providing an already functioning strategy.
The default settings have a basic 1:1 risk to reward ratio, which sets a limit and a stop equal distance from the entry. The entry is a simple MA cross (up for long, down for short). There a variety of MA's to choose from and the user can define the lengths of the averages. The ratio can be adjusted from the menu along with a volatility based adder (ATR) that helps to distance a stop from support or resistance. These values are calculated off the swing low/high of the user defined lookback period. Risk is calculated from position entry to stop, and projected upwards to the limit as a function of the desired risk to reward ratio. Of note: the default settings include 0.05% commissions. Competitive commissions of the leading cryptocurrency exchanges are .1% round trip (one buy and one sell) for market orders. There is also some slippage to allow time for alerts to be sent and orders to fill giving the back test results a more accurate representation of real time conditions. Its recommended to research the going rates for your exchange and set them to default for the strategy you use or build.
To get started a user would:
1) Make a copy of the code and paste in their bot keys in the area provided under the "3Comma Keys" section
- eg. Long bot "start deal" copied from 3commas in to define "Long" etc. (code is commented)
2) Place alert on desired asset with desired settings ensuring to select "Order fills and alert() function calls"
3) Paste webhook into the webhook box and select webhook URL alerts (3rd party provided webhook)
3) Delete contents of alert message box and replace with {{strategy.order.alert_message}} and nothing else
- the codes will be sent to the webhook appropriately as the strategy enters and exits positions. Only 1 alert is needed
settings used for the display image:
1hr chart on BTCUSD
-ATR stop
-Risk adjustment 1.2
-ATR multiplier 1.3
-RnR 0.6
-MAs HEMA/SMA
-MA Length 50/100
-Order size percent of equity
-Trail trigger 60% of target
Experiment with your own settings on your crypto of choice or implement your own code!
Implementing your trailing stop (optional)
Among the options for possible settings is a trailing stop. This stop will ratchet higher once triggered as a function of the Average True Range (ATR). There is a variable level to choose where the user would like to begin trailing the stop during the trade. The level can be assigned with a decimal between 0 and 1 (eg. 0.5 = 50% of the distance between entry and the target which must be exceeded before the trail triggers to begin). This can allow for some dips to occur during the trade possibly keeping you in the trade for longer, while potentially reducing risk of drawdown over time. The default for this setting is 0 meaning unless adjusted, the trail will trigger on entry if the trailing stop exit method is selected. An example can be seen below:
Again, optional as well is the choice to implement a limit order. If one were to select a trailing stop they could choose not to set a limit, which could allow a trail to run further until hit. Drawdowns of this strategy would be foregoing locking gains at highs on target on other trades. This is a trade-off the user can decide on and test. An example of this working in favor can be observed below:
Conclusion
Although a simple strategy is implemented here, the benefits of this script allow a user a starting platform to build their strategies from with built in risk mitigation. This allows the user to sidestep some of the potential difficulties' that can arise while learning Pine and taking on the endeavor of automating their trading strategies. It is meant as an aid, a structure, and an educational piece that can be seen as a "pick-up-and-go" strategy with easy 3Commas compatibility. Additionally, this can help users become more comfortable with strategy alert messages and sending strings in the form of alerts from Pine. As well, FAQs are often littered with questions regarding "strategy.exit" calls, how to implement stops. how to properly set a trailing stop based on ATR, and more. The time this can save an individual to get started is likely of the best "take-aways" here.
Happy trading
Zendog V2 backtest DCA bot 3commasHi everyone,
After a few iterations and additional implemented features this version of the Backtester is now open source.
The Strategy is a Backtester for 3commas DCA bots. The main usage scenario is to plugin your external indicator, and backtest it using different DCA settings.
Before using this script please make sure you read these explanations and make sure you understand how it works.
Features:
- Because of Tradingview limitations on how orders are grouped into Trades, this Strategy statistics are calculated by the script, so please ignore the Strategy Tester statistics completely
Statistics Table explained:
- Status: either all deals are closed or there is a deal still running, in which case additional info
is provided below, as when the deal started, current PnL, current SO
- Finished deals: Total number of closed deals both Winning and Losing.
A deal is comprised as the Base Order (BO) + all Safety Orders (SO) related to that deal, so this number
will be different than the Strategy Tester List of Trades
- Winning Deals: Deal ended in profit
- Losing deals: Deals ended with loss due to Stop Loss. In the future I might add a Deal Stop condition to
the script, so that will count towards this number as well.
- Total days ( Max / Avg days in Deal ):
Total Days in the Backtest given by either Tradingview limitation on the number of candles or by the
config of the script regarding "Limit Date Range".
Max Days spent in a deal + which period this happened.
Avg days spent in a deal.
- Required capital: This is the total capital required to run the Backtester and it is automatically calculated by
the script taking into consideration BO size, SO size, SO volume scale. This should be the same as 3commas.
This number overwrites strategy.initial_capital and is used to calculate Profit and other stats, so you don't need
to update strategy.initial_capital every time you change BO/SO settings
- Profit after commission
- Buy and Hold return: The PnL that could have been obtained by buying at the close of the first candle of the
backtester and selling at the last.
- Covered deviation: The % of price move from initial BO order covered by SO settings
- Max Deviation: Biggest market % price move vs BO price, in the other direction (for long
is down, for short it is up)
- Max Drawdown: Biggest market % price move vs Avg price of the whole Trade (BO + any SO), in the other
direction (for long price goes down, for short it goes up)
This is calculated for the whole Trade so it is different than List of Trades
- Max / Avg bars in deal
- Total volume / Commission calculated by the strategy. For correct commission please set Commission in the
Inputs Tab and you may ignore Properties Tab
- Close stats for deals: This is a list of how many Trades were closed at each step, including Stop Loss (if
configured), together with covered deviation for that step, the number of deals, and the percentage of this
number from all the deals
TODO: Might add deal avg value for each step
- Settings Table that can be enabled / disabled just to have an overview of your configs on the chart, this is a
drawn on bottom left
- Steps Table similar to 3commas, this is also drawn on bottom left, so please disable Settings table if you want
to see this one
TODO: Might add extra stats here
- Deal start condition: built in RSI-7 or plugin any external indicator and compare with any value the indicator plots
(main purpose of this strategy is to connect your own studies, so using external indicator is recommended)
- Base order and safety orders configs similar to 3commas (order size, percent deviation, safety orders,
percent scale and volume scale)
- Long and Short
- Stop Loss
- Support for Take profit from base order or from Total volume of the deal
- Configs help (besides self explanatory):
- Chart theme: Adjust according to the theme you run on. There is no way to detect theme at the moment.
This adjust different colors
- Deal Start Type: Either a builtin RSI7 or "External indicator"
- Indicator Source an value: If using External Indicator then select source, comparison and value.
For example you could start a deal when Volume is greater than xxxx, or code a custom indicator that plots
different values based on your conditions and test those values
- Visuals / Decimals for display: Adjust according to your symbol
- BO Entry Price for steps table: This is the BO start deal price used to calculate the steps in the table
Crypto Scalper Divergence Macd Psar Ema 200This is a very efficient crypto scalper adapted to very short timeframes, however it can be optimized for other timeframes and assests as well.
Its components are
MACD
P SAR
EMA 200
Risk management
Rules for entry:
For short : we have an uptrend on PSAR , histogram is positive (divergence MACD) and close of a candle is below EMA 200
For long : we dont have an uptrend on PSAR, histogram is negative(divergence MACD) and close of a candle is above EMA 200
Rules for exit:
We exit when we either find a reverse condition than the entry one, or based on stop loss/take profit that are calculated on % movements of the price.
If you have any questions, let me know !
Av3Based on the ANNE EA v3 for MT4. For use on FOREX.
if ATR is greater than ATR average taken from last 5 candles, then market considered as trending, and so Open(0)>Close(1)=buy Open(0)Close(1)=sell Open(0)<Close(1)=buy.
If trending, then buy high & sell low, if consolidation then buy low sell high.
Exit is by trail and Take Profit.
PM me for edit or MT4 version info.
High/Low Channel Multi averages Crypto Swing strategyThis is a swing strategy designed for trending markets such as crypto and stock, with big timeframes , like 8h.
For this strategy we take SMA, EMA, VWMA, ALMA, SMMA, LSMA and VWMA and make an apply them all to both HIGH and LOW separately and make 2 averages, 1 applied to high and the other applied to low.
With them we make a channel.
Rules for entry
For long: close of a candle is above avg applied to high.
For short: close of a candle is below avg applied to low.
Rules for exit
We exit when we either hit TP or SL or when we receive a different condition than the entry one.(long- > short and viceversa)
If you have any questions, let me know !