Backtest AdapterThis is a proof-of-concept Backtest Adapter that can be used with my recent publication "Machine Learning: Lorentzian Classification" located here:
This adapter is helpful because it enables interactive backtesting with TradingView's built-in "Strategy Tester" framework without the need to translate the logic from an "indicator" script to a "strategy" script.
To use this, one must have the "Machine Learning: Lorentzian Classification" script and this Backtest Adapter open simultaneously on the same chart. From there, simply change the "Source" setting of the Backtest Adapter to "Lorentzian Classification: Backtest Stream" to transfer the entry/exit signals stream to the Backtest Adapter.
For an example of how to implement your own backtest stream in your indicators, please refer to the "Backtesting" section in the source code of the "Machine Learning: Lorentzian Classification" script, which is shown below for convenience:
Chỉ báo và chiến lược
Strategy Myth-Busting #13 - MultiEMA+BXTrender - [SP/MYN]#13 on the Myth-Busting bench, we are automating the "I Found The Highest Win Rate 15 Minute Scalping Trading Strategy Ever" strategy from "TradeIQ" who claims to have backtested this manually and achieved 410% profit over 100 trades within 6 months on Natural Gas with 79 Wins / 21 Losses with an astounding 3.96% Max Drawdown.
It was quite challenging emulating the same subjective EMA pullback logic along with the dependent sequencing of events necessary to enter a trade and we might improve on this to make it better in the future. Super kudos to @spdoinkal who helped with this strategy. If you have ideas on how this could be improved on, would love to hear about them.
As is, we were unable to substantiate similar results to what was manually backtested by TradeIQ, we do however see potential here. Given some optimizations and improvements to the the entry logic accommodating for a wider more variable margin after pullbacks reestablish above/below the fast EMA we think the performance of this strategy could certainly be improved upon. So not sure if we have totally myth busted this completely at this point in time.
This strategy uses a combination of 2 open-source public indicators:
3 EMA's (Trading View Internal)
B-Xtrender by Puppytherapy
Three separate (21), (89) and (200) EMA's are used as a means to confirm and keep entry out of ranged markets. When the 3 EMA's are all clumped up together with no distance it's indicative of a flat or ranged market. This is then used in conjunction with B-XTrender as a means to detect the trend direction. B-XTrender which is a trend following indicator originally published in the IFTA Journal by Bharat Jhunjhunwala. It uses both a short and long term lengths along with a compound EMA used as a means to smooth and sample trend direction.
Trading Rules
15 min candles but other lower time-frames
Stop Loss on previous swing high/low
No Take Profit, Exit on new red/green circles from BX-Trender
Long
EMA Green (21) on top, White (89)in middle and red (200) on bottom and there is distance between EMA's need to be spaced, otherwise in a ranged market
Price action must pull back into 89 EMA (White line) either close or touching it.
Once pullback occurs wait for BX Trender to issue a new green circle and BX Trend line must be green and above 0
Price action must also pull up back above the (Green Line) EMA 21
Short
EMA Red (200) on top, White (89) in middle and Green (21) on bottom and there is distance between EMA's need to be spaced, otherwise in a ranged market
Price action must pull back into 89 EMA (White line) either close or touching it.
Once pullback occurs wait for BX Trender to issue a new red circle and BX Trend line must be red and below 0
Price action must also pull up back below the (green Line) EMA 21
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.
Strategy Myth-Busting #12 - OSGFC+SuperTrend - [MYN]This is part of a new series we are calling "Strategy Myth-Busting" where we take open public manual trading strategies and automate them. The goal is to not only validate the authenticity of the claims but to provide an automated version for traders who wish to trade autonomously.
Our 12th one is an automated version of the "The Most Powerful Tradingview Buy Sell Signal Indicator " strategy from "Power of Trading" who doesn't make any official claims but watching how he trades with this, it on the surface looked promising. The strategy author uses this on the 15 min strategy on mostly FOREX. Unfortunately as indicated by the backtest results below, we were not able to substantiate any good positive trading metrics from this, be it Profit, Markdown, Num Of Trades etc. This does seem to do okay with some entries but perhaps adding another indicator to this to filter out more noise might make it better. At least how this strategy is presented now, this is not something I recommend anyone use.
This strategy uses a combination of 2 open-source public indicators:
SuperTrend by TradingView Internal
One-Sided Gaussian Filter w/ Channels By Loxx
The SuperTrend indicator and the One-Sided Gaussian Filter complement each other by providing a more complete and accurate picture of market trends. The SuperTrend indicator is used to identify trends. It does this by calculating a moving average of the underlying securities price and then comparing the current price to the moving average. When the current price is above the moving average, the trend is considered bullish, and when it is below, the trend is considered bearish.
The One-Sided Gaussian Filter is a mathematical tool that is used to smooth out fluctuations in financial data. It does this by removing random noise from the data, making it easier to identify patterns and trends.
When the SuperTrend indicator is used in conjunction with the One-Sided Gaussian Filter, the smoothed price data generated by the filter is used as the input for the SuperTrend calculation. This provides a more accurate representation of market trends and helps to eliminate false signals generated by short-term price movements. As a result, the SuperTrend indicator is able to more accurately identify the underlying trend in the market and provide traders with a cleaner and more reliable signal to act upon.
In summary, the SuperTrend indicator and the One-Sided Gaussian Filter complement each other by providing a more accurate and reliable representation of market trends, resulting in improved performance for traders.
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.
Trading Rules
15 min candles
FOREX or Crypto
Stop loss at swing high/low | 1.5 risk/ratio
Long Condition
SuperTrend and OSGFC generate buy signal
Close Buy on Gaussian generating a sell signal
Short Condition
SuperTrend and OSGFC generate sell signal
Close Buy on Gaussian generating a buy signal
smplondonclinic StrategyHello my friend! I'm uploading the code for your strategy. I have included a feature in the settings menu called "Entry Direction" that you can use to isolate only longs, only shorts or have both directions at the same time for the backtesting. I have set the strategy to only open 1 position at a time, it will not open a new position unless the previous position is closed. If you want to remove that just let me know. The green/red triangles that you will see plotting on the chart are the potential entry signals, you can turn them off from the style panel in the settings menu. In the inputs tab besides the strategy settings you also have all the relevant parameters for the three indicators used.
Strategy Myth-Busting #23 - 2xEMA+DPO- [MYN]#23 on the Myth-Busting bench, we are automating the "Best Funded Account Trading Strategy (Pass EVERY Challenge!)" strategy from "Trade with Pat" who claims this strategy will pass every trading challenge out there.
This strategy uses 3 open source indicators. 2 EMA's. The first one (Slow) is set to a length of 40 and a fast EMA which is set to 12. This strategy uses the crossover of the fast( 12) EMA over the Slow EMA ( 40 ) as the primary means to enter a long position. The opposite when the fast EMA crosses under the slow EMA as a means to indicate a short position. This strategy uses the DPO (Detrended Price Oscillaor) from the Uptrend Price DPO indicator in the same way we would traditionally use a stochastic or moving average convergence/divergence indicator like the MACD . Basically, the DPO helps evaluate and estimate the length of the price cycle from peak to peek or through to trough and in this strategy confirms entry of a long / short condition complimenting the EMA crossover/crossunders.
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 2 open-source public indicators:
EMA x2 ( 40 and 12)
Untrend Price DPO indicator by jTradeuh
Trading Rules
1 or 4 hour candles
Stop loss at previous highest-high (Short) and lowest-low (Long).
Take Profit 2 - 2.5 the risk
Strategy Template includes open source code from the following:
Performance Summary Dashboard by @VertMT
Time Of Day Window by @ddctv
Monthly Table Performance Dashboard by @QuantNomad
Rocket Grid Algorithm - The Quant ScienceThe Rocket Grid Algorithm is a trading strategy that enables traders to engage in both long and short selling strategies. The script allows traders to backtest their strategies with a date range of their choice, in addition to selecting the desired strategy - either SMA Based Crossunder or SMA Based Crossover.
The script is a combination of trend following and short-term mean reversing strategies. Trend following involves identifying the current market trend and riding it for as long as possible until it changes direction. This type of strategy can be used over a medium- to long-term time horizon, typically several months to a few years.
Short-term mean reversing, on the other hand, involves taking advantage of short-term price movements that deviate from the average price. This type of strategy is usually applied over a much shorter time horizon, such as a few days to a few weeks. By rapidly entering and exiting positions, the strategy seeks to capture small, quick gains in volatile market conditions.
Overall, the script blends the best of both worlds by combining the long-term stability of trend following with the quick gains of short-term mean reversing, allowing traders to potentially benefit from both short-term and long-term market trends.
Traders can configure the start and end dates, months, and years, and choose the length of the data they want to work with. Additionally, they can set the percentage grid and the upper and lower destroyers to manage their trades effectively. The script also calculates the Simple Moving Average of the chosen data length and plots it on the chart.
The trigger for entering a trade is defined as a crossunder or crossover of the close price with the Simple Moving Average. Once the trigger is activated, the script calculates the total percentage of the side and creates a grid range. The grid range is then divided into ten equal parts, with each part representing a unique grid level. The script keeps track of each grid level, and once the close price reaches the grid level, it opens a trade in the specified direction.
The equity management strategy in the script involves a dynamic allocation of equity to each trade. The first order placed uses 10% of the available equity, while each subsequent order uses 1% less of the available equity. This results in the allocation of 9% for the second order, 8% for the third order, and so on, until a maximum of 10 open trades. This approach allows for risk management and can help to limit potential losses.
Overall, the Rocket Grid Algorithm is a flexible and powerful trading strategy that can be customized to meet the specific needs of individual traders. Its user-friendly interface and robust backtesting capabilities make it an excellent tool for traders looking to enhance their trading experience.
Last Price minus Open Price Intraday VolumeLast Price minus Open Price Intraday Volume
Change in price from day Open price to Last Price indicate the stock price movement. Last Price minus Open Price Intraday Volume indicator is framed on volume change during change in price from day Open price to Last Price. It takes into account the average intraday volume based on intraday length of bars and actual volume attributed to change in price from day Open Price to Last Price. The indicator reflects the change in trend .By analyzing the position of price on the basis of average change in volume during intraday with that of volume attributed to change in price from day open Price to Last price one may decide upon the course of trade.
DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto.
Strategy Myth-Busting #11 - TrendMagic+SqzMom+CDV - [MYN]This is part of a new series we are calling "Strategy Myth-Busting" where we take open public manual trading strategies and automate them. The goal is to not only validate the authenticity of the claims but to provide an automated version for traders who wish to trade autonomously.
Our 11th one is an automated version of the "Magic Trading Strategy : Most Profitable Indicator : 1 Minute Scalping Strategy Crypto" strategy from "Fx MENTOR US" who doesn't make any official claims but given the indicators he was using, it looked like on the surface that this might actually work. The strategy author uses this on the 1 minute and 3 minute timeframes on mostly FOREX and Heiken Ashi candles but as the title of his strategy indicates is designed for Crypto. So who knows..
To backtest this accurately and get a better picture we resolved the Heiken Ashi bars to standard candlesticks . Even so, I was unable to sustain any consistency in my results on either the 1 or 3 min time frames and both FOREX and Crypto. 10000% Busted.
This strategy uses a combination of 3 open-source public indicators:
Trend Magic by KivancOzbilgic
Squeeze Momentum by LazyBear
Cumulative Delta Volume by LonesomeTheBlue
Trend Magic consists of two main indicators to validate momentum and volatility. It uses an ATR like a trailing Stop to determine the overarching momentum and CCI as a means to validate volatility. Together these are used as the primary indicator in this strategy. When the CCI is above 0 this is confirmation of a volatility event is occurring with affirmation based upon current momentum (ATR).
The CCI volatility indicator gets confirmation by the the Cumulative Delta Volume indicator which calculates the difference between buying and selling pressure. Volume Delta is calculated by taking the difference of the volume that traded at the offer price and the volume that traded at the bid price. The more volume that is traded at the bid price, the more likely there is momentum in the market.
And lastly the Squeeze Momentum indicator which uses a combination of Bollinger Bands, Keltner Channels and Momentum are used to again confirm momentum and volatility. During periods of low volatility, Bollinger bands narrow and trade inside Keltner channels. They can only contract so much before it can’t contain the energy it’s been building. When the Bollinger bands come back out, it explodes higher. When we see the histogram bar exploding into green above 0 that is a clear confirmation of increased momentum and volatile. The opposite (red) below 0 is true when there are low periods. This indicator is used as a means to really determine when there is premium selling plays going on leading to big directional movements again confirming the positive or negative momentum and volatility direction.
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.
Trading Rules
1 - 3 min candles
FOREX or Crypto
Stop loss at swing high/low | 1.5 risk/ratio
Long Condition
Trend Magic line is Blue ( CCI is above 0) and above the current close on the bar
Squeeze Momentum's histogram bar is green/lime
Cumulative Delta Volume line is green
Short Condition
Trend Magic line is Red ( CCI is below 0) and below the current close on the bar
Squeeze Momentum's histogram bar is red/maroon
Cumulative Delta Volume line is peach
ATR Mean Reversion Strategy V1**Long Only Strategy**
When Price drops below the ATR band below it will enter a buy on the next candle open
SL at current price minus ATR* ATR multiplier
TP at Mean EMA or if higher than Mean EMA and current candle low is below previous candle low or if price is above ATR
NB: I would highly recommend a low fee broker (I use ICmarkets raw spread account) due to the fact that this is a decently high frequency trading strategy you will rack up a lot of commission, if you use and exchange like Bybit or Binance the strategy will not be profitable due to the high commissions.
Strategy Myth-Busting #9 - HullSuite+LSMA - [MYN]This is part of a new series we are calling "Strategy Myth-Busting" where we take open public manual trading strategies and automate them. The goal is to not only validate the authenticity of the claims but to provide an automated version for traders who wish to trade autonomously.
Our 9th one is an automated version of the "I Tested The Best 1 Minute Scalping Strategy That Will Blow Your Mind 100 Times" strategy from "Profit Now" who claims to have achieved 36.7% profit scalping XRPUSDT on the 1 minute timeframe in only 15 days. As you can see from the backtest results below, I was unable to substantiate anything remotely close to that that claim on any timeframe or symbol. Myth 10000% busted.
This strategy uses a combination of 2 open-source public indicators: Hull Suite by InSilico and Least Squares Moving Average (LSMA)
The Hull Moving Average (HMA) is a faster version of the traditional moving average and is designed to reduce lag and improve the responsiveness of the average to price changes. In this strategy the HMA is used as a trend-following indicator, When the HMA is rising it is indicative of an upwards trend and when its falling its indicative of a downtrend.
The Least Squares Moving Average (LSMA) used in this strategy is similar to the HMA in that it is designed to reduce lag and improve the responsiveness of the average to price changes. In this strategy the LSMA is used to also not only identify trends but also confirm signals, it also is used to identify possible changes in the trend and market conditions.
When we use these together, the Hull Suite and LSMA indicators provide a complimentary confirmation of trend direction and trend swings. The Hull Suite helps to identify and confirm trends, while the LSMA aids to confirm signals and identify potential changes in market conditions.
The way this strategy is designed is when the Hull Suite HMA is trending up and the LSMA crosses above the HMA, we enter a long condition. When the Hull Suite is trending down and the LSMA crosses below the HMA we take a short position. Because of the low latency of these two indicators this strategy can be used on lower time frames down to 1 minute. On high volatility crypto on the lowest time frames, a 1:4 Risk Ratio should be used. A lower less risk ratio should be used on less volatile archetypes of securities.
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
DCA Simulator A simple yet powerful Dollar Cost Averaging (DCA) simulator.
You just add the script to your chart, and you'll be able to see:
- Every single entry with its size
- The evolution of you average price in time (blue line)
- The profit and loss areas (where market price < average price the DCA is at loss, and the background is colored in red. At the contrary, where mkt price is > average price, it's profit area and the background is green).
- Max drawdown: the point in price and time where the DCA loss is maximum in the considered time interval. The drawdown amount is specified.
- Profit (or loss) and total cost at the end of the time interval or at the present day: the script shows how much the DCA is netting at a profit or loss, as well as the total cost of the DCA itself.
The parameters are:
- Date start and date end: time interval of the DCA simulation
- DCA period (you can choose between daily, weekly and monthly)
- Week day or month day if you choose those periods
- Single operation size (in base currency)
- Option to choose a DCA LONG or DCA SHORT (for uber bears)
- Option to include an exit strategy that partially closes your position (the % size closed can be chosen as well with the parameter "exit_close_perc") every time the DCA realizes a specific gain (choosable with the parameter "exit_gain_threshold"). If you choose "none" as an exit strategy, the script will assume to never close positions until the end of the period or the present day for simulation purpose.
NB: just ignore the TV strategy tester results, all the data are visible on the chart.
Trading Day and Time SessionThis script provides options for the user to choose:
- Start date and End date
- Trade time during a day (With UTC offset)
- Which days of the week to trade
It return a condition if all the date and time conditions are true. It's very easy to integrate with any script.
Reinforced RSI - The Quant Science This strategy was designed and written with the goal of showing and motivating the community how to integrate our 'Probabilities' module with their own script.
We have recreated one of the simplest strategies used by many traders. The strategy only trades long and uses the overbought and oversold levels on the RSI indicator.
We added stop losses and take profits to offer more dynamism to the strategy. Then the 'Probabilities' module was integrated to create a probabilistic reinforcement on each trade.
Specifically, each trade is executed, only if the past probabilities of making a profitable trade is greater than or equal to 51%. This greatly increased the performance of the strategy by avoiding possible bad trades.
The backtesting was calculated on the NASDAQ:TSLA , on 15 minutes timeframe.
The strategy works on Tesla using the following parameters:
1. Lenght: 13
2. Oversold: 40
3. Overbought: 70
4. Lookback: 50
5. Take profit: 3%
6. Stop loss: 3%
Time period: January 2021 to date.
Our Probabilities Module, used in the strategy example:
Zazzamira 50-25-25 Trend SystemPublishing my trading system script. It consist of several conditions to happen in order to open a trade. Work best on ES/MES 5 minute timeframe.
I like to use it with this settings:
- UTC -6 (don't tick Exchange Timezone)
and rest as default
To enter a trade, the following conditions must be met: Entry 1: the opening range (8:30AM - 9:15AM UTC-6) must be defined and the price must close above or below the opening range on the 5-minute timeframe. This entry condition defines the trade direction (above = long / below = short). Once the opening range is defined, the Trend-Based Fib Extension is applied from the range high to the range low (and vice versa). Fib levels are required for Exit conditions. Entry 2: the 8 - 27 - 67 - 97 EMAs must be defined. If the EMAs value order is 8 > 27 > 67 > 97, long-only trades are allowed. If the EMAs value order is 8 < 27 < 67 < 97, short-only trades are allowed. This entry condition filters fake breakouts of Entry 1. Entry 3: no trades are allowed after 12:59 UTC-6 (2PM EST). Entry 4: if Entry 1, Entry 2, and Entry 3 conditions are valid and the price hasn't reached the 23.6% Fib line, an entry order can be set at the range high/long with 4 contracts. To exit a trade, the following conditions must be met: Exit 1 (Stop loss): set a trailing stop based on 2.1x ATR (14) from entry. Exit 2: take 50% profits at the 23.6% Fib and leave trailing stop untouched. Exit 3: if Exit 2 triggers, take 50% (25% of total entry) off at 61.8% Fib, leaving Exit 2 trailing stop values valid. Exit 4: exit the full position at the FIB 100% value. Exit 5: all trades must be closed at 3pm UTC-6 (4PM EST). So basically Take Profit are 50%-25%-25% of position.
Code has been written by © Hiubris_Indicators who has been an amazing coder and gave me the possibility to make this script public so a really big shoutout to him.
GAVAD - Selling after a Strong MovimentThis strategy search for a moment whe the market make two candles are consistently strong, and open a Sell, searching the imediactly correction, on the new candle. It`s easy to see the bars on the histogram graph. Purple Bars represent the candle variation. when on candle cross ove the Signal line the graph plot an Yellow ci, if the second bar crossover the signal a green circle is ploted and the operation start on start of the next candle.
This strategy can be used in a lot of Stocks and other graphs. many times we need a small time of graph, maybe 1 or 5 minutes because the gain shoud be planned to a midle of the second candle. You need look the stocks you will use.
Stocks > 100 dolars isnt great, markets extremly volatly not too. but, Stocks that have a consistently development are very interisting. Look to markets searching maybe 0.5% or 1%.
For this moment, I make the development of a Brasilian Real x American Dollar. In 15 Minutes.
if you use in small timeframe the results can be better.
On this time we make more than 500 trades with a small lot of contracts, without a big percent profitable, but a small profit in each operation, maybe you search more than. To present a real trading system I insert a spreed to present a correct view of the results.
Each stock, Index, or crypto there is a specific configuration?
my suggestion for new stocks
You need choice a stock and using the setup search set over than 70% gain (percent profitable), using a 1% of gain and loss between 1-2%
as the exemple (WDO)
default I prepare a Brazilian Index
6-signal (6% is variation of a candle of the last candle)
10000- multiplicator (its important to configure diferences betwen a stock and an Indice)
gain 3 (this proportion will be set looking you target, how I say, 1% can be good)
loss 8 (this proportion will be set with you bankroll management, how I say, maybe 2%, you need evaluate)
for maximize operations I use in the 1 or 5 minute graph. Timeframes more large make slowlly results,
(but not unable that you use in a 1 hour or a 1 day.)
I make this script by zero. Maybe the code doesnt so organized, but is very easy to understand. If you have any doubts . leave a comment.
I hope help you.
TradePro's 2 EMA + Stoch RSI + ATR StrategySaw TradePro's "NEW BEST HIGHEST PROFITING STRATEGY WITH CRAZY RESULTS - 2 EMA+ Stochastic RSI+ ATR", and was curious on the back testing results. This strategy is an attempt to recreate it.
This strategy uses 50 / 200 EMAs, Stochastic RSI and ATR.
Long Entry Criteria:
- 50 EMA > 200 EMA
- Price closes below 50 EMA
- Stochastic RSI has gone into oversold < 20
- Stochastic RSI crosses up while making higher low from previous cross up
Short Entry Criteria:
- 50 EMA < 200 EMA
- Price closes above 50 EMA
- Stochastic RSI has gone into overbought > 80
- Stochastic RSI crosses down while making lower high from previous cross down
Stop-loss is set to ATR stop-loss
Take Profit is 2x the risk
All parameters are configurable.
Enjoy~~
Strategy: Range BreakoutWhat?
In the price action, levels have a significant role to play. Based on the price moving above/below the levels - the underlying instrument shows some price-action in the direction of breakout/breakdown.
There are plenty of ways level can be determined. Levels are the decision point to take a trade or not. But if we make the level derivation complex, then the execution may get hamper.
This strategy script, developed in PineScript v5, is our attempt at solving this problem at the core by providing this simple, yet elegant solution to this problem.
It's essentially an attempt to Trade Simple by drawing logical (horizontal) lines in the chart and take actions, after multiple associated parameters confirmation, on the breakout / breakdown of the levels.
How?
Let us explain how we are drawing the levels.
We are depending on some of the parameters as described below:
Open Range : During intraday movement, often if prices move beyond a particular level, it exibits more movement in the same swing in same direction. We found out, through our back testing for Indian Indices like NSE:NIFTY , NSE:BANKNIFTY or NSE:CNXFINANCE the first 15m (i.e 09:15 AM to 09:30 AM, IST) is one of such range. For Indian stocks, it is 9:15 to 9:45. And for MCX MCX:CRUDEOIL1! it's 5:00 pm to 6:00 pm. There are our first levels.
PDHCL : Previous Day High, Close, Low. This is our next level
VWAP : The rolling VWAP (volume weighted average price)
In the breakout/breakdown of the Open Range and Previous Day High/Low, we are taking the trade decisions as follows using CEST principle:
C onditions :
If current bar's (say you are in 5m timeframe) closing is broken out the Open Range High or Previous Day High, taken a Buy/Long decision (let's say buying a Call Option CE or selling a Put Option PE or buying the future or cash).
If current bar's (say you are in 5m timeframe) closing is broken down the Open Range Low or Previous Day Low, taken a Sell/Short decision (let's say buying a Put Option CE or selling a Call Option PE or selling the future or cash).
Additionally, and optionally (default ON, one can turn off): we are checking various other associated multiple confirmations as follows:
1. Momentum : Checking 14-period RSI value is more than 50 or less than 50 (all parameters like period, OB, OS ranges are configurable through settings)
2. Current bar's volume is more than the last 20 bars volume average. How much more - that multiplier is also configurable. (default is 1)
3. The breakout candle is bullish (green) or bearish (red).
E ntry :
All of these happens only on the closing of the candle . Means: Non Repainting! .
Clearly in the chart we are showing as green up arrow BO (breakout for buy) and red down arrow BD (breakdown for sell) to take your decision process smooth.
So, on the closing of the decision BO/BD candle we are entering the trade (with a thumping heart and nail biting ...)
S top Loss :
We are relying on the time tasted (last 40 years) mechanism of Average True Range (ATR) of default 14 period. This default period is also configurable.
So for Long trades: the 14 period ATR low band is the SL.
For Short trades: the 14 period ATR high band is the SL.
T arget :
We are depending on the thump rule of 1:2 Risk Reward. It's simple and effective. No fancy thing. We are closing the trade on double the favorable price movement compared to the SL placed. Of course, this RR ratio is confiurable from the settings, as usual.
What's Unqiue in it?
The utter simplicity of this trading mechanism. No fancy things like complex chart pattern, OI data, multiple candlestick patterns, Order flow analysis etc.
Simple level determination,
Marking clearly in the chart.
Making each parameter configurable in Settings and showing tooltip adjacent to the parameter to make you understand it better for your customization,
Wait for the candle close, thus eliminating the chances of repainting menace (as much as possible)
Additional momentum and volume check to trade entry confirmation.
Works with normal candlestick (nothing special ones like HA ...)
Showing everything as a Summary Table (which, again can be turned off optionally) overlaying at the bottom-right corner of the chart,
Optionally the Summary Table can be configured to alert you back (say you get it notified in your email or SMS).
That way, a single, simple, effective trade setup will ease your journey as smooth sail as possible.
Mentions
There are plenty of friends from whom time to time we borrowed some of the ideas while working closely together over last one year.
From tradingview community, we took the spirit of @zzzcrypto123 awesome work done long back (in 2020) as the indicator "ORB - Opening Range Breakout". (We tried to reach him for his explicit consent, unable to catch hold of him).
Some other publicly available materials we have consulted to get the additional checks (like RSI, volume).
Lat word
Use it please and thank you for your constant patronage in following us in this awesome platform. Let's keep growing together.
Disclaimer :
This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
Quarterly Returns in Strategies vs Buy & HoldThis is a Quarterly Returns version of Monthly Returns in PineScript Strategies by QuantNomad
This script shows a table of Quarterly/Yearly performance of your strategy.
It also provides an option to compare with Buy & Hold.
The script can easily integrated to your strategy. All you need to do is copy the table part and paste it at the end of your script
Disclaimer
Please remember that past performance may not be indicative of future results.
This post and the script don’t provide any financial advice.
Band-Zigzag - TrendFollower Strategy [Trendoscope]Strategy Time!!!
Have built this on my earlier published indicator Band-Zigzag-Trend-Follower . This is just one possible implementation of strategy on Band-Based-Zigzag .
🎲 Notes
Experimental prototype. Not financial advise and strategy not guaranteed to make money despite backtest results
Not created or tested for any specific instrument or timeframe
Test and adopt with own risk
🎲 Strategy
This is trend following strategy built based on Bands and Zigzag. Traits of trend following strategies are
Lower win rate (Yes, thats right)
High risk reward (Compensates low win rate)
Higher drawdown
If market is choppy, trend following methods suffer.
The script implements few points to overcome the negatives such as lower win rate and higher drawdown by actively assessing pivots on the direction of trend along. This helps us take regular profits and exit on time during the end of trend. Most of the other concepts are defined and explained in indicator - Band-Zigzag-Trend-Follower and Band-Based-Zigzag
Defining a trend following method is simple. Basic rule of trend following is Buy High and Sell Low (Yes, you heard it right). To explain further - methodology involve finding an established trend which is flying high and join the trend with proper risk and optimal stop. Once you get into the trade, you will not exit unless there is change in the trend. Or in other words, the parameters which you used to define trend has reversed and the trend is not valid anymore.
🎯 Using bands
When price breaks out of upper bands (example, Bollinger Band , Keltener Channel, or Donchian Channel), with a pre determined length and multiplier, we can consider the trend to be bullish and similarly when price breaks down the lower band, we can consider the trend to be bearish .
🎯 Using Pivots
Simple logic using zigzag or pivot points is that when price starts making higher highs and higher lows, we can consider this as uptrend. And when price starts making lower highs and lower lows, we can consider this as downtrend. There are few supertrend implementations I have published in the past based on zigzags and pivot points .
Drawbacks of both of these methods is that there will be too many fluctuations in both cases unless we increase the reference length. And if we increase the reference length, we will have higher drawdown.
🎯 Band Based Zigzag Method
Here we use bands to define our pivot high and pivot low - this makes sure that we are identifying trend only on breakouts as pivots are only formed on breakouts
Our method also includes pivot ratio to cross over 1.0 to be able to consider it as trend. This means, we are waiting for price also to make new high high or lower low before making the decision on trend. But, this helps us ignore smaller pivot movements due to the usage of bands.
I have also implemented few tricks such as sticky bands (Bands will not contract unless there is breakout) and Adaptive Bands (Band will not expand unless price is moving in the direction of band). This makes the trend following method very robust.
To avoid fakeouts, we also use percentB of high/low in comparison with price retracement to define breakout.
🎲 Settings
Settings are fairly simpler and are explained as below. You will find most of the required information in tooltips.
Strategy Myth-Busting #7 - MACDBB+SSL+VSF - [MYN]This is part of a new series we are calling "Strategy Myth-Busting" where we take open public manual trading strategies and automate them. The goal is to not only validate the authenticity of the claims but to provide an automated version for traders who wish to trade autonomously.
Our seventh one we are automating is the "Magic MACD Indicator: Crazy Accurate Scalping Trading Strategy ( 74% Win Rate )" strategy from "TradeIQ" who claims to have backtested this manually and achieved 427% profit with a 74% winrate over 100 trades in just a 4 months. I was unable to emulate these results consistently accommodating for slippage and commission but even so the results and especially the high win-rate and low markdown is pretty impressive and quite respectable.
This strategy uses a combination of 3 open-source public indicators:
AK MACD BB v 1.00 by Algokid
SSL Hybrid by Mihkel00
Volume Strength Finder by Saravanan_Ragavan
This is considered a trend following Strategy. AK MACD BB is being used as the primary short term trend direction indicator with an interesting approach of using Bollinger Bands to define an upper and lower range and upon the MACD going above the upper Bollinger Bands, it's indicative of an up trend, where as if the MACD is below the lower Bollinger Band, it's indicative of a down trend. To eliminate false signals, SSL Hyrbid is used as a trend confirmation filter, confirming and eliminating false signals from the MACD BB. It does this by validating the price action is above the the EMA and the SSL is positive that is a confirmation of an uptrend. When the price action is below the EMA and the SSL is negative, that is an confirmation of a downtrend. To avoid taking trades during ranged markets, VSF Buyer's Strength is used so the buyers/sellers strength and must be above 50% or the trade will not be inititiated.
Trading Rules
5 min candles but other lower time frames even below 5m work quite well too.
Best results can be found by tweaking these 2 input parameters:
Number Of bars to look back to ensure MACD isn't above/below Zero Line
Number Of bars back to look for SSL pullback
Long Entry when these conditions are true
AK MACD BB BB issues a new continuation long signal. A new green circle must appear on the indicator and these circles should not be touching across the zero level while they were previously red
SSL Hybrid price action closes above the EMA and the line is blue color and then creates a pullback . The pullback is confirmed when the color changes from blue to gray or from blue to red.
VSF Buyers strength above 50% at the time the MACD indicator issues a new long signal.
Short Entry when these conditions are true
AK MACD BB issues a new continuation short signal. A new red circle must appear on the indicator and these circles should not be touching across the zero level while they were previously green
SSL Hybrid price action closes below the EMA and the line is red color then it has to create a pullback . The pullback is confirmed when the color changes from red to gray or from red to blue.
VSF Sellers strength above 50% at the time the MACD indicator issues a new short signal.
Stop Loss at EMA Line with TP Target 1.5x the risk
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.
Fair Value Strategy UltimateThis is a strategy using an index's (SPX, NDX, RUT) Fair Value derived from Net Liquidity.
Net Liquidity function is simply: Fed Balance Sheet - Treasury General Account - Reverse Repo Balance
Formula for calculating the fair value of and Index using Net Liquidity looks like this: net_liquidity/1000000000/scalar - subtractor
The Index Fair Value is then subtracted from the Index value which creates an oscillating diff value.
When diff is greater than the overbought threshold, Index is considered overbought and we go short/sell.
When diff is less than the oversold signal, Index is considered oversold and we cover/buy.
The net liquidity values I calculate outside of TradingView. If you'd like the strategy to work for future dates, you'll need to update the reference to my NetLiquidityLibrary , which I update daily.
Parameters:
Index: SPX, NDX, RUT
Strategy: Short Only, Long Only, Long/Short
Inverse (bool): check if using an inverse ETF to go long instead of short.
Scalar (float)
Subtractor (int)
Overbought Threshold (int)
Oversold Threshold (int)
Start After Date: When the strategy should start trading
Close Date: Day to close open trades. I just like it to get complete results rather than the strategy ending with open trades.
Optimal Parameters:
I've optimized the parameters for each index using the python backtesting library and they are as follows =>
SPX
Scalar: 1.1
Subtractor: 1425
OB Threshold: 0
OS Threshold: -175
NDX
Scalar: 0.5
Subtractor: 250
OB Threshold: 0
OS Threshold: -25
RUT
Scalar: 3.2
Subtractor: 50
OB Threshold: 25
OS Threshold: -25
Strategy Myth-Busting #5 - POKI+GTREND+ADX - [MYN]This is part of a new series we are calling "Strategy Myth-Busting" where we take open public manual trading strategies and automate them. The goal is to not only validate the authenticity of the claims but to provide an automated version for traders who wish to trade autonomously.
Our fifth one we are automating is one of the strategies from "The Best 3 Buy And Sell Indicators on Tradingview + Confirmation Indicators ( The Golden Ones ))" from "Online Trading Signals (Scalping Channel)". No formal backtesting was done by them and resuructo messaged me asking if we could validate their claims.
Originally, we mimic verbatim the settings Online Trading Signals was using however weren't getting promising results. So before we stopped there we thought we might want to see if this could be improved on. So we adjusted the Renko Assignment modifier from ATR to Traditional and adjusted the value to be higher from 30 to 47. We also decided to try adding another signal confirmation to eliminate some of the ranged market conditions so we choose our favorite, ADX . Also, given we are using this on a higher time-frame we adjusted the G-Channel Trend detection source from close to OHLC4 to get better average price action indication and more accurate trend direction.
This strategy uses a combination of 2 open-source public indicators:
poki buy and sell Take profit and stop loss by RafaelZioni
G-Channel Trend Detection by jaggedsoft
Trading Rules
15m - 4h timeframe. We saw best results at the recommended 1 hour timeframe.
Long Entry:
When POKI triggers a buy signal
When G-Channel Trend Detection is in an upward trend (Green)
ADX Is above 25
Short Entry:
When POKI triggers a sell signal
When G-Channel Trend Detection is in an downward trend (red)
ADX Is above 25
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.
Hulk Grid Algorithm - The Quant ScienceGrid-based intraday algorithm that works 50% in trend following and 50% in swing trading. Orders are executed on a grid of 10 levels. The grid levels are dynamic and calculated on the difference between the previous day's open and close. The algorithm makes only long trades based on the following logic:
1. The daily close of the previous day is analyzed, the first condition is met if the previous day was bullish, closing higher than the 'opening.
2. Must pass 'x' number of bars before placing market orders.
3. The range, as the difference between close and open of the previous day must be greater than 'x'.
If these three conditions are met then the algorithm will proceed to place long orders. On a total of 10 grid levels, up to five trades are executed per day.
If the current close is above level 1 of the grid (previous day's close) then trend following trading will take place, working on the upper 5 levels. In this case each order is placed starting at level 1 and closed at each level above.
If the current close is below level 1 of the grid (previous day's open) then swing trading will be carried out, working on the lower 5 levels. In this case each order is placed starting at level 2 and closed at the upper level.
If at the time of order execution the price is above or below the stop loss and take profit levels, the algorithm will cancel the orders and prevent trading.
All orders are closed exclusively for two reasons:
1. If the stop loss or take profit level is confirmed.
2. If the daily session is ended.
UI Interface
You can adjust:
1. Backtesting period
2. 'x' number of bars before placing orders at the market (remember to always add 2 to the number you enter in the user interface if you enter 2 then execution will occur at the market opening after the fourth bar).
3. Intercepted price range between close and open of the previous day, avoiding trading on days when the range is too low.
4. Stop loss, level calculated from the 'last lower grid, if the market breaks this level the grid is destroyed and closes all open positions.
5. Take profit, the level calculated from the last upper grid, if the market breaks this level the grid is destroyed and closes all open positions.
The backtesting you see in the example was generated on:
BINANCE:BTCUSDT
Timeframe 15 min
Stop loss 2%
Take profit 2%
Minimum bars 3
Size grid range 500
This algorithm can be used only on intraday timeframe.