EURUSD COT Trend StrategyThis is a long term/investment type of strategy designed to have a good idea about where the big trend direction is headed.
Its logic, its made entirely on the COT report, mainly from looking into the net non comercial positions aka the speculators.
For bullish trend we look that the difference between long non comercial vs short non comercial is higher than 0
For bearish trend we look that the difference between long non comercial vs short non comercial is lower than 0.
This is mainly as an educational tool, for a full strategy, I recommend implement other things into it, like technical analysis or risk management.
If you have any questions, please let me know !
Indicateurs et stratégies
RSI Divergence Strategywhat is "RSI Divergence Strategy"?
it is a RSI strategy based this indicator:
what it does?
it gives buy or sell signals according to RSI Divergences. it also has different variables such as "take profit", "stop loss" and trailing stop loss.
how it does it?
it uses the "RSI Divergence" indicator to give signal. For detailed information on how it works, you can visit the link above. The quantity of the inputs is proportional to the rsi values. Long trades are directly traded with "RSI" value, while short poses are traded with "100-RSI" value.
How to use it?
The default settings are for scalp strategy but can be used for any type of trading strategy. you can develop different strategies by changing the sections. It is quite simple to use.
RSI length is length of RSİ
source is source of RSİ
RSİ Divergence lenght is length of line on the RSI
The "take profit", "stop" and "trailing stop" parts used in the "buy" group only affect buys. The "sell" group is similarly independent of the variables in the "buy" group.
The "zoom" section is used to enlarge or reduce the indicator. it only changes the appearance, it does not affect the results of the strategy.
Breakeven Line DemoPlug the breakeven line code into the bottom of your strategy to get visualization of your breakeven price. Line is green when net position is long, red when net short and invisible when strategy is risk neutral. Most useful for strategies which use pyramiding (successive entries in same direction stacked upon each other) as it can be difficult to track where prices needs to return to to allow closing in profit. Disclaimer: the strategy logic is garbage do not use it. It is only there so you can see how Breakeven Line logic is implemented.
Fast EMA above Slow EMA with MACD (by Coinrule)An exponential moving average ( EMA ) is a type of moving average (MA) that places a greater weight and significance on the most recent data points. The exponential moving average is also referred to as the exponentially weighted moving average . An exponentially weighted moving average reacts more significantly to recent price changes than a simple moving average simple moving average ( SMA ), which applies an equal weight to all observations in the period.
Moving average convergence divergence ( MACD ) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average ( EMA ) from the 12-period EMA .
The result of that calculation is the MACD line. A nine-day EMA of the MACD called the "signal line," is then plotted on top of the MACD line, which can function as a trigger for buy and sell signals. Traders may buy the coin when the MACD crosses above its signal line and sell—or short—the security when the MACD crosses below the signal line. Moving average convergence divergence ( MACD ) indicators can be interpreted in several ways, but the more common methods are crossovers, divergences, and rapid rises/falls.
The Strategy enters and closes the trade when the following conditions are met:
LONG
The MACD histogram turns bullish
EMA8 is greater than EMA26
EXIT
Price increases 3% trailing
Price decreases 1% trailing
This strategy is back-tested from 1 January 2022 to simulate how the strategy would work in a bear market and provides good returns.
Pairs that produce very strong results include AXSUSDT on the 5-minute timeframe. This short timeframe means that this strategy opens and closes trades regularly.
Additionally, the trailing stop loss and take profit conditions can also be changed to match your needs.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
[-_-] Level Breakout, Auto Backtesting StrategyDescription:
A Long only strategy based on breakout from a certain level formed by High price. It has auto-backtesting capabilities (you set ranges for the three main parameters: Lookback, TP and SL; the strategy then goes through different combinations of those parameters and displays a table with results that you can sort by Percentage of profitable trades AND/OR Net profit AND/OR Number of trades). So you can, for example, sort only by Net profit to find combination of parameters that gives highest net profit, or sort by Net profit and Percentage profitable to find a combination of parameters that gives the best balance between profitability and profit. The auto-backtesting also takes into account the commission which is set in % in the inputs (make sure to set the same value in properties of the strategy so that auto-backtesting and real backtesting results match).
NOTE: auto-backtesting only find the best combinations and displays them in a table, you will then need to manually set the Lookback, TP and SL inputs for real backtesting to match.
Parameters:
- Lookback -> # of bars for filtering signals; recommended range from 2 to 5
- TP (%) -> take profit; recommended range from 5 to 10
- SL (%) -> stop loss; recommended range from 1 to 5
- Commission (%) -> commission per trade
- Min/Max Lookback -> lookback range for auto-backtesting
- Min/Max TP -> take profit range for auto-backtesting
- Min/Max SL -> stop loss range for auto-backtesting
- Percentage profitable -> sort by percentage of profitable trades
- Net profit -> sort by net profit
- Number of trades -> sort by number of trades
Trend Following based on Trend ConfidenceThis is a Trend Following strategy based on the Trend Confidence indicator.
The goal of this strategy is to be a simple Trend Following strategy, but also to be as precise as possible when it comes to the question 'how confident are we that a linear trend is ongoing?'. For this we calculate the 'confidence' of a linear trend in the past number of closing prices. The idea of this strategy is that past a certain confidence, the ongoing linear trend is more likely to continue than not.
Trend Confidence:
The Trend Confidence shows us how strong of a linear trend the price has made in the past number (given by Length parameter) of closing prices. The steepness of the price change makes the Trend Confidence more extreme (more positive for an uptrend or more negative for a downtrend), and the deviation from a straight line makes the Trend Confidence less extreme (brings the confidence closer to 0). This way we can filter out signals by wild/sudden price moves that don't follow a clear linear trend.
Math behind the Trend Confidence:
A linear fit is made on the past number of closing prices, using Ordinary Linear Regression. We have the steepness of the linear fit: b in y=a+bx . And we have the standard deviation of the distances from the closing prices to the linear fit: sd . The Trend Confidence is the ratio b/sd .
Entries and Exits:
For entry and exit points we look at how extreme the Trend Confidence is. The strategy is based on the assumption that past a certain confidence level, the ongoing linear trend is more likely to continue than not.
So when the Trend Confidence passes above the 'Long entry" threshold, we go Long. After that when the Trend Confidence passes under the 'Long exit' threshold, we exit. The Long entry should be a positive value so that we go Long once a linear uptrend with enough confidence has been detected.
When the Trend Confidence passes below the 'Short entry' threshold, we go Short. After that when the Trend Confidence passes above the 'Short exit' threshold, we exit. The Short entry should be a negative value so that we go Short once a linear downtrend with enough confidence has been detected.
Default Parameters:
The strategy is intended for BTC-USD market, 4 hour timeframe. The strategy also works on ETH-USD with similar parameters.
The Length is arbitrarily set at 30, this means we look at the past 30 closing prices to determine a linear trend. Note that changing the length will change the range of Trend Confidence values encountered.
The default entry and exit thresholds for Longs and Shorts do not mirror each other. This is because the BTC-USD market goes up more heavily and more often than it goes down. So the ideal parameters for Longs and Shorts are not the same.
The positive results of the strategy remain when the parameters are slightly changed (robustness check).
The strategy uses 100% equity per trade, but has a 10% stop loss so that a maximum of 10% is risked per trade.
Commission is set at 0.1% as is the highest commission for most crypto exchanges.
Slippage is set at 5 ticks, source for this is theblock.co.
Ichimoku Cloud with MACD and Trailing Stop Loss (by Coinrule)The Ichimoku Cloud is a collection of technical indicators that show support and resistance levels, as well as momentum and trend direction. It does this by taking multiple averages and plotting them on a chart. It also uses these figures to compute a “cloud” that attempts to forecast where the price may find support or resistance in the future.
The Ichimoku Cloud was developed by Goichi Hosoda, a Japanese journalist, and published in the late 1960s. It provides more data points than the standard candlestick chart. While it seems complicated at first glance, those familiar with how to read the charts often find it easy to understand with well-defined trading signals.
The Ichimoku Cloud is composed of five lines or calculations, two of which comprise a cloud where the difference between the two lines is shaded in.
The lines include a nine-period average, a 26-period average, an average of those two averages, a 52-period average, and a lagging closing price line.
The cloud is a key part of the indicator. When the price is below the cloud, the trend is down. When the price is above the cloud, the trend is up.
The above trend signals are strengthened if the cloud is moving in the same direction as the price. For example, during an uptrend, the top of the cloud is moving up, or during a downtrend, the bottom of the cloud is moving down.
The MACD is a trend following momentum indicator and provides identification of short-term trend direction. In this variation it utilises the 12-period as the fast and 26-period as the slow length EMAs, with signal smoothing set at 9.
This strategy combines the Ichimoku Cloud with the MACD indicator to better enter trades.
Long/Exit orders are placed when three basic signals are triggered.
Long Position:
Tenkan-Sen is above the Kijun-Sen
Chikou-Span is above the close of 26 bars ago
Close is above the Kumo Cloud
MACD line crosses over the signal line
Exit Position:
Price increases 3% trailing
Price decreases 3% trailing
The script is backtested from 1 June 2022 and provides good returns.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
SeongMo_MA_V3(Elliot_helper)Made to make it easier to count Elliott waves.
If you renew your new high price, you'll continue your new high price
When the new low is renewed, the new low is continued.
If you are within the range of the previous candle, use the ratio of the difference between the median value of the previous candle and the closing price of the current candle to determine whether to continue the high or low price.
If a can with a tail that updates a new high price and a new low price at the same time comes out, the phrase "Check_candle!" appears to mean that you should check it with a lower time zone candle.
I11L - Reversal Trading Ideas by Larry ConnorsThis is my own Twist on Larry Connors Simple Tradingideas.
It Combines the RSI, Averaging In and the Lowest Bars in a Single System.
The current Configuration is designed for the Daily Timeframe.
Feel free to play with the Parameters and keep in mind that Larry Intended to buy fear and sell the greed!
The Rules are the following:
---Buy---
Buy, if the lowest Bar of your Configuration has been hit (default is set to 7).
---Average Down--
Buy, if the lowest Bar of your Configuration * Your open trades has been hit AND only if the buyin is atleast 1% cheaper.
---Close---
Close, if the RSI closes above a certain level (default is set to 70).
---TP---
There is no TP
---SL---
There is no SL, so be cautions of your tail Risk!
Extended Recursive Bands StrategyThe original indicator was created by alexgrover .
All credit goes to alexgrover for creating the indicator that this strategy uses.
This strategy was posted because there were multiple requests for it, and no strategy based on this indicator exists yet.
The Recursive Bands Indicator, an indicator specially created to be extremely efficient, I think you already know that calculation time is extra important in algorithmic trading, and this is the principal motivation for the creation of the proposed indicator. Originally described in Alex's paper "Pierrefeu, Alex (2019): Recursive Bands - A New Indicator For Technical Analysis", the indicator framework has been widely used in his previous uploaded indicators, however it would have been a shame to not upload it, however user experience being a major concern for me, I decided to add extra options, which explain the term "extended".
The Indicator
The indicator displays one upper and one lower band, every common usages applied to bands indicators such as support/resistance , breakout, trailing stop, etc, can also be applied to this one. Length controls how reactive the bands are, higher values will make the bands cross the price less often.
In order to provide more flexibility for the user alexgrover added the option to use various methods for the calculation of the indicator, therefore the indicator can use the average true range , standard deviation, average high-low range, and one totally exclusive method specially designed for this indicator.
Added logic:
We have implemented a logic that checks whether the bands have been following in the same direction for a set amount of bars. This logic must be true before it can enter trades. This is completely new code that was written by us entirely, and it makes a huge difference on strategy performance.
Strategy Long conditions:
1 — Price low is below the the lower band.
2 — The lower band keeps increasing in value until the 'lookback' setting amount of bars is reached.
Strategy Short conditions:
1 — Price high is above the upper band.
2 — The upper band keeps decreasing in value until the 'lookback' setting amount of bars is reached.
Strategy Properties:
We have set a default commission of 0.06% because these are Bybit's fees. The strategy uses an order size of 10% of equity, since drawdown is very low like this. We also use a 10 tick slippage to keep results realistic and account for this. All other settings were left as default apart from initial capital, just to decrease the size of the numbers.
Bollinger Band strategy with split, limit, stopEntering a short position after breaking the upper Bollinger Band, entering a long position when entering after breaking the lower Bollinger Band
Provides templates for how to display position average price, stop loss, and profit price using the plot function on the chart, and how to buy splits
After entering the position, if the price crosses the mid-band line, the stop loss is adjusted to the mid-band line.
Cipher_B (Finandy support)In this version of the script you can force to cancel your position after some amount of time indepedently on price action. For example, your bot open a short position with SL=1% and TP=2.4% but price did not reach any of this level over the course of to say 8 hours. In this case, position will be closed regardless of the price.
Other interesting features are volume and slope filters. Slope is essentially a derivative of price action. If you don't like to buy your instrument under high volatility, for example, if a trend goes down too fast then you can filter long position which could be opened according to the strategy. Same thing for volume filter. If the volume is too high/too low, you might want to escape such setup in your trading strategy.
Moreover, you can tune price shift for opening position. To say, if you believe that the signal for opening position comes too early everytime, you can force the strategy to buy at 1% lower price than the current price when the signal comes. Similar logic for short: open position price will be always higher than the price of the signal. If the price did not reach such level then position will be automatically cancel with a new signal arrival. Check the backtesting results to understand better the logic.
Rob Booker Reversal Tabs StrategyRob Booker Reversal Tabs Strategy is an updated version of Rob Bookers Reversal Tab study: Rob Booker Reversal Tabs
While the original is a Pinescript study, this version can be switched between strategy and indicator mode.
Rob Bookers script generates reversal signal based on MACD and Stochastics, it is not a true reversal system, default pyramiding value is set to 5.
Inputs determine MACD and Stochastics settings. The only additional input is the "Strategy Mode" checkbox.
This script works well on its own for some tickers, but like any reversal pattern generating scripts, traders will profit from looking at overall price action and trend strength before making a trade.
From the original:
A simple reversal pattern indicator that uses MACD and Stochastics.
Created by Rob Booker and programmed by Andrew Palladino.
Please note that I only updated the original to V5 and edited it to be a strategy, which was a grand total of 5 minutes of work. I updated it because I wanted to see how the script performs as a strategy and I'm publishing it in case others would like to use it. I take no credit whatsoever for the original and WILL take this version down if Rob Booker or his Team ask me to or decide to release their own strategy version of the original.
Check out Rob Bookers scripts and ideas on his Tradingview account: robbooker
Ultimate Strategy Template (Advanced Edition)Hello traders
This script is an upgraded version of that one below
New features
- Upgraded to Pinescript version 5
- Added the exit SL/TP now in real-time
- Added text fields for the alerts - easier to send the commands to your trading bots
Step 1: Create your connector
Adapt your indicator with only 2 lines of code and then connect it to this strategy template.
For doing so:
1) Find in your indicator where are the conditions printing the long/buy and short/sell signals.
2) Create an additional plot as below
I'm giving an example with a Two moving averages cross.
Please replicate the same methodology for your indicator wether it's a MACD , ZigZag , Pivots , higher-highs, lower-lows or whatever indicator with clear buy and sell conditions.
//@version=5
indicator(title='Moving Average Cross', shorttitle='Moving Average Cross', overlay=true, precision=6, max_labels_count=500, max_lines_count=500)
type_ma1 = input.string(title='MA1 type', defval='SMA', options= )
length_ma1 = input(10, title=' MA1 length')
type_ma2 = input.string(title='MA2 type', defval='SMA', options= )
length_ma2 = input(100, title=' MA2 length')
// MA
f_ma(smoothing, src, length) =>
rma_1 = ta.rma(src, length)
sma_1 = ta.sma(src, length)
ema_1 = ta.ema(src, length)
iff_1 = smoothing == 'EMA' ? ema_1 : src
iff_2 = smoothing == 'SMA' ? sma_1 : iff_1
smoothing == 'RMA' ? rma_1 : iff_2
MA1 = f_ma(type_ma1, close, length_ma1)
MA2 = f_ma(type_ma2, close, length_ma2)
// buy and sell conditions
buy = ta.crossover(MA1, MA2)
sell = ta.crossunder(MA1, MA2)
plot(MA1, color=color.new(color.green, 0), title='Plot MA1', linewidth=3)
plot(MA2, color=color.new(color.red, 0), title='Plot MA2', linewidth=3)
plotshape(buy, title='LONG SIGNAL', style=shape.circle, location=location.belowbar, color=color.new(color.green, 0), size=size.normal)
plotshape(sell, title='SHORT SIGNAL', style=shape.circle, location=location.abovebar, color=color.new(color.red, 0), size=size.normal)
/////////////////////////// SIGNAL FOR STRATEGY /////////////////////////
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title='🔌Connector🔌', display = display.data_window)
Basically, I identified my buy, sell conditions in the code and added this at the bottom of my indicator code
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title="🔌Connector🔌", transp=100)
Important Notes
🔥 The Strategy Template expects the value to be exactly 1 for the bullish signal, and -1 for the bearish signal
Now you can connect your indicator to the Strategy Template using the method below or that one
Step 2: Connect the connector
1) Add your updated indicator to a TradingView chart
2) Add the Strategy Template as well to the SAME chart
3) Open the Strategy Template settings and in the Data Source field select your 🔌Connector🔌 (which comes from your indicator)
From then, you should start seeing the signals and plenty of other stuff on your chart
🔥 Note that whenever you'll update your indicator values, the strategy statistics and visual on your chart will update in real-time
Settings
- Color Candles: Color the candles based on the trade state ( bullish , bearish , neutral)
- Close positions at market at the end of each session: useful for everything but cryptocurrencies
- Session time ranges: Take the signals from a starting time to an ending time
- Close Direction: Choose to close only the longs, shorts, or both
- Date Filter: Take the signals from a starting date to an ending date
- Set the maximum losing streak length with an input
- Set the maximum winning streak length with an input
- Set the maximum consecutive days with a loss
- Set the maximum drawdown (in % of strategy equity)
- Set the maximum intraday loss in percentage
- Limit the number of trades per day
- Limit the number of trades per week
- Stop-loss: None or Percentage or Trailing Stop Percentage or ATR - I'll add shortly multiple options for the trailing stop loss
- Take-Profit: None or Percentage or ATR - I'll add also a trailing take profit
- Risk-Reward based on ATR multiple for the Stop-Loss and Take-Profit
Special Thanks
Special thanks to @JosKodify as I borrowed a few risk management snippets from his website: kodify.net
Best
Dave
Je Buurmans Simple Manual EntriesIf ever in need for a quick way to swiftly check some random trades
or brag to your 'friends'/buddies/pals/haters/followers/the_crowd with fabricated winnings ..
This Script is for you.
Either set the entry and exit dates for a maximum of up to 10 trades (either Long or Short) via Menu
or simply drag the 'handler' to the desired time/date.
Next fill in how many shares/contracts to enter and/or exit
There is some Visual Feedback as well.
(initially written specifically for someone .. now free for grabs)
Strategy Myth-Busting #20 - HalfTrend+HullButterfly - [MYN]#20 on the Myth-Busting bench, we are automating the " I Found Super Easy 1 Minute Scalping System And Backtest It 100 Times " strategy from " Jessy Trading " who claims 30.58% net profit over 100 trades in a couple of weeks with a 51% win rate and profit factor of 1.56 on EURUSD .
This one surprised us quite a bit. Despite the title of this strategy indicating this is on the 1 min timeframe, the author demonstrates the backtesting manually on the 5 minute timeframe. Given the simplicity of this strategy only incorporating a couple of indicators, it's robustness being able to be profitable in both low and high timeframes and on multiple symbols was quite refreshing.
The 3 settings which we need to pay most attention to here is the Hull Butterfly length, HalfTrend amplitude and the Max Number Of Bars Between Hull and HalfTrend Trigger. Depending on the timeframe and symbol, these settings greatly impact the performance outcomes of the strategy. I've listed a couple of these below.
And as always, If you know of or have a strategy you want to see myth-busted or just have an idea for one, please feel free to message me.
This strategy uses a combination of 3 open-source public indicators:
Hull Butterfly Oscillator by LuxAlgo
HalfTrend by Everget
Trading Rules
5 min candles but higher / lower candles work too.
Stop loss at swing high/low
Take Profit 1.5x the risk
Long
Hull Butterfly gives us green column, Wait for HalfTrend to present an up arrow and enter trade.
Short
Hull Butterfly gives us a red column , Wait for HalfTrend to present a down arrow and enter trade.
Alternative Trading Settings for different time frames
1 Minute Timeframe
Move the Hull Butterfly length from the default 11 to 9
Move the HalfTrend Amplitude from the default 2 to 1
Enabling ADX Filter with a 25 threshold
2 Hour Timeframe
Move the HalfTrend Amplitude from the default 2 to 1
Laddered Take Profits from 14.5% to 19% with an 8% SL
CM_SlingShotSystem+_CassicEMA+Willams21EMA13 htc1977 editionThis strategy is a combination of 2 indicators based on EMA(actually x3 EMAs and Williams ind.
We usin this to see where EMA fast is above EMA slow(for long), entry position when price hit fast EMA and exit if trend changes or price overbought, or by stoploss 1%.
The opposite for a short position.
For better result You can change every EMA's, stoploss, Willam's ind and other visualisation in settings.
If You find good combination - please, let me know(if You want).
I will check it with ML, and attach it here.
Original indicators will write in comments
iMoku (Ichimoku Complete Tool) - The Quant Science iMoku™ is a professional all-in-one solution for the famous Ichimoku Kinko Hyo indicator.
The algorithm includes:
1. Backtesting spot
2. Visual tool
3. Auto-trading functions
With iMoku you can test four different strategies.
Strategy 1: Cross Tenkan Sen - Kijun Sen
A long position is opened with 100% of the invested capital ($1000) when "Tenkan Sen" crossover "Kijun Sen".
Closing the long position on the opposite condition.
There are 3 different strength signals for this strategy: weak, normal, strong.
Weak : the signal is weak when the condition is true and the price is above the 'Kumo'
Normal : the signal is normal when the condition is true and the price is within the 'Kumo'
Strong : the signal is strong when the condition is true and the price is below the 'Kumo'
Strategy 2: Cross Price - Kijun Sen
A long position is opened with 100% of the invested capital ($1000) when the price crossover the 'Kijun Sen'.
Closing the long position on the opposite condition.
There are 3 different strength signals for this strategy: weak, normal, strong.
Weak : the signal is weak when the condition is true and the price is above the 'Kumo'
Normal : the signal is normal when the condition is true and the price is inside the 'Kumo'
Strong : the signal is strong when the condition is true and the price is below the 'Kumo'
Strategy 3: Kumo Breakout
A long position is opened with 100% of the invested capital ($1000) when the price breakup the 'Kumo'.
Closing the long position with a percentage stop loss and take profit on the invested capital.
Strategy 4: Kumo Twist
A long position is opened with 100% of the invested capital ($1000) when the 'Kumo' goes from negative to positive (called "Twist").
Closing the long position on the opposite condition.
There are 2 different strength signals for this strategy: weak, and strong.
Weak : the signal is weak when the condition is true and the price is above the 'Kumo'
Strong : the signal is strong when the condition is true and the price is below the 'Kumo'
This script is compliant with algorithmic trading.
You can use this script with trading terminals such as 3Commas or CryptoHopper. Connecting this script is very easy.
1. Enter the user interface
2. Select and activate a strategy
3. Copy your bot's links into the dedicated fields
4. Create and activate alert
Disclaimer: algorithmic trading involves risk, the user should consider aspects such as slippage, liquidity and costs when evaluating an asset. The Quant Science is not responsible for any kind of damage resulting from use of this script. By using this script you take all the responsibilities and risks.
Donchian Trendline - Support Resistance Slope [UhoKang]// This is a strategy that draws a trend line in the form of a slope whenever the high point and low point are updated.
// The upper slope serves as a resistance line, and the lower slope serves as a support line.
// Buy when the of the candle crosses the slope
Pure Mark Minervini 10%TP 5%CLBacktesting Mark Miniverni Template
By Donnie Lee
Overall, a good basic guideline from Mark Miniverni to choose which stock to buy. His selection are said to be stocks in stage 2 uptrend phase which could see price surge soon.
This script enable backtesting of Mark template (Investor's Business Ranking Excluded) on equity like stocks
Further fine tuning with additional filters are needed to find good entry with desired cut loss level and position sizing.
There is no holy grail strategy. Choose one with an edge that you are comfortable with and stick to it.
Losing is part and parcel of trading. Hesitation to cut loss can lead to big loss. And if you can avoid losing big, you might stand a chance to profit in the end.
Mark Miniverni Template
1. The current stock price is above both the 150-day (30-week) and the 200-day (40-week) moving average price lines.
2. The 150-day moving average is above the 200-day moving average.
3. The 200-day moving average line is trending up for at least 1 month (preferably 4–5 months minimum in most cases).
4. The 50-day (10-week) moving average is above both the 150-day and 200-day moving averages.
5. The current stock price is trading above the 50-day moving average.
6. The current stock price is at least 25% above its 52-week low (30% as per his book 'Trade Like a Stock Market Wizard').
7. The current stock price is within at least 25% of its 52-week high (the closer to a new high the better).
FFT Strategy Bi-Directional Stop/Profit/Trailing + VMA + AroonThis strategy uses the Fast Fourier Transform inspired from the source code of @tbiktag for the Fast Fourier Transform & @lazybear for the VMA filter.
If you are not familiar with the Fast Fourier transform it is a variation of the Discrete Fourier Transform. Veritasium on youtube has a great video on it with a follow up recommendation from 3brown1blue. In short it will extract all the frequencies from a set of data. @tbiktag laid the groundwork for creating the indicator which will allow you to isolate only those signals which are the most relevant and remove the noise. I recommend having @tbiktag's FFT Transform indicator side by side with this to understand what my variation is doing by setting similar settings .
Using this idea, you can then optimize a strategy to the frequencies that are best. The main entry signal is when the FFT Signal crosses above or below the 0 line .
Included with this strategy is the ability to optionally bi-directionally set:
Stop Loss
Trailing Stop Loss
Take Profit
Trailing Take Profit
Entries are optionally further filtered by use of the VMA using the algorithm from LazyBear which allows you to adjust a variable moving average with 3 market trend detections. Green represents upwards momentum; Blue sideways trading and Red downwards momentum. The idea being to filter out buy or sell entries unless the market is moving in that direction, and this makes a big difference as you can see for yourself when you turn it off or on. Turning it off will change the color of the FFT signal to orange instead of the green, blue, red colors .
I have added 2 custom stop loss types as well for experimentation:
1. VMA Filter stop loss to exit the trade if the VMA detects a market trend direction change matching the rules you have set. I have set this to off by default, but it is there so you can see what affect it may have on other tickers. It can increase the profit factor but usually at a cost of net profit.
2. The Aroon Filter stop loss with different lengths for the short or long direction. For the Aroon strategy (which is a trend change detector) it is considered bullish if the upper line (green in my code) is above 70 and the lower line (red in my code) is below 30 and the opposite for the bearish case. With this in mind, I have set it to filter by default only the extreme ends (99 and 1) to increase profit factor and net profit but I encourage you to try different settings and see how it affects things. Turning this off yields much higher net profit but at the cost of the profit factor and drawdown . To disable this just uncheck the 'Use Aroon Filter Long' (or short) and it will also hide the aroon graphics and crosses on the plot.
I will be adding more features in an attempt to lower the drawdown on this strategy but I hope you enjoy what I have so far!
Backtests Are BrokenThis script demonstrates a fatal flaw with Trading View backtests involving trailing stops. Trading View assumes the most optimistic case for trailing stops, always giving you the best case high/low of a bar instead of the worst or average case. Within a bar, the price could reverse against your position after the open and trigger your trailing stop for a loss before the price goes in your favor, but Trading View backtests do not consider this and instead always give you the best case returns. This allows a trivial strategy to appear as though it would perform miracles.
This strategy enters on a random bar and sets a trailing stop triggered one tick better than the current price with 0 trailing distance. Trading View then generously gives this strategy the difference between the open price and best possible wick as a profit. The only way this strategy can lose money in simulation is if the price goes straight down after entry and never retraces. It works on all symbols on all timeframes due to this systematic problem with the Trading View backtester.