Combo Backtest 123 Overbought/Oversold 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
Simple Overbought/Oversold indicator
WARNING:
- For purpose educate only
- This script to change bars colors.
Trend Analysis
Strategy NNFX Tester Strategy NNFX, Baseline, QQEs Fast C1, Slow C2, ATR, Volume and Exit
This is a Strategy Tester designed to work with Study (Alerts) of the same.
At time of creation based on Revision 8 of the Study.
DO NOT USE the Currency/Money Management section under settings. use the position sizing under "Inputs" - "Money Management" - "Risk per trade" which is defaulted to 2%
This has adjustable Baselines, Exits, ATR calculations, C1 and C2 are currently QQE & QQE Histo with adjustable settings but I'll include more choice of C1 & C2 as time goes on.
Find settings that work for you, then move them over to the Study version for best results.
Forward plans are to add much more options to both Alert/Strategy.
If anyone wants to collaborate or anything hit me up.
TemaI have found that such simple crossover can show good results. Basically it has only 2 TEMA and nothing more. I don't know what else to write here. The code is simplest and has only one filter, which take into consideration the direction of chart.
Combo Backtest 123 Reversal & N Bars Up 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
Evaluates for n number of consecutive higher closes. Returns a value
of 1 when the condition is true or 0 when false.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & N Bars Down 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
Evaluates for n number of consecutive lower closes. Returns a value
of 1 when the condition is true or 0 when false.
WARNING:
- For purpose educate only
- This script to change bars colors.
At Specified Time, Execute OrderSell current holdings at a specified time, then place a buy limit order at 1% the selling price.
Three moving average strategies
If the short term (Default 7) moving average cuts the medium term (default 25) moving average, BUY. Conversely, it generates the SELL signal. If the long term (Default 99) moving average cuts its short term moving average, Quick SELL. Conversely, it can be interpreted as Fast SELL. You can change the moving average and the number of days as you wish, and you can trade in the short or long term. I hope it was useful.
Momentum Strategy (BTC/USDT; 1h) - MACD (with source code)Good morning traders.
It's been a while from my last publication of a strategy and today I want to share with you this small piece of script that showed quite interesting result across bitcoin and other altcoins.
The macd indicator is an indicator built on the difference between a fast moving average and a slow moving average: this difference is generally plottted with a blue line while the orange line is simply a moving average computed on this difference.
Usually this indicator is used in technical analysis for getting signals of buy and sell respectively when the macd crosses above or under its moving average: it means that the distance of the fast moving average (the most responsive one) from the slower one is getting lower than what it-used-to-be in the period considered: this could anticipate a cross of the two moving averages and you want to anticipate this potential trend reversal by opening a long position
Of course the workflow is specularly the same for opening short positions (or closing long positions)
What this strategy does is simply considering the moving average computed on macd and applying a linear regression on it: in this way, even though the signal can be sligthly delayed, you reduce noise plotting a smooth curve.
Then, it simply checks the maximums and the minimums of this curve detecting whenever the changes of the values start to be negative or positive, so it opens a short position (closes long) on the maximum on this curve and it opens a long position (closes short) on the minimum.
Of course, I set an option for using this strategy in a conventional way working on the crosses between macd and its moving average. Alternatively you can use this workflow if you prefer.
In conclusion, you can use a tons of moving averages: I made a function in pine in order to allw you to use any moving average you want for the two moving averages on which the macd is based or for the moving average computed on the macd
PLEASE, BE AWARE THAT THIS TRADING STRATEGY DOES NOT GUARANTEE ANY KIND OF SUCCESS IN ADVANCE. YOU ARE THE ONE AND ONLY RESPONSIBLE OF YOUR OWN DECISIONS, I DON'T TAKE ANY RESPONSIBILITY ASSOCIATED WITH THEM. IF YOU RUN THIS STRATEGY YOU ACCEPT THE POSSIBILITY OF LOOSING MONEY, ALL OF MY PUBBLICATIONS ARE SUPPOSED TO BE JUST FOR EDUCATIONAL PURPOSES.
IT IS AT YOUR OWN RISK WHETHER TO USE IT OR NOT
But if you make money out of this, please consider to buy me a beer 😜
Happy Trading!
Heikin-Ashi MACD"Heikin-Ashi, also sometimes spelled Heiken-Ashi, means "average bar" in Japanese. The Heikin-Ashi technique can be used in conjunction with candlestick charts when trading securities to spot market trends and predict future prices. It's useful for making candlestick charts more readable and trends easier to analyze. For example, traders can use Heikin-Ashi charts to know when to stay in trades while a trend persists but get out when the trend pauses or reverses. Most profits are generated when markets are trending, so predicting trends correctly is necessary."
HA bars help us to smooth the price action, and I think MACD gives me a lot of signals and I need to eliminate them and add MACD strategy on Heiken-Ashi candles to look performance.
Mostly, it eliminates %75 of the signals, and most of the time it did increase backtest performance significantly.
There is still a way to it to combine other indicators for complete strategy, but at least We can achieve better MACD with this approach.
2Tier Ichimoku Pyramiding [Takazudo]Ichimoku based pyramiding strategy example that was tested on 4h TF.
makes the first entry when 2Tier Kumo breakout was occurred.
makes the extra entries when higher-low (on long) or lower-high (on short) was occurred.
uses short term MACD reversal + stop entry as a confirmation of the trend.
slack trailing stop loss.
changes entry quantity by the percentage of SL.
prevents the ranged entry.
This is just an example of how to trade using Ichimoku signals.
SNAP BACK 2.0 Strategy
This strategy is designed to allow you to catch the bounce or "SNAP Back" of an equity that has been in a trend.
1) Once the moving averages are in the order of 200SMA > 50 SMA > 34EMA > 20SMA > 8EMA (or reverse for and uptrend), the strategy is setup.
2) Next you wait for a trigger of the closing price crossing the 8EMA, while there is a desired gap size between the 8EMA and the 20SMA (2-10% of stock value preferred).
3) Exit position based on target profit reached (conservative sell half at 34EMA and engage a trailing stop loss for remainder or set static limit) or price crosses 8EMA or stop loss%
*)This code also allows you to determine your desired backtesting date compliments of alanaster
This code is the product of many hours of hard work on the part of the greater tradingview community. The credit goes to everyone in the community who has put code out there for the greater good.
The idea for the coding came from a video I watched on YouTube presented by TradeStation called Snap Back - thank you guys for the inspiration.
UPDATE: I have coded the other side of the strategy to allow you to take advantage of the same set-up in an uptrend for Short plays. You can turn the up or downsides on, off, or both.
The main intent is to catch the bounces of a falling stock. However, I have found that you can do the inverse and catch the drops in a rising stock (the latter is not as reliable). This also tends to work better on less volatile stocks. I have included a large volume of user defined conditions and display entry and exit conditions on the chart to see how your choices are impacting the script.
Basic SMA 200 StrategyThe SMA 200 basic strategy will be more than familiar to most traders.
This strategy is to stay with the programming language so to say the "Hello World" of trading.
The SMA 200 basic strategy is also one of the simplest strategies in trading. All that is required is the price and a 200 period moving average. Usually the strategy is used in the daily chart.
The rules are as follows:
Entry: A position is opened when the price crosses the moving average 200 from the bottom to the top.
Exit: The position is closed when the price crosses the moving average from top to bottom.
This is a trend following system and was originally used for trading stocks.
In my opinion, trading with the strategy is recommended to every beginner. There are strategies with better performance, but they are much more complicated to implement. And that's where the big advantage of the strategy can be seen.
Beginners are more than overwhelmed at the beginning of their trading career. Often beginners trade in the 5 min chart with 6 different indicators some signals that they have seen in a Youtube video.
Comparable to a beginner driver who immediately gets into a Porsche as his first car.
Beginners should follow simple rules and avoid intraday charts. Above all, you should do the actual work of a trader.A trader does not just press the mouse twenty times a day and then has easily earned 2000 $. A trader tests systems down to the smallest detail, optimizes and tests again, until he has found an almost " waterproof " trading system. The 200 SMA basic strategy is excellent for gaining experience, learning to follow the rules of a system and not to burn your money right away.
With this script you can test how successful the "simplest strategy in the world" would have been in the past.
Small tip: Do not trade Forex with it it will never work. The strategy is made for long trends and you can find them for example in the stock market.
Have fun with it! About a positive feedback I would be very happy of course.
PROSTRATS Pine Script for Swing TradingThis is a simple script for swing trading. It uses my 2 favorite indicators; the Choppiness Index as well as Fibonacci Retracement. This script is meant to run on the 4 hour time frame, in my case I use BTCUSD. It will buy when 2 conditions are met. The first is that the Choppiness Index is above 54.5 on the Daily Time frame, which means the price has potential to swing high or low. I used the security() function to ensure this takes place on the daily time frame because larger time frames tend to dominate smaller time frames in terms of overall swings. The second condition is that the price has to cross above the 1 level of the Fibonacci Retracement. This ensures that the swing is going to be an upwards swing, as opposed to a downwards one. The measure I took to ensure that the Fibonacci Retracement level of 1 is above the 0 level is to make sure that the r value of the 1 level is greater than the r value of the 0 level.
The sell condition is programmed to execute when either the price crosses above the 1.618 level(profit target) or cross below the 0 level(stop loss).
Bollinger Band with RSI
Using combination bollinger band and RSI indicator as guide to predict price volatility and the best entry point. The strategy logic is pretty straightforward where we're interested with close price that touches the lower bollinger band ; there are only two scenarios that will happened after the price reaches the lower band; the price might rebound from the lower bollinger band or drop lower and continue downtrend. To confirm the price movement, we use a second indicator which is the RSI to further investigate the price trend. For example, if the price reaches the lower bollinger band but the RSI value is not in the oversold region, we can conclude that the price will go lower and continue downtrend. If the RSI value is in the oversold region, we can use this price area as our entry point.
Stop loss is necessary to avoid losing too much capital if the RSI value lingers too long in the oversold region.
Best take profit area is when the price rebound above the middle bollinger band area/upper bollinger band or when the RSI reaches overbought region; whichever comes first.
Long entry:
RSI < 30 & close price < lower bollinger band
Exit entry:
RSI > 70
Default stop loss: -25%
Multi Moving Average Crossing (by Coinrule)Moving Averages are among the most common trading indicators. They are straightforward to interpret and effective to use.
One of the limitations of using moving averages is they can provide buy and sell signals with a relatively high lag , making it very difficult to spot the lows and tops of the trend.
Moving averages calculated with a low number of periods like the MA9 (the average of the previous nine price periods) react very fast to price moves providing prompt signals. On the other side, more signals may end up with more false-signals and more trades in a loss.
On the contrary, moving averages calculated with a higher number of periods like the MA100 (which considers the previous one hundred price periods) give more reliable signals, but with a delay.
A system catching the crossing of the MA50 over the MA100 is a good compromise for successful long-term strategies. It provides, on average, reliable buy signals.
The Multi Moving Average Crossing Strategy tries to optimize the exit without waiting for the same opposite crossing (MA50 below MA100). It uses the MA9 crossing below the MA50, instead, to spot a better time for selling.
The setup is as follows.
BUY when the Moving Average 50 crosses above the Moving Average 100
SELL when the Moving Average 9 crosses below the Moving Average 50
The higher is the time frame to calculate the Moving Averages, the better is the overall performance of the strategy. The 4-hour (or 6-hour) time frame seems to be the best, even if it results in fewer trades. If you want to trade more still with good results, the 1-hour time is a good compromise.
Advantages of the strategy
This strategy seeks to catch those that are more likely relevant uptrends and close the trade relatively quickly. More trades mean more opportunities. This is especially effective if you run the strategy on all the available coins on the market, as you could do with Coinrule.
Generally, a Multi Moving Averages approach beats the classic crossing strategy involving only two Moving Averages. We backtested a sample of twenty trading pairs to assess the benefits empirically.
The results show that the Multi Moving Average Strategy
outperforms 13 out of 20 times
has 95% higher average return
has 67% higher median return
The strategy assumes each order to trade 30% of the available capital and opens a trade at a time. A trading fee of 0.1% is taken into account.
Combo Backtest 123 Reversal & Money Flow Indicator 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
Indicator plots Money Flow Indicator (Chaikin). This indicator looks
to improve on Larry William's Accumulation Distribution formula that
compared the closing price with the opening price. In the early 1970's,
opening prices for stocks stopped being transmitted by the exchanges.
This made it difficult to calculate Williams' formula. The Chaikin
Oscillator uses the average price of the bar calculated as follows
(High + Low) /2 instead of the Open.
The indicator subtracts a 10 period exponential moving average of the
AccumDist function from a 3 period exponential moving average of the
AccumDist function.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & Modified Price-Volume Trend 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
The related article is copyrighted material from
Stocks & Commodities.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & MASS Index 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
The Mass Index was designed to identify trend reversals by measuring
the narrowing and widening of the range between the high and low prices.
As this range widens, the Mass Index increases; as the range narrows
the Mass Index decreases.
The Mass Index was developed by Donald Dorsey.
WARNING:
- For purpose educate only
- This script to change bars colors.
Jim's MACDMACD Buy/Sell Strategy
Filters bearish crossovers above the 0 line and bullish crossovers below.
Uses 34 ema to further filter the trades and take only longs above and only shorts below.
Apply at least 2:1 risk to reward ratio to account for losing trades.
Trade at own risk!
B-Xtrender [Backtest Edition] @QuantTherapyToday I have published a Backtest edition of one of my scripts.
For anyone looking into the indicators please have in the source below where the logic behind the indicator is nicely explained also the source of the inspiration of me coding it in tradingview.
ifta.org
Strategy
Entry when both bars are in alignment both green = long / both red = short
Exit when one is against your direction of trade
TSL will also kick in and exit when the percentage is breached
Moving Average is there to filter entries. Will allow entry only when active when the price is above (long-only) or below ( short-only )
Hope you are having a great day !
Moving Regression Band Breakout strategyFollowing the introduction of the Moving Regression Prediction Bands indicator (see link below), I'd like to propose how to utilize it in a simple band breakout strategy :
Go long after the candle closes above the upper band . The lower band (alternatively, the lower band minus the 14-period ATR or the central line ) will serve as a support line .
Exit as soon as the candle closes below the support line .
To manage the risk of false breakouts, a fixed stop loss is set to the value of the support line at the time of opening a position. When the support line moves above the position opening price, shift the stop loss to breakeven.
The same logic but in reverse applies to short positions.
As an option, it is possible to allow long entries only when the slope of the Moving Regression curve is positive (and short entries when the slope is negative).
Model parameters:
Length and Polynomial Order define the lag and smoothness of the model.
Multiplier specifies the width of the channel.
As the default model parameter values, I set those that I found to provide optimal risk / reward ratio on the daily timeframe (for both trending and range-bound market). However, the settings are very flexible and can be well-adjusted to particular market conditions. Feel free to play around and leave feedback in the comments!
Here's the original Moving Regression Prediction Bands script: