Combo Backtest 123 Reversal & Stochastic Crossover This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
This back testing strategy generates a long trade at the Open of the following
bar when the %K line crosses below the %D line and both are above the Overbought level.
It generates a short trade at the Open of the following bar when the %K line
crosses above the %D line and both values are below the Oversold level.
WARNING:
- For purpose educate only
- This script to change bars colors.
Oscillators
Webhook Starter Kit [HullBuster]
Introduction
This is an open source strategy which provides a framework for webhook enabled projects. It is designed to work out-of-the-box on any instrument triggering on an intraday bar interval. This is a full featured script with an emphasis on actual trading at a brokerage through the TradingView alert mechanism and without requiring browser plugins.
The source code is written in a self documenting style with clearly defined sections. The sections “communicate” with each other through state variables making it easy for the strategy to evolve and improve. This is an excellent place for Pine Language beginners to start their strategy building journey. The script exhibits many Pine Language features which will certainly ad power to your script building abilities.
This script employs a basic trend follow strategy utilizing a forward pyramiding technique. Trend detection is implemented through the use of two higher time frame series. The market entry setup is a Simple Moving Average crossover. Positions exit by passing through conditional take profit logic. The script creates ten indicators including a Zscore oscillator to measure support and resistance levels. The indicator parameters are exposed through 47 strategy inputs segregated into seven sections. All of the inputs are equipped with detailed tool tips to help you get started.
To improve the transition from simulation to execution, strategy.entry and strategy.exit calls show enhanced message text with embedded keywords that are combined with the TradingView placeholders at alert time. Thereby, enabling a single JSON message to generate multiple execution events. This is genius stuff from the Pine Language development team. Really excellent work!
This document provides a sample alert message that can be applied to this script with relatively little modification. Without altering the code, the strategy inputs can alter the behavior to generate thousands of orders or simply a few dozen. It can be applied to crypto, stocks or forex instruments. A good way to look at this script is as a webhook lab that can aid in the development of your own endpoint processor, impress your co-workers and have hours of fun.
By no means is a webhook required or even necessary to benefit from this script. The setups, exits, trend detection, pyramids and DCA algorithms can be easily replaced with more sophisticated versions. The modular design of the script logic allows you to incrementally learn and advance this script into a functional trading system that you can be proud of.
Design
This is a trend following strategy that enters long above the trend line and short below. There are five trend lines that are visible by default but can be turned off in Section 7. Identified, in frequency order, as follows:
1. - EMA in the chart time frame. Intended to track price pressure. Configured in Section 3.
2. - ALMA in the higher time frame specified in Section 2 Signal Line Period.
3. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
4. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
5. - DEMA in the higher time frame specified in Section 2 Trend Line Period.
The Blue, Green and Orange lines are signal lines are on the same time frame. The time frame selected should be at least five times greater than the chart time frame. The Purple line represents the trend line for which prices above the line suggest a rising market and prices below a falling market. The time frame selected for the trend should be at least five times greater than the signal lines.
Three oscillators are created as follows:
1. Stochastic - In the chart time frame. Used to enter forward pyramids.
2. Stochastic - In the Trend period. Used to detect exit conditions.
3. Zscore - In the Signal period. Used to detect exit conditions.
The Stochastics are configured identically other than the time frame. The period is set in Section 2.
Two Simple Moving Averages provide the trade entry conditions in the form of a crossover. Crossing up is a long entry and down is a short. This is in fact the same setup you get when you select a basic strategy from the Pine editor. The crossovers are configured in Section 3. You can see where the crosses are occurring by enabling Show Entry Regions in Section 7.
The script has the capacity for pyramids and DCA. Forward pyramids are enabled by setting the Pyramid properties tab with a non zero value. In this case add on trades will enter the market on dips above the position open price. This process will continue until the trade exits. Downward pyramids are available in Crypto and Range mode only. In this case add on trades are placed below the entry price in the drawdown space until the stop is hit. To enable downward pyramids set the Pyramid Minimum Span In Section 1 to a non zero value.
This implementation of Dollar Cost Averaging (DCA) triggers off consecutive losses. Each loss in a run increments a sequence number. The position size is increased as a multiple of this sequence. When the position eventually closes at a profit the sequence is reset. DCA is enabled by setting the Maximum DCA Increments In Section 1 to a non zero value.
It should be noted that the pyramid and DCA features are implemented using a rudimentary design and as such do not perform with the precision of my invite only scripts. They are intended as a feature to stress test your webhook endpoint. As is, you will need to buttress the logic for it to be part of an automated trading system. It is for this reason that I did not apply a Martingale algorithm to this pyramid implementation. But, hey, it’s an open source script so there is plenty of room for learning and your own experimentation.
How does it work
The overall behavior of the script is governed by the Trading Mode selection in Section 1. It is the very first input so you should think about what behavior you intend for this strategy at the onset of the configuration. As previously discussed, this script is designed to be a trend follower. The trend being defined as where the purple line is predominately heading. In BiDir mode, SMA crossovers above the purple line will open long positions and crosses below the line will open short. If pyramiding is enabled add on trades will accumulate on dips above the entry price. The value applied to the Minimum Profit input in Section 1 establishes the threshold for a profitable exit. This is not a hard number exit. The conditional exit logic must be satisfied in order to permit the trade to close. This is where the effort put into the indicator calibration is realized. There are four ways the trade can exit at a profit:
1. Natural exit. When the blue line crosses the green line the trade will close. For a long position the blue line must cross under the green line (downward). For a short the blue must cross over the green (upward).
2. Alma / Linear Regression event. The distance the blue line is from the green and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 6 and relies on the period and length set in Section 2. A long position will exit on an upward thrust which exceeds the activation threshold. A short will exit on a downward thrust.
3. Exponential event. The distance the yellow line is from the blue and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 3 and relies on the period and length set in the same section.
4. Stochastic event. The purple line stochastic is used to measure overbought and over sold levels with regard to position exits. Signal line positions combined with a reading over 80 signals a long profit exit. Similarly, readings below 20 signal a short profit exit.
Another, optional, way to exit a position is by Bale Out. You can enable this feature in Section 1. This is a handy way to reduce the risk when carrying a large pyramid stack. Instead of waiting for the entire position to recover we exit early (bale out) as soon as the profit value has doubled.
There are lots of ways to implement a bale out but the method I used here provides a succinct example. Feel free to improve on it if you like. To see where the Bale Outs occur, enable Show Bale Outs in Section 7. Red labels are rendered below each exit point on the chart.
There are seven selectable Trading Modes available from the drop down in Section 1:
1. Long - Uses the strategy.risk.allow_entry_in to execute long only trades. You will still see shorts on the chart.
2. Short - Uses the strategy.risk.allow_entry_in to execute short only trades. You will still see long trades on the chart.
3. BiDir - This mode is for margin trading with a stop. If a long position was initiated above the trend line and the price has now fallen below the trend, the position will be reversed after the stop is hit. Forward pyramiding is available in this mode if you set the Pyramiding value in the Properties tab. DCA can also be activated.
4. Flip Flop - This is a bidirectional trading mode that automatically reverses on a trend line crossover. This is distinctively different from BiDir since you will get a reversal even without a stop which is advantageous in non-margin trading.
5. Crypto - This mode is for crypto trading where you are buying the coins outright. In this case you likely want to accumulate coins on a crash. Especially, when all the news outlets are talking about the end of Bitcoin and you see nice deep valleys on the chart. Certainly, under these conditions, the market will be well below the purple line. No margin so you can’t go short. Downward pyramids are enabled for Crypto mode when two conditions are met. First the Pyramiding value in the Properties tab must be non zero. Second the Pyramid Minimum Span in Section 1 must be non zero.
6. Range - This is a counter trend trading mode. Longs are entered below the purple trend line and shorts above. Useful when you want to test your webhook in a market where the trend line is bisecting the signal line series. Remember that this strategy is a trend follower. It’s going to get chopped out in a range bound market. By turning on the Range mode you will at least see profitable trades while stuck in the range. However, when the market eventually picks a direction, this mode will sustain losses. This range trading mode is a rudimentary implementation that will need a lot of improvement if you want to create a reliable switch hitter (trend/range combo).
7. No Trade. Useful when setting up the trend lines and the entry and exit is not important.
Once in the trade, long or short, the script tests the exit condition on every bar. If not a profitable exit then it checks if a pyramid is required. As mentioned earlier, the entry setups are quite primitive. Although they can easily be replaced by more sophisticated algorithms, what I really wanted to show is the diminished role of the position entry in the overall life of the trade. Professional traders spend much more time on the management of the trade beyond the market entry. While your trade entry is important, you can get in almost anywhere and still land a profitable exit.
If DCA is enabled, the size of the position will increase in response to consecutive losses. The number of times the position can increase is limited by the number set in Maximum DCA Increments of Section 1. Once the position breaks the losing streak the trade size will return the default quantity set in the Properties tab. It should be noted that the Initial Capital amount set in the Properties tab does not affect the simulation in the same way as a real account. In reality, running out of money will certainly halt trading. In fact, your account would be frozen long before the last penny was committed to a trade. On the other hand, TradingView will keep running the simulation until the current bar even if your funds have been technically depleted.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that the endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Webhook Integration
The TradingView alerts dialog provides a way to connect your script to an external system which could actually execute your trade. This is a fantastic feature that enables you to separate the data feed and technical analysis from the execution and reporting systems. Using this feature it is possible to create a fully automated trading system entirely on the cloud. Of course, there is some work to get it all going in a reliable fashion. Being a strategy type script place holders such as {{strategy.position_size}} can be embedded in the alert message text. There are more than 10 variables which can write internal script values into the message for delivery to the specified endpoint.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that my endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Here is an excerpt of the fields I use in my webhook signal:
"broker_id": "kraken",
"account_id": "XXX XXXX XXXX XXXX",
"symbol_id": "XMRUSD",
"action": "{{strategy.order.action}}",
"strategy": "{{strategy.order.id}}",
"lots": "{{strategy.order.contracts}}",
"price": "{{strategy.order.price}}",
"comment": "{{strategy.order.alert_message}}",
"timestamp": "{{time}}"
Though TradingView does a great job in dispatching your alert this feature does come with a few idiosyncrasies. Namely, a single transaction call in your script may cause multiple transmissions to the endpoint. If you are using placeholders each message describes part of the transaction sequence. A good example is closing a pyramid stack. Although the script makes a single strategy.close() call, the endpoint actually receives a close message for each pyramid trade. The broker, on the other hand, only requires a single close. The incongruity of this situation is exacerbated by the possibility of messages being received out of sequence. Depending on the type of order designated in the message, a close or a reversal. This could have a disastrous effect on your live account. This broker simulator has no idea what is actually going on at your real account. Its just doing the job of running the simulation and sending out the computed results. If your TradingView simulation falls out of alignment with the actual trading account lots of really bad things could happen. Like your script thinks your are currently long but the account is actually short. Reversals from this point forward will always be wrong with no one the wiser. Human intervention will be required to restore congruence. But how does anyone find out this is occurring? In closed systems engineering this is known as entropy. In practice your webhook logic should be robust enough to detect these conditions. Be generous with the placeholder usage and give the webhook code plenty of information to compare states. Both issuer and receiver. Don’t blindly commit incoming signals without verifying system integrity.
Setup
The following steps provide a very brief set of instructions that will get you started on your first configuration. After you’ve gone through the process a couple of times, you won’t need these anymore. It’s really a simple script after all. I have several example configurations that I used to create the performance charts shown. I can share them with you if you like. Of course, if you’ve modified the code then these steps are probably obsolete.
There are 47 inputs divided into seven sections. For the most part, the configuration process is designed to flow from top to bottom. Handy, tool tips are available on every field to help get you through the initial setup.
Step 1. Input the Base Currency and Order Size in the Properties tab. Set the Pyramiding value to zero.
Step 2. Select the Trading Mode you intend to test with from the drop down in Section 1. I usually select No Trade until I’ve setup all of the trend lines, profit and stop levels.
Step 3. Put in your Minimum Profit and Stop Loss in the first section. This is in pips or currency basis points (chart right side scale). Remember that the profit is taken as a conditional exit not a fixed limit. The actual profit taken will almost always be greater than the amount specified. The stop loss, on the other hand, is indeed a hard number which is executed by the TradingView broker simulator when the threshold is breached.
Step 4. Apply the appropriate value to the Tick Scalar field in Section 1. This value is used to remove the pipette from the price. You can enable the Summary Report in Section 7 to see the TradingView minimum tick size of the current chart.
Step 5. Apply the appropriate Price Normalizer value in Section 1. This value is used to normalize the instrument price for differential calculations. Basically, we want to increase the magnitude to significant digits to make the numbers more meaningful in comparisons. Though I have used many normalization techniques, I have always found this method to provide a simple and lightweight solution for less demanding applications. Most of the time the default value will be sufficient. The Tick Scalar and Price Normalizer value work together within a single calculation so changing either will affect all delta result values.
Step 6. Turn on the trend line plots in Section 7. Then configure Section 2. Try to get the plots to show you what’s really happening not what you want to happen. The most important is the purple trend line. Select an interval and length that seem to identify where prices tend to go during non-consolidation periods. Remember that a natural exit is when the blue crosses the green line.
Step 7. Enable Show Event Regions in Section 7. Then adjust Section 6. Blue background fills are spikes and red fills are plunging prices. These measurements should be hard to come by so you should see relatively few fills on the chart if you’ve set this up as intended. Section 6 includes the Zscore oscillator the state of which combines with the signal lines to detect statistically significant price movement. The Zscore is a zero based calculation with positive and negative magnitude readings. You want to input a reasonably large number slightly below the maximum amplitude seen on the chart. Both rise and fall inputs are entered as a positive real number. You can easily use my code to create a separate indicator if you want to see it in action. The default value is sufficient for most configurations.
Step 8. Turn off Show Event Regions and enable Show Entry Regions in Section 7. Then adjust Section 3. This section contains two parts. The entry setup crossovers and EMA events. Adjust the crossovers first. That is the Fast Cross Length and Slow Cross Length. The frequency of your trades will be shown as blue and red fills. There should be a lot. Then turn off Show Event Regions and enable Display EMA Peaks. Adjust all the fields that have the word EMA. This is actually the yellow line on the chart. The blue and red fills should show much less than the crossovers but more than event fills shown in Step 7.
Step 9. Change the Trading Mode to BiDir if you selected No Trades previously. Look on the chart and see where the trades are occurring. Make adjustments to the Minimum Profit and Stop Offset in Section 1 if necessary. Wider profits and stops reduce the trade frequency.
Step 10. Go to Section 4 and 5 and make fine tuning adjustments to the long and short side.
Example Settings
To reproduce the performance shown on the chart please use the following configuration: (Bitcoin on the Kraken exchange)
1. Select XBTUSD Kraken as the chart symbol.
2. On the properties tab set the Order Size to: 0.01 Bitcoin
3. On the properties tab set the Pyramiding to: 12
4. In Section 1: Select “Crypto” for the Trading Model
5. In Section 1: Input 2000 for the Minimum Profit
6. In Section 1: Input 0 for the Stop Offset (No Stop)
7. In Section 1: Input 10 for the Tick Scalar
8. In Section 1: Input 1000 for the Price Normalizer
9. In Section 1: Input 2000 for the Pyramid Minimum Span
10. In Section 1: Check mark the Position Bale Out
11. In Section 2: Input 60 for the Signal Line Period
12. In Section 2: Input 1440 for the Trend Line Period
13. In Section 2: Input 5 for the Fast Alma Length
14. In Section 2: Input 22 for the Fast LinReg Length
15. In Section 2: Input 100 for the Slow LinReg Length
16. In Section 2: Input 90 for the Trend Line Length
17. In Section 2: Input 14 Stochastic Length
18. In Section 3: Input 9 Fast Cross Length
19. In Section 3: Input 24 Slow Cross Length
20. In Section 3: Input 8 Fast EMA Length
21. In Section 3: Input 10 Fast EMA Rise NetChg
22. In Section 3: Input 1 Fast EMA Rise ROC
23. In Section 3: Input 10 Fast EMA Fall NetChg
24. In Section 3: Input 1 Fast EMA Fall ROC
25. In Section 4: Check mark the Long Natural Exit
26. In Section 4: Check mark the Long Signal Exit
27. In Section 4: Check mark the Long Price Event Exit
28. In Section 4: Check mark the Long Stochastic Exit
29. In Section 5: Check mark the Short Natural Exit
30. In Section 5: Check mark the Short Signal Exit
31. In Section 5: Check mark the Short Price Event Exit
32. In Section 5: Check mark the Short Stochastic Exit
33. In Section 6: Input 120 Rise Event NetChg
34. In Section 6: Input 1 Rise Event ROC
35. In Section 6: Input 5 Min Above Zero ZScore
36. In Section 6: Input 120 Fall Event NetChg
37. In Section 6: Input 1 Fall Event ROC
38. In Section 6: Input 5 Min Below Zero ZScore
In this configuration we are trading in long only mode and have enabled downward pyramiding. The purple trend line is based on the day (1440) period. The length is set at 90 days so it’s going to take a while for the trend line to alter course should this symbol decide to node dive for a prolonged amount of time. Your trades will still go long under those circumstances. Since downward accumulation is enabled, your position size will grow on the way down.
The performance example is Bitcoin so we assume the trader is buying coins outright. That being the case we don’t need a stop since we will never receive a margin call. New buy signals will be generated when the price exceeds the magnitude and speed defined by the Event Net Change and Rate of Change.
Feel free to PM me with any questions related to this script. Thank you and happy trading!
CFTC RULE 4.41
These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under-or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.
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 !
RSI Centered PivotsJust a simple RSI central pivot strategy I made for a friend.
Backtested on BYBIT:BTCUSD, 155m.
DISCLAIMER : Please do your own research into anything you use before using it to trade.
RSI Strategy with alerts via TradingConnector to ForexSoftware part of algotrading is simpler than you think. TradingView is a great place to do this actually. To present it, I'm publishing each of the default strategies you can find in Pinescript editor's "built-in" list with slight modification - I'm only adding 2 lines of code, which will trigger alerts, ready to be forwarded to your broker via TradingConnector and instantly executed there. Alerts added in this script: 12 and 17.
How it works:
1. TradingView alert fires.
2. TradingConnector catches it and forwards to MetaTrader4/5 you got from your broker.
3. Trade gets executed inside MetaTrader within 1 second of fired alert.
When configuring alert, make sure to select "alert() function calls only" in CreateAlert popup. One alert per ticker is required.
Adding stop-loss, take-profit, trailing-stop, break-even or executing pending orders is also possible. These topics have been covered in other example posts.
This routing works for Forex, indices, stocks, crypto - anything your broker offers via their MetaTrader4 or 5.
Disclaimer: This concept is presented for educational purposes only. Profitable results of trading this strategy are not guaranteed even if the backtest suggests so. By no means this post can be considered a trading advice. You trade at your own risk.
If you are thinking to execute this particular strategy, make sure to find the instrument, settings and timeframe which you like most. You can do this by your own research only.
MACD 5 iN 1 [Pro-Tool]introducing MACD Which has different indicators inside,
And not only that, five different strategies have also been included in this indicator.
Strategy №1:👉 MACD Crossover Signal Line
Strategy №2:👉 MACD Crossover + MACD Overbought Section (for ignore false Crossover signals)
Strategy №3:👉 MACD Crossover + Market Close should b greater tha MOVING AVERAGE
Strategy №4:👉 MACD Crossover + Market Close should b greater tha MOVING AVERAGE ZONE
Strategy №5:👉 MACD Crossover + RSI Close should b greater tha 50 Level (or whatever level you choose)
also 5 types of MOVING AVERAGE you can choose
1: Simple Moving Average ( SMA )
2: Exponential Moving Average ( EMA )
3: Weighted Moving Average ( WMA )
4: Volume Weighted Moving Average ( VWMA )
5: Relative Moving Average (RMA)
and you can customize MACD Colors + Widths + Signals and MACD lines, and also can Hide or Unhide Histogram / Cross Sign / MACD Zone Color
hope so you like it, 🥰
Investing and trading in cryptocurrencies is very risky, as anything can happen at any time.
***NOT FINANCIAL, LEGAL, OR TAX ADVICE! JUST OPINION! I AM NOT AN EXPERT! I DO NOT GUARANTEE A PARTICULAR OUTCOME I HAVE NO INSIDE KNOWLEDGE! YOU NEED TO DO YOUR OWN RESEARCH AND MAKE YOUR OWN DECISIONS! THIS IS JUST EDUCATION & ENTERTAINMENT! USE ALTCOIN DAILY AS A STARTING OFF POINT!
Bollinger Bands And Aroon Scalping (by Coinrule)Many technical indicators can be profitable in certain market conditions while failing in others. No indicator is perfect alone.
All the best trading strategies involve multiple indicators and leverage the benefit of each of them. The following is an optimised strategy based on Bollinger Bands and the Aroon indicator.
The Bollinger Bands are among the most famous and widely used indicators. They can suggest when an asset is oversold or overbought in the short term, thus provide the best time for buying and selling it.
A strategy buying dips can work well during times of uptrend. Downtrends will result in a drawdown for the P&L of the strategy. The suggested approach minimises the drawdowns, ensuring that the system trades only when it's more likely to close the trade in profit.
The Setup
ENTRY
The price crosses below the basis line of the Bollinger Band indicator
The Aroon Indicator is above 90
EXIT
The price crosses below the upper Bollinger Band
The Aroon Indicator drops below 70
The Aroon Indicator plays a key role in this strategy. It acts as a confirmation that the asset is currently in an uptrend. On the other hand, it acts as a stop if market conditions deteriorate. The strategy uses an Aroon Indicator set to 288 periods to provide a longer-term view on market conditions, not being heavily dependent on short-term volatility.
The best time frame for this strategy based on our backtest is the 4-hr . The 1-hr can work well with three times more trades, on average. As trades increase, the profitability decreases. Yet again, this is the confirmation that trading more does not mean gaining more.
To make the results more realistic, the strategy assumes each order to trade 30% of the available capital. 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.
Forex Scalping 1min Bollinger Bands, RSI and ADX Trading SystemThis is a Forex Scalping Trading Sytem based on the Bollinger Bands.
Its suited for major pairs, with lowest possible comission (below 1 pip) and with timeframes ranging between 1-15 min.
Indicators:
Bollinger bands
ADX
RSI
Rules for entry:
Long Entry: price to move below the upper Bollinger Bands RSI raise above the 30 line and ADX<32 at the same time.
Short Entry: price to move above the upper Bollinger Bands, RSI raise below the 70 line and ADX<32 at the same time.
Rules for exit
Profit Exit: 3 options: 1, exit position when the price touches the middle band, 2) when the price touches the opposite band, X pips target profit.
Loss Exit: X pips loss
Keltner Channel - Trend Based StrategyThis strategy is based on 3 main indicators.
1st indicator is a trend indicator, which consists of SMA and EMA
2nd is Keltner Channel
3rd is DM indicator.
The conditions for the entry of this strategy are following:
First of all the assets need to be in an upward trend, this will occur when the EMA will cross SMA. The next condition for the entry is the opening and the closure of the candle. The open price of the candle should be in the upper part of the Keltner Channel and the close price should be above the Keltner channel. The third condition for the DM indicator is to be above a certain benchmakr. This benchmark can be set in the settings of the strategy.
The strategy has two potential Take Profit levels and single stop-loss levels. For the more efficient way you may try an use the trailing stop or extend the number of take-profit levels.
Advanced OutSide with HMA and Klinger Forex Swing strategyThis is a swing forex strategy, adapted for big timeframes, such as 4h+.
For this example I adapted the strategy to EUR USD main forex pair.
Its components are:
Outside condition
Klinger Oscillator
Hull moving average
Rules for entry
For long: if current high is bigger than previous high and current is smaller than previous low and klinger is positive, close of the candle is above lsma and we have a bull candle.
For short: if current high is smaller than previous high and current is bigger than previous low and klinger is negative, close of the candle is below lsma and we have a bear candle.
Rules for exit
We exit when we have a reverse condition
We exit in case we hit the tp/sl based on % movement of the price.
If you have any questions, let me know !
Full Swing Gold Vwap Macd SMO StrategyThis is a full strategy designed for gold market using 12h timeframe chart.
Its components are:
VWAP monthly
SMO oscillator
MACD histogram
Rules for entry:
For long: when enter when close of the candle is above vwap monthly, current histogram is higher than the previous one and SMO oscillator is above 0
For long: when enter when close of the candle is below vwap monthly, current histogram is lower than the previous one and SMO oscillator is below 0
Rules for exit:
We exit the trade if we get a reverse condition.
We also exit the trade based on a risk management system, both for SL and TP using % movements.
If you have any questions let me know !
Strategy TemplateThis is the fastest way to create a Trading View strategy. The template I have created includes stoploss and take profit enabling and plotting, date range, and strategy buy and sell conditions. I believe this will benefit the people in the Trading View community by creating a strategy faster and more efficiently than just repeating pine script code. All that needs to be done by the person using this script is to add their own indicators, and create their own buy and sell signals. Then they can immediately start back testing their new strategy!
Crypto swing correlation RSI and SMAThis is a crypto swing strategy, designed for long term periods and correlated pairs with crypto market total(or other coins used as correlation, however I recommend total of crypto or btc)
Its components are:
RSI with a very length
Correlation candles
SMA 9
Rules for entry:
For long : RSI is above 51 level and going higher and close of the candle is above the SMA
For short :RSI is below 49 and going lower and close of the candle is below the SMA
Rules for exit:
We exit when we encountered an opposite condition than the entry one, or based on take profit/stop loss levels.
If you have any questions let me know !
DMI + HMA - No Risk ManagementDMI (Directional Movement Index) and HMA (Hull Moving Average)
The DMI and HMA make a great combination, The DMI will gauge the market direction, while the HMA will add confirmation to the trend strength.
What is the DMI?
The DMI is an indicator that was developed by J. Welles Wilder in 1978. The Indicator was designed to identify in which direction the price is moving. This is done by comparing previous highs and lows and drawing 2 lines.
1. A Positive movement line
2. A Negative movement line
A third line can be added, which would be known as the ADX line or Average Directional Index. This can also be used to gauge the strength in which direction the market is moving.
When the Positive movement line (DI+) is above the Negative movement line (DI-) there is more upward pressure. Ofcourse visa versa, when the DI- is above the DI+ that would indicate more downwards pressure.
Want to know more about HMA? Check out one of our other published scripts
What is this strategy doing?
We are first waiting for the DMI to cross in our favoured direction, after that, we wait for the HMA to signal the entry. Without both conditions being true, no trade will be made.
Long Entries
1. DI+ crosses above DI-
2. HMA line 1 is above HMA line 2
Short Entries
1. DI- Crosses above DI+
2. HMA line 1 is below HMA lilne 2
Its as simple as that.
Conclusion
While this strategy does have its downsides, that can be reduced by adding some risk manegment into the script. In general the trade profitability is above average, And the max drawdown is at a minimum.
The settings have been optimised to suite BTCUSDT PERP markets. Though with small adjustments it can be used on many assets!
DMI Swings (by Coinrule)The Directional Movement Index is a handy indicator that helps catch the direction in which the price of an asset is moving. It compares the prior highs and lows to draw three lines:
Positive directional line (+DI)
Negative directional line (-DI)
Average direction index (ADX)
DMI is simple to interpret. When +DI > - DI, it means the price is trending up. On the other hand, when -DI > +DI, the trend is weak or moving on the downside.
The ADX does not give an indication about the direction but about the strength of the trend.
Typically values of ADX above 25 mean that the trend is steeply moving up or down, based on the -DI and +D positioning. This script aims to capture swings in the DMI, and thus, in the trend of the asset, using a contrarian approach.
ENTRY
-DI is greater than +DI
ADX is greater than 45
EXIT
+DI is greater than -DI
ADX is greater than 45
Trading on high values of ADX, the strategy tries to spot extremely oversold and overbought conditions. Values of ADX above 45 may suggest that the trend has overextended and is may be about to reverse.
Our backtests suggest that this script performs well for very short-term scalping strategies on low time frames, such as the 1-minute.
The script considers a 0.1% trading fee to make results more realistic to those you can expect from live market conditions. So realistically, live results should be similar to backtested results.
You can plug this script directly into your crypto exchange using TradingView Signals on Coinrule.
Trade Safely!
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
[VJ]Phoenix Force of PSAR +MACD +RSIThis is a simple intraday strategy for working on Stocks or commodities based out on PSAR, MACD , RSI and chop index . You can modify the start time and end time based on your timezones. Session value should be from market start to the time you want to square-off
Important: The end time should be at least 2 minutes before the intraday square-off time set by your broker
Comment below if you get good returns
Strategy: Entry Exits using PSAR and momentum and trend using MACD and RSI. A chop index is used as filtering
Indicators used :
Parabolic SAR is a technical indicator that is used to determine the price direction of stocks and it also draws attention to the traders when the price is changing
PSAR helps you:
Identify when a certain price trend is going to change direction
Indicate the most effective level at which to enter into the trade
Indicate the most effective exit point for the trade
Moving average convergence divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security's price. ... Traders may buy the security when the MACD crosses above its signal line and sell—or short—the security when the MACD crosses below the signal line
RSI is intended to chart the current and historical strength or weakness of a stock or market based on the closing prices of a recent trading period.
Buying/Selling
When trading with the parabolic SAR, you would buy a market when the dots move below the current asset price and are green in colour. Alternatively, you would sell a market when the dots move above the current asset price and are red in colour. We use MACD , RSI to ensure that a right trade is picked when PSAR gives an indication. CI is used to stay away from the range bound market as much as possible.
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
MA length : 200
RSI threshold : 50
MACD: 12,26,9
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
[VJ] Hulk Smash IntraThis is a simple intraday strategy for working on Stocks or commodities based out on Super Trend and ever reliable ADX . You can modify the start time and end time based on your timezones. Session value should be from market start to the time you want to square-off
Important: The end time should be at least 2 minutes before the intraday square-off time set by your broker
Comment below if you get good returns
Strategy: Supertrend and ADX strength (Hulk Smash)
Indicators used :
Super trend is simple and easy to use indicator and gives a precise reading about an on going trend.It is built with two parameters, namely period and multiplier.The Buy and Sell signal modifies once the indicator tosses over the closing price. When the Super trend closes above the Price, a Buy signal is generated, and when the Super trend closes below the Price, a Sell signal is generated. In this case we use it only for direction .
ADX informs a trader when the market is trending.It filters out anti trend trades to help trend chasing indicators from frequent whipsaws
Multiplier is a vital input for Super trend. If the multiplier value is too high, then lesser number of signals is made.
Buying/Selling
• If the price is going UP, and the ADX indicator is also going UP, then we have the case for a bullish trend.
• The same is true if the price is going down and the ADX indicator is going UP. Then we have the case for a bearish trend.
• Value of ADX below 20 is called trading zone which implies non-trending market
• Trade with Strength only if the Super trend is validating
ADX Values
0 - 20 : Non Trending (Range bound market, phase of Accumulation/Distribution)
20-45 : Strong Signal (helpful for traders)
45-60 : Very strong trend (occur rarely, indicate exhaustion)
60 - 100 : Extremely strong trend (very rare, unsustainable trends, be ready for reversals)
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
ADX Factor : vary as per info above
ST multiplier : 3
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
QuickSilver Intraday using RSIThis is a simple intraday strategy using very basic intraday super indicators - RSI & VWAP for working on Stocks . You can modify the values on the stock and see what are your best picks. Comment below if you found something with good returns
Strategy:
Indicators used :
The Relative Strength Index (RSI) is one of the most popular and widely used momentum oscillators.The values of the RSI oscillator, typically measured over a 14-day period, fluctuate between zero and 100. The Relative Strength Index indicates oversold market conditions when below 30 and overbought market conditions when above 70
VWAP identifies the true average price of a stock by factoring the volume of transactions at a specific price point and not based on the closing price. VWAP can add more value than your standard 10, 50, or 200 moving average indicators because VWAP reacts to price movements based on the volume during a given period.
Buying happens at VWAP Breakouts which is then validated with RSI to check for overbought & oversold conditions.
Aggressive trade stop can be employed by using the % for long and shorts in the strategy.
Usage & Best setting :
Choose a good volatile stock and a time frame - 10m.
RSI : 9
Overbought & Oversold - can be varied as per user
There is stop loss and take profit that can be used to optimise your trade
Extending this to,
In general guidelines for RSI :
Short-term intraday traders (day trading) often use lower settings with periods in the range of 9-11.
Medium-term swing traders frequently use the default period setting of 14.
Longer-term position traders often set it at a higher period, in the range of 20-30.
The template also includes daily square off based on your time.
[VJ]War Machine PAT IntraThis is a simple intraday strategy for working on Stocks . You can modify the values on the stock and see what are your best picks. Comment below if you found something with good returns
Strategy:
Indicators used :
The Choppiness Index is designed to determine whether the market is choppy or trading sideways, or not choppy and trading within a trend in either direction. Using a scale from 1 - 100, the market is considered to be choppy as values near 100 (over 61.80) and trending when values are lower than 38.20)
The Money Flow Index (MFI) is a momentum indicator that measures the flow of money into and out of a security over a specified period of time. It is related to the Relative Strength Index (RSI) but incorporates volume, whereas the RSI only considers price. The MFI is calculated by accumulating positive and negative Money Flow values (see Money Flow), then creating a Money Ratio. The Money Ratio is then normalized into the MFI oscillator form.
Using the combination of CI (trend factor as constant) and varying MFI, we can buy/sell when conditions are met
Buying with MFI
1. MFI drops below 20 and enters inside oversold zone.
2. MFI bounces back above 20.
3. MFI pulls back but remains above 20.
4. A MFI break out above its previous high is a good buy signal.
Selling with MFI
1. MFI rises above 80 and enters inside overbought zone.
2. MFI drops back below 80.
3. MFI rises slightly but remains below 80.
4. MFI drops lower than its previous low is a signal to short sell or profit booking
Usage & Best setting :
Choose a good volatile stock and a time frame - 5m.
Trending factor : 50
Overbought & Oversold - can be varied as per user
There is stop loss and take profit that can be used to optimise your trade
The template also includes daily square off based on your time.
Combo Backtest 123 Reversal & RSIThis is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The RSI is a very popular indicator that follows price activity.
It calculates an average of the positive net changes, and an average
of the negative net changes in the most recent bars, and it determines
the ratio between these averages. The result is expressed as a number
between 0 and 100. Commonly it is said that if the RSI has a low value,
for example 30 or under, the symbol is oversold. And if the RSI has a
high value, 70 for example, the symbol is overbought.
WARNING:
- For purpose educate only
- This script to change bars colors.
Aggresive Scalper/Swing Crypto StrategyThis is a simple yet very efficient scalper long strategy adapted for low timeframes for crypto. Can also be used with bigger timeframes as a swinger.
Its main components are:
Price oscillator swing
Vortex
Risk management for TP/SL
Rules for entry
We calculate the difference between the oscillator from the lowest low and the highest high. If the difference is positive, its a long potential. If its negative we exit from the long trade.
At the same time we check that the we have a crossover between the VIP vortex with the VIM vortex part.
Lastly we check that the current candle is bigger the second previous high.
Rules for exit
If we reach the take profit or the stop loss.
If we have a negative difference betwee LL and HH and VIP vortex crossunder with VIM vortex .
In this example I aimed for a 1:10 risk reward ratio, meaing that for every dollar lost, we will gain 10 when we win. Thus having a 10% minimum win rate will give us a profit over many trades.
If you have any questions, let me know !
Combo Backtest 123 Reversal & Awesome Oscillator (AO) This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
This indicator is based on Bill Williams` recommendations from his book
"New Trading Dimensions". We recommend this book to you as most useful reading.
The wisdom, technical expertise, and skillful teaching style of Williams make
it a truly revolutionary-level source. A must-have new book for stock and
commodity traders.
The 1st 2 chapters are somewhat of ramble where the author describes the
"metaphysics" of trading. Still some good ideas are offered. The book references
chaos theory, and leaves it up to the reader to believe whether "supercomputers"
were used in formulating the various trading methods (the author wants to come across
as an applied mathemetician, but he sure looks like a stock trader). There isn't any
obvious connection with Chaos Theory - despite of the weak link between the title and
content, the trading methodologies do work. Most readers think the author's systems to
be a perfect filter and trigger for a short term trading system. He states a goal of
10%/month, but when these filters & axioms are correctly combined with a good momentum
system, much more is a probable result.
There's better written & more informative books out there for less money, but this author
does have the "Holy Grail" of stock trading. A set of filters, axioms, and methods which are
the "missing link" for any trading system which is based upon conventional indicators.
This indicator plots the oscillator as a histogram where periods fit for buying are marked
as blue, and periods fit for selling as red. If the current value of AC (Awesome Oscillator)
is over the previous, the period is deemed fit for buying and the indicator is marked blue.
If the AC values is not over the previous, the period is deemed fir for selling and the indicator
is marked red.
WARNING:
- For purpose educate only
- This script to change bars colors.