SuperTrend Oscillator [LuxAlgo]This oscillator is made of three components, all derived from the SuperTrend indicator. This approach allows the user to easily determine overbought/sold zones, identify whether a retracement is present or if the price is ranging or trending. It also allows for the anticipation of the potential price cross with the SuperTrend.
We provide additional information including whether a signal returned by the SuperTrend was false, as well as the percentage of false signals.
Settings
Length: Period of the "average true range" used in the calculation of the SuperTrend
Mult: Multiplicative factor for the "average true range"
Smooth: Determines the degree of smoothing of the histogram
Misc:
Fixed Transparency: Use a fixed transparency for the main oscillator
Show Lines: Show the lines displayed by the indicator
Show Labels: Show the labels displayed by the indicator
Usage
The indicator is in a range of (-100,100) with values closer to 100/-100 indicating a stronger trend. The main oscillator value above 0 indicates that the price is above the SuperTrend.
It is possible to identify when a retracement is present in a trend. This is often indicated by an oscillator value moving within 50/-50.
Each overbought/oversold level can be used to determine potential exit points.
The indicator also includes two additional oscillators derived from the main oscillator. A smoothed version of the main oscillator (Signal), and a smoothed version of the difference between the Main and Signal oscillators (Histogram), thus making the oscillator part of the indicator more similar to MACD.
One can use the histogram to anticipate when the price might cross the SuperTrend by comparing the sign between the main and histogram. Potential false signals can also be filtered with this method.
Certain crosses between the price and SuperTrend can be filtered out when the histogram and main oscillator have a different sign (here main = 1, histogram = -1).
We include various indications in order to analyze the signals returned by the SuperTrend. The indicator displays symbols indicating whether a signal was false or not.
A cross symbol will be displayed at the top of the displayed lines when the previous Buy signal was false, else a checkmark is displayed. Symbols displayed at the bottom of the lines are referring to sell signals. We also provide a percentage of false signals, calculated over the entire chart history.
Details
The scaling method used is similar to max-min normalization. We first compute the difference between the price and SuperTrend and divide the result by the difference between the upper and lower extremity used to compute the SuperTrend. Values higher than (1,-1) can occur when price crosses the SuperTrend and as such we use the max and min functions to attenuate these.
The filter used to compute the signal line is based on exponential averaging and is fully adaptive. The smoothing factor used for its computation is the squared value of the main oscillator, divided by length . Since higher values of the oscillator are associated with trending markets, the filter will be closer to the main oscillator when the market is ranging.
Signals
Angle Attack Follow Line Indicator This indicator works with Follow Line Indicator , evaluates the angle for possible additions or reductions of the position. Many settings to play with:
s3.tradingview.com
- FOLLOW LINE CURRENT CHART RESOLUTION
- FOLLOW LINE HIGHER TIME FRAME
- FILTER HIGHER TIME FRAME
- NO FILTER HIGHER TIME FRAME
- ANGLE CONFIGURATION
- ANGLE LEVELS
- BUY / SELL
- OPTIONS TO ADD
- OPTIONS TO REDUCE
- BAR COLOR
- LABELS
-ALERTS
MANAGE YOUR RISK AND CAPITAL WELL IF YOU DO NOT WANT TO LOSE EVERYTHING¡¡¡
TO PLAY¡¡¡
Simple way to BEAT the market [STRATEGY]This script has been created to demonstrate the effectiveness of using market regime filters in your trading strategy, and how they can improve your returns and lower your drawdowns
This strategy adds a simple filter (A historical volatility percentile filter, an implementation of which can be found on my trading profile) to a traditional buy and hold strategy of the index SPY.
Note, There are other filters that could also be added including a long-term moving average/percentile rank filter/ADX filter etc, to improve the returns further.
The filter closes our long position during periods of volatility that exceed the 95th percentile (or in the top 5% of volatile days) and buys back when the volatility is below 95% rank of the past 100 days
Have included the backtest results since 1993 which is 28 years of data at the time of writing. Comparison of traditional buy and hold with this modified strategy can be found below:
Traditional buy and hold:
Return per year: 7.95 % (ex Dividends)
Total return: 851.1 %
Max drawdown: 50.79 %
'Modified' buy and hold (this script):
Return per year: 9.92 % (ex Dividends)
Total return: 1412.2 %
Max drawdown: 31.57 %
Feel free to use some of the market filters in my trading profile to improve and refine your strategies further, or make a copy and play around with the code yourself. This is just a simple example for demo purposes.
Roc & Atr
Roc & Atr Orders
My indicator, where I compare the 20 bar change percentage with the 14 bar atr band, I hope it will be useful to everyone. the green zones can be interpreted as BUY and the red zone as SELL zone. In graphs with high motion and low atr, the channel narrowing can be interpreted as BUY and the channel opening as SELL.
No indicator shows you the right way ... The best way is your own thoughts
T3 Gold Sniper [RickAtw]Gold Sniper based on support and resistance looks for a sniper entry for trades. Used together with EMA
Key signal
Buy ------> Green Line
Sell ------> Red Line
Functional
The system was made for gold and everything is tuned for it.
I am a professional investor and I test each system for how long. If the system makes an income, it gets to my page. Use it for gold, cryptocurrencies and pairs AUD/USD GBP/USD
TV Community AlgoTV Community Algo is a free TradingView script that I designed from the ground to benefit the traders of this community. It has plenty of features that you will enjoy, and I have included documentation for how to use this below!
Settings:
Basic:
Turn the Void Lines on or off
Turn the Dashboard on or off
Turn the Signal Bars on or off
Turn the Support & Resistance Lines on or off
Turn the EMA 8 and EMA 200 on or off
Turn the Buy & Sell Signals on or off
Turn the Fibonacci Retracement Tool on or off
Style:
Change the Dashboard's distance from the price action
Change the Dashboard's Color and Transparency
Change the Dashboard Text Color
Change the Fibonacci Deviation
Make the Fibonacci Retracement Tool reverse
Make the Fibonacci Lines extend left, right, both directions, or none
Turn Fibonacci Prices on or off
Turn Fibonacci Levels on or off and change between percent or value
Change Fibonacci Label Position from the left or the right
Usage:
This algo has many uses including but not limited to:
Finding entries and exits using the EMA 8 and EMA 200 crossovers
Using the Void Lines to identify bounces or reversals
Using the Signal Bars to identify trend and confirmation for entries and exits
Using the Dashboard information for confirmation and informational purposes
In the images below, I give a few examples of the many uses of the TV Community Algo!
VOID LINES
The Void Lines are very helpful when it comes to identifying reversals.
TV COMMUNITY ALGO DASHBOARD
The Dashboard is filled with useful information that all traders can benefit from!
SIGNAL BARS
The colored candles known as Signal Bars inform you of when the price action is above or below the midpoint of the Void Lines.
AUTO SUPPORT & RESISTANCE LINES
These lines help traders find accurate levels of support & resistance on all time frames, and the lines change color depending on if the price is above or below them.
EMA 8 AND 200
The EMA 8 and EMA 200 crossovers can be used as entry and exit signals.
BUY & SELL SIGNALS
The BUY & SELL signals can be used to find optimal entries and exits for trades on any time frame. Smaller time frames are best for scalping, while larger time frames are more suited for longer trades. When combined with the EMA lines and Dashboard information, these signals can produce incredibly profitable trades.
AUTO FIBONACCI RETRACEMENT TOOL
The Auto Fibonacci Retracement Tool allows you to plot perfect Fib Lines every time.
Conclusion:
I truly hope that the TV Community Algo benefits the TradingView community and that you all find some value in it. I worked very hard on this product and I would love to see it put to good use.
with love,
-Lemon 🍋
This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
IKH Signals v2Hi,
I'm happy to release this new update after few weeks working.
Fixes
Fix kumo break-out of Chiku span and close price
Fix buy trigger and strong buy trigger
Improvement
Signals take now the kumo thickness and kumo angle
Signals does not trigger on doji candles
Multi time frame validation is now available
I hope this fixes and new features will improve the signals for you too.
Let me know if you find strange behavior or possible improvments.
The Bayesian Q OscillatorFirst of all the biggest thanks to @tista and @KivancOzbilgic for publishing their open source public indicators Bayesian BBSMA + nQQE Oscillator. And a mighty round of applause for @MarkBench for once again being my superhero pinescript guy that puts these awesome combination Ideas and ES stradegies in my head together. Now let me go ahead and explain what we have here.
I am gonna call it the Bayesian Q Oscillator I suppose. The goal of the script is to solve an issue both indicators on their own suffer from. QQE signals are not new and often the problem has always been false signals for them. They are good for scalping but the difference between a quality move and a small to nearly nonexistent move following a signal is not so clear. Kivanc made his normalized version to help reduce this problem by adding colors to his histogram type verision that would essentially represent if price was a trending move or in a ranging structure. As you can see I have kept this Idea but instead opted for lines as the oscillator. two yellow line (default color) is a ranging sideways area and when there is red or green it is trending up or down. I wanted to take this to the next level with combining the Bayesian probability oscillator that tista put together.
The Bayesian indicator is the opposite for its issue as it is a probability indicator that shows which candle or price movement is more likely to come next. Red rising means possibly down move soon and green means up soon. I will not go into the complex details of this indicator but will suggest others take a look at his and others to understand the idea behind them. The point I am driving at is that it show probabilities or likelyhood without the most effecient signal device to match it. This original was line form and now it is background filled colors.
The idea. is that you can potentially get some stronger and more accurate reversal signals with these two paired together. when you see a sell signal or cross with the towering or rising red... maybe it is a good jump potentially. The same for green. At the same time it is a double added filter effect from just having yellow represent it is ranging... but now if you get a buy signal (example) and have yellow lines (example) along wi5h a red rising or mountain color background... it not only is an indication of ranging, but also that there is potentially even a counter move coming based on the probabilities. Also if you get into a good trade and see dual yellow qqe crosses with no color represented by the bayesian background... it is possible it might only be noise.
I have found them to work decently in the 1 hour timframe. Let me know your experience.
I hope everyone takes a look at the originals to understand them. Full credit goes to those guys for this to be here. Let me know how it is working out for you.
Here are the original links.
bayesian
Normalized QQE
Easy TrendThis signal is completely based on analysis and transformation of a single simple moving average. As with all signals and indicators, it should be combined with others.
This is how the signal is built:
1. First it takes the SMA of the closing price.
2. It then takes the ROC of that SMA using a length of 1.
3. It takes an 8-period SMA and also a 64-period SMA of that ROC.
4. These are plotted as follows:
- the ROC is plotted in green when above 0 (trending up) and red when below 0 (trending down).
- the 8-period SMA is plotted as a thin white line within the ROC signal
- the 64-period SMA is plotted as a thick white line within the ROC signal
When the trendline is green, this is a bullish zone. When the trendline is red, this is a bearish zone.
Moving averages (all types of moving averages) are inherently lagging signals. To compensate for that, I am offsetting each SMA series by half of its period. This may be confusing to some, but the end result is a mathematically accurate SMA signal, centered on the signal that it is providing the moving average of. It doesn't stop the lag, but it directly and obviously shows how lagged each signal is, which I personally find better to trade against.
Symbols on the top and bottom of indicator:
Yellow triangle at bottom of indicator shows where a downward trend is starting to bottom out and a buy/long opening may be available soon.
Green triangle at bottom of indicator shows that a downward trend has switched to an upward trend. This indicates a good time to buy.
Yellow triangle at top of indicator shows where an upward trend is starting to plateau and a sell/short opening may be available soon.
Red triangle at top of indicator shows that an upward trend has switched to a downward trend. This indicates a good time to sell.
Note: You may see multiple yellow triangles before seeing a green or red triangle. This can happen when multiple trend accelerations or decelerations occur within an overall green or red zone.
In addition there is a dotted line connecting the end of the 64-period SMA to the end of the 8-period SMA. This indicates the direction the trend is moving towards. When the dotted line crosses the zero line, this portrays a rough estimate of where the trend may switch from a downtrend to an uptrend or vice versa. This is the "best" time to buy or sell, depending on your strategy.
I recommend placing a SMA on your candles set to the same window size as this indicator, and also to offset that SMA to the left by half its window size. For example, a 90-period SMA should be offset by -45 periods. That will cause it to be correctly aligned with this trend signal.
Custom Screener with Alerts V2 [QuantNomad]TradingView just recently announced the alert() function that allows you to create dynamic alerts from both strategies and studies.
So I decided to update custom screener I published before. It was based on alerts from orders in strategies, that was the only way to create dynamic alerts in PineScript at that point.
With the alert() function code become cleaner and more readable.
It works for up to 40 symbols at the same time.
You can create an alert from it easily by selecting screener name from the list and then selecting "Any alert() function call".
No additional configuration is required, message and alert on close I set up in the code.
I created as an example a screener that tracks both overbought (RSI > 70) and oversold stocks (RSI < 30).
To create your own screener you have to change only screenerFunc().
By design it should output 2 values:
cond - True/False Boolean variable. Should this instrument be displayed in the screener?
value - Additional numeric value you can display in your screener. I display RSI level for selected stocks for example.
Link to the old screener:
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as good as in historical backtesting.
This post and the script don’t provide any financial advice.
BOSCILLATOR. A BOSS OSCILLATORI would like to first say I do not the indicator pieces. Would like to personally give thanks and credit to @MarkBench for coding this indicator and helping to get my vision for this system finally able to be published and used by anyone. I would also like the thank @lazy bear and @ChrisMoody for their bringing the Firefly oscillator and the SCHAFF TREND and the PPO price percentage oscillator to trading view. and @scilentor for his version of Godmode with LSMA . Thanks to @Shizaru for bringing Frama moving average (which we have adopted into the PPO as one of the base selections for the first time, as well as the ALMA ). Divergences have also been added. and components of the firefly have been removed such as the histogram. I have added two oscillators in the picture. The bottom is the standard settings. The above is how I prefer mine to look after tweaking the settings.
Before I get into explaining how its used. I want to say all the indicators are open and none privately owned or at least owned by indivduals who brought them to trading view. Any due permission is granted at my disclocsure. I also want to say this is not your typical mashup of indicators as the is a very clear way to view and use this specifically. Also I want to say original tools from their original scripts are also improved. For example the PPO being used we have added the FRAMA and ALMA moving average basis option which it did not have before. And now everything has clear divergences and some other minor changers. but here are the rules and examples.
THE BOSCILLATOR - A MULTI-LEVEL CONFLUENCE/CONFIRMATION FILTER VISUALIZATION
Some shorthand
(Main oscillator - firefly)
(background wave thing - PPO )
(the red vertical up and down line with red and green dots - STC )
(the blue, yellow and red dots - warning dots)
WHO IS THIS INDICATOR FOR? - This indicator itself is not meant to be a signal giver to buy or sell right now even though it could be and some of the original scripts are used as such. This indicator is actually meant to be a VISUAL CONFIRMATION & FILTER for trades taken in other methods outside of this indicator. What are some of those methods that may benefit from having this? Pivot point traders, FIB traders, Bollinger band traders, Moving average traders.. just to name a few. This indicator itself is meant to in a quick glance allow the trade to see the condition of many different elements outside of the main price and chart, and determine if that trade looks like it has too much risk, or if that trade looks suitable. It also provides a series of confirmations that could be used for adding to a position at different levels at the trade's discretion.
OPTIMAL CONDITIONS FOR CONSIDERING A SHORT = The PPO is orange/red + the STC is at the TOP + the Firefly is above the midline. The warning dots are being printed at the top. There is regular or hidden bearish divergence present.
OPTIMAL CONDITIONS FOR CONSIDERING A LONG = The PPO is light/dark green + the STC is at the BOTTOM + the Firefly is below the midline. The warning dots are being printed at the bottom. There is regular or hidden bullish divergence present.
Triggers for scaling/adding into your position = Keeping in mind that this oscillator on its own is not meant to be the sole reason for taking a trade, here are some triggers you will see for getting into position (preferably with the optimal conditions being met) The firefly flips from a green line into a red slide and vise versa. The firefly crosses the midline up or down. The STC begins going up/down and triggers a green or red dot while crossing one of the levels at 20 or 80. The warning dots being made begin to be printed lower/higher than the dot before last. The PPO shift from one color to the next in the favored direction of the trade you wish to make.
Signs for taking profit and protecting your trade = The Dots begin to print, the PPO changes colors at the top or bottom. the STC arrived are the top.
FILTER SITUATIONS TO AVOID TRADES = Wise to not take a trade if the PPO and the firefly do not agree. For example - if the PPO is showing green yet the firefly is still red may be an indication that it is getting a bit late for you to enter the trade. Same with opposing divergences and warning dots contradicting the trade you are looking at. The STC being already on the bottom or top may be a small indication that trade may already have been a little too ripe, but on its own is not always the case.
When selecting the PPO settings and moving average you are going to want it to be in favor of what you are trying to accomplish.IF you are one low time frames and trying to swing or scalp trade... chances are you want a reactive MA setting that iss responsive. Iwould recommend the HULL, ALMA, TEMA DEMA. For the Higher time frame the EMA or the T3 WDma can be wuite patient and helpful for a constant reminder of caution
Some notes - for the swing and scalp trading... in my experience the PPO moving average basis sees more responsive changes with the FRAMA , ALMA , HULL settings. for entering a trade, at least a couple of your triggers being present increases the success rate by a lot.
This chart illustrates the usefullness of having a Zero lag function for the firefly. The firefly should not be taken for signals or trades itself. However it is the most precise finder of divergences within the system. It is aways good to flip on and off zero lag just to take a quick look for divergences you might have mixed.
In this chart illustrates the general visual look and order of events to guide you along your way. Starts with the PPO turning green or red or orange which is potentially time to get out of your current trade. Then it switched colors when reversal begins and that is when you want to at the same time see the STC, the firefly, and lower caution dots coming in around the same area (highlighted in blue squares). Now near the end you see a red box. This is a filter aspect. The PPO is green, yet the others are saying down/short. This does not mean it must be a long, however it is great warning to maybe avoid getting to bearish for the downside in that time. You want the PPO and line up with the others and it should be visually apparent that they all want to go the same way.
Here is a list of some key elements (before changes this script made) of parts this oscillator includes. My original publication of my oscillation setup was blocked by the mods here.. this one however includes a large variety of items that have been altered from their original formats and a well-explained trading system to use it with.
// Firefly
Firefly Oscillator
// PPO
PPO PercentileRank Mkt Tops & Bottoms (@PuppyTherapy)
// Divergence
Divergence Indicator (any oscillator)
// Godmode
Godmode3.2+LSMA
// Schaff
Schaff Trend Cycle
// Frama
(FRAMA) Fractal Adaptive Moving Average
LordPepe Stochastic SignalsThis is the Lord Pepe. Howdy. Basic buy/sell indicator to accumulate along a downtrend and release your stack during the uptrend and oversold levels of the stochastic. The buys should be used to stack, and sells indicate levels of profit taking, they do not signal a long term reversal, only < 25% of stack should be released on "OB" signals.
OB - overbought (sell)
OS - oversold (buy)
MACD signal with alert (long/short/close) for TV free accountSend MACD alert through email (available for free/pro user):
// 3 - buy
// -2 - short
// 0 - close position
// 1 - ignore
Example buy signal
Alert: STRAT3. BINANCE:BTCUSDTPERP, price = 31080
Example sell signal
Alert: STRAT-2. BINANCE:BTCUSDTPERP, price = 31080
Example close signal
Alert: STRAT0. BINANCE:BTCUSDTPERP, price = 31080
Example ignore signal
Alert: STRAT1. BINANCE:BTCUSDTPERP, price = 31080
Precise_SignalThis signal combines a portion of Chris Moody's 2014 SlingShot and my 2017 MTF Indicators. Both of our prior scripts over indicated Buy and Sell Points. This signal indicates a buy or sell point much less than our prior scripts did but with absolute precision.
I would say it is 100% accurate, but that is because I am yet to find a timeframe and symbol where the Buy signal failed to see the equity move up or the Sell signal failed to see the equity move down over the next 5 bars. I have tested 2000 charts so far. To be safe, I would rather state this indicator is accurate nearly 100% of the time.
The indicator is made up of 2 main portions and both of them have to agree on a buy or sell in order to indicate such with a vertical green or maroon bar beneath the chart. If there is a failure to agree, nothing is signaled.
Indicator 1 combines a stochastic of a 3 hour chart and a daily chart to determine when the stochastics are in agreement on direction. When there is agreement, both of them MUST cross from a buy state to a sell state and vice versa at exactly the same time. This is difficult to achieve and it is already rare for this occurrence to produce a signal. When a signal is produce it is combine with Chris Moody's 2014 SlingShot Indicator which conservatively determines Buy and Sell signals based on EMAs and market direction. Signals from his SlingShot are infrequent.
BUY Signal
When my MTF signals Buy at the same time that the SlingShot signals a Buy, a vertical green bar will appear in the window containing this script. The vertical bar is based on the close price of the equity and is only final when the close price is final. A BUY signal means the equity will move up potentially as early as the next bar and achieve a higher value from the close price on the signal bar.
SELL Signal
Likewise, a sell signal from the MTF at the same time as a sell signal from the SlingShot will create a maroon bar in the window containing this script. The vertical bar is based on the close price of the equity and is only final when the close price is final. A SELL signal means the equity will move down potentially as early as the next bar and achieve a lower value from the close price on the signal bar.
The default values for this script are hard-coded into this script. You can edit any of the value you would like to play with other timeframes, stochastic, and moving average lengths.
I have played with these values and have hard-coded the ones that are most accurate. Please let me know if you find others that work.
Hopefully this becomes an extra tool in your technical trading toolkit.
Ichimoku Kinko Hyo SignalsIchimoku Kinko Hyo Signals
This script show signals based on my understanding in Ichimoku Kinko Hyo.
/!\ Please do not follow signals blindly and always make your own analysis /!\
Buy : Han Ne lines are up, price is up, and also stochastic (K=30, D=10) is up
Strong Buy : Is a Sanyaku Kouten and can show a potential reverse in current tendance and Buy Signal conditions
Sell : Han Ne lines are down, price is down, and also stochastic (K=30, D=10) is down
Strong Sell : Is a Sanyaku Gyakuten and can show a potential reverse in current tendance and Sell Signal conditions
Exit : Show a potential time to take profit based on previous Sell, Strong Sell, Buy, or Strong Buy signal
Open Close Cross Strategy R6.1 revised by yourmattieOriginal version: Open Close Cross Strategy R5 revised by JustUncle.
Change: script changed to a study script with custom alerts.
This revision is an open Public release, with just some minor changes. It is a revision of the Strategy "Open Close Cross Strategy R2" originally published by @JayRogers.
Revised by JustUncleL
Description :
Strategy based around Open-Close Moving Average Crossovers optionally from a higher time frame.
Read more about the indicator original script
Klik here
##USE AT YOUR OWN RISK##
Use this as overlayer on the original strategy to set custom alerts.
Info: with this study script no buy/sell arrows show up op the chart.
Does some know a solution for this issue:
Issue: sometimes it gives a false signal because even when you set "one per bar close" the custom set alert might come halfway the bar....and it might be a false signal when the bar is closed
Does somone know a fix for this? I tried with barstate.iscomfirmed but it didn't work for me.
Ps. I'm not a developer...just changed the scipt by watching a youtube tutorial.
[fareid] Quick Backtest Framework█ OVERVIEW
This Framework allows Pine Coders to quickly code Study() based signal/strategy and validate its viability before proceed to code with more advance/complex customized rules for entry, exit, trailstop, risk management etc..
This is somewhat an upgraded version of my earlier personal template with different strategy used, cleaner code
and additional features.
█ USE CASES
- You have an idea for trade signal and need a quick way to verify its potential before writing lengthy/complicated code
- You found a study script for trading signal in public library and want to validate it profitability with minimum effort before including it in your trading playbook
█ FEATURES
- Alert: Ready to use alert function based on signals from your custom indicator.
- Visual Backtest: Auto-plot entry, stop-loss and take profit for simple strategy performance analysis
- Backtest Statistic: Provide basic key metrics based on backtest strategy
- BTE External Signal Protocol: Ready to use code that will supply required state to PineCoders Backtesting & Trading Engine if you wish to have more advance and sophisticated backtesting engine
Notes: All of the above features have On/Off toggle
█ Description & How To Use
This Framework consist of 5 Modules but you only need to edit the first 2 Modules:
Module1: Indicator
Module2: Framework Input Protocol
Module3: Alert
Module4: Backtest
Module5: Backtest & Trading Engine
Tips: The source-code includes collapsible block by module for easy navigating
Module1: Indicator:
-----------------------------------------------------------------------------------
Main Module. Place custom indicator input parameter/calculation/indicator plotting here
Sample Strategy: Double MACD Crossover
MACD Signal: 1st MACD Cross above signal line indicate Buy Signal
1st MACD Cross below signal line indicate Sell Signal
MACD Filter: 2nd MACD is above 0 line indicate Uptrend
2nd MACD is below 0 line indicate Downtrend
Module2: Framework Input Protocol:
-----------------------------------------------------------------------------------
Use this module to connect main indicator/signal calculated in Module1 to the rest of the framework's module
4 variables needed to be defined here:
1. Uptrend
2. Dntrend
3. BuySignal
4. SellSignal
i'm not sure how to place a code snippet here to show you example so in the source code i already put a comment in Module2 on which part u need to edit. I hope its pretty simple to use.
Module3: Alert Module Description:
-----------------------------------------------------------------------------------
As long as the variables in Module2 properly defined, the alert module is ready to use without any further modification.
Input:
Enable Alert --> Enable TV's alert and plot signal to chart
Alert Type --> Set to take Buy only, Sell only or Both alert
Module4: Backtest Module Description:
-----------------------------------------------------------------------------------
As long as the variables in Module2 properly defined, the backtest module is ready to use without any further modification.
Input:
Backtest Stat --> Enable Backtest Statistic Label
Backtest Visual --> Enable Backtest visual simulation
Backtest Type --> Set to take Buy only or Sell only or both
SL Type -->
ATR : Set SL in ATR times Multiplier below entry price
Fixed : Set SL in fixed point below entry point (in 'Dollar'). e.g. for Stocks -> 0.5 equals to 50cent while for EURUSD currency -> 0.005 equal to 50 pips
HiLo Bar: Set SL at highest/lowest wick of previous bar plus/minus Fixed point. e.g. EURUSD HiLo=3 and Fixed Point = 0.0005, buy trade will place SL 5 Pips below lowest of previous 3 bar
SL ATR Multi --> Set Lookback Period used for SL's ATR calculation
SL ATR Multi --> Set ATR Multiplier for SL
SL Fixed --> Set Fixed Level for SL
SL Bar --> Set Number of previous bar to check for SL placement
TP RR Ratio --> Set TP based on RR multiplier. e.g. 2 means TP level will be twice further from entry point compared to Entry-SL distance.
Notes: The point is for preliminary testing, so it only supports 1 trade at a time and no Trailing Stop
Module5: Backtest & Trading Engine Description:
-----------------------------------------------------------------------------------
As long as the variables in Module2 properly defined, the Pinecoders BTE module is ready to use without any further modification.
Input:
External Signal Protocol --> Set ESP State to send to "Backtesting & Trading Engine "
Signal With Filter --> Use this to send entry signal that already filtered by this study indicator (without stoploss level)
Signal Without Filter --> Use this to send raw entry signal that are NOT YET FILTERED by this study indicator (without stoploss level)
Signal and Stop With Filter --> Use this to send entry signal WITH StopLoss that already filtered by this study indicator (with stoploss level)
Signal and Stop Without Filter --> Use this to send raw entry signal WITH StopLoss that are NOT YET FILTERED by this study indicator (with stoploss level)
Notes: Backtesting & Trading Engine already have built-in Filter, Entries and Stop Level. e.g. Unselect all their filter state if only want to use custom filter and make sure send Signal with Filter (with or without SL level)
█ DISCLAIMER:
This framework main objective is to create my personal indicator template so that i just have to modify the indicator module for preliminary testing in future.
The sample strategy included are for educational purpose only. Use at your own risk
credit: LucF/PineCoders for a lot of his scripts that i use as a guide to complete this
MACD With Trend Filter: Visual Backtest Module TemplateSample Strategy: MACD Crossover with trend filter options
MA Filter : Price Close Above MA, Search for Buy, Price Close Below MA, Search for Sell
ADX Filter : Take trade only when ADX is above certain treshold
MACD Signal : MACD Cross above signal line while under 0 line indicate Buy Signal
MACD Cross below signal line while above 0 line indicate Sell Signal
-----------------------------
Using Alert Module:
Enable Alert --> Enable TV's alert and plot signal to chart
Alert Type --> Set to take Buy only, Sell only or Both alert
----------------------------
Using Backtest Module:
Enable Backtest --> Enable Backtest simulation
Backtest Type --> Set to take Buy only, Sell only or Both
SL Type -->
ATR : Set SL in ATR times Multiplier below/above entry price
Fixed : Set SL in fixed point below entry point (in 'Dollar'). e.g. for Stocks -> 0.5 equals to 50cent while for EURUSD currency -> 0.005 equal to 50 pips
HiLo Bar : Set SL at highest/lowest wick of previous bar plus/minus Fixed point. e.g. EURUSD HiLo=3 and Fixed Point = 0.0005, buy trade will place SL 5 Pips below lowest of previous 3 bar
SL ATR Period --> Set Lookback Period used for SL's ATR calculation
SL ATR Multi --> Set ATR Multiplier for SL
SL Fixed --> Set Fixed Level for SL (Use when SL Type is either Fixed or HiLo Bar)
SL Bar --> Set Number of previous bar to check for SL placement
TP RR Ratio --> Set TP based on RR multiplier. e.g. 2 means TP level will be twice further from entry point compared to Entry-SL distance.
Notes: The point is for preliminary testing, so it only supports 1 trade at a time and no Trailing Stop
----------------------------
Disclaimer:
This script main objective is to create my personal indicator template so that i just have to modify the indicator module for preliminary testing in future.
Testing Alert Module so i can re-use it as template in future study/indicator
Testing Visual Backtest Module so i can re-use it as template in future study/indicator
i believe using Strategy function is a better approach for this but the entry/exit level seems to be hit n miss (at least for me, still trying to figure what i did wrong)
also, i rather code the strategy in other platform where i can use the more accurate tick data if i want to validate backtest statistics.
My study scripts was built only to test/visualize an idea to see its viability and if it can be used to optimize existing strategy.
credit: ADX code are originally from "ADX and DI" by @BeikabuOyaji although i re-wrote so i can have cleaner read and use RMA instead of SMA
Trend Trader Buy/Sell SignalsTrend Trader
The code is open source, what it uses to print signals is MACD cross and ADX. Bar colors change in relation to where price is according to the 50 day MA. The MA ribbon is used for visualizing trend and using it for dynamic support/resistance. The ribbon is comprised of the 50 day and 100 day MAs.
Main reason to publish this script is because some like to jumble up scripts together slap some moving averages on it to "follow trend" and then label it an algorithm, market it and sell it to people online. No single system will work 100% of the time, do you due diligence in anything you are interested in buying. Plenty of free scripts in the TV library that can do you justice when trading.
Excellent ADXThe Average Directional movement indeX (ADX) is an indicator that helps you determine the trend direction, pivot points, and much more else! But it looks not so easy as other famous indicators. It seems strange or even terrible, but don't be afraid. Let's understand how it works and get its power into your analysis tactics.
In the beginning, imagine a drunk man goes through a ladder: step by step. Up, up, down, up, down, down, up...
How can we understand which direction he goes? Exactly! We can count the number of steps in each direction. In the above example, in the upward – 4, in the downward – 3. So, it looks like he goes in an upward direction.
The ADX indicator counts the same steps, but for price. The size of each step equals 1 ATR for "DI Length" candles. On the indicator chart, we have the green and red lines. The green line represents a number of steps upward. The red line shows one downward. When the red line upper green, then the price goes below, then the trend is directed down. Later the green line comes above the red one, and then the trend changes the direction to upward. Wow? After that, you can easy detect the trend direction on the market!
But it is still not the end. On the chart, we also have the fat blue line. This is the ADX line, and it represents the power of the trend. It is calculated from a distance between the green and red curves. The ADX line value grows if the distance is increased. If the movement is really powerful, then a number of steps into a direction much more prominent than one in an opposed direction. Then the blue line grows faster. But if the growth has stopped and the blue line turns back or already had changed self-direction, then it is a signal that the trend has ended too. It's an excellent sign to close the position (but not always). Easy? Not quite. Thresholds help you there. The indicator has two additional parameters: upper and lower thresholds to evaluate the trend-over signal strength. An u-turn of the ADX line above the upper threshold sends a strong signal. If one occurs between both thresholds, it is a bit weak signal. But if the blue line goes below the lower threshold, it looks like there is no trend, and the price goes side. We can also say that the price goes side when the ADX value gradually falls down.
The Excellent ADX indicator helps you catch pivot/pullback signals based on green, red, and blue lines. Each such signal is highlighted as a green (buy) or red (sell) dot on the plot. The size of the dot represents the strength of the signal. You can also check the position of green and red lines from each other to determine the trend direction and the place where it has been changed. The Excellent ADX indicator helps you there too. It highlights the trend direction by the background-color, so you'll never miss it! The Excellent ADX good compliance with the Price Channel indicator built for the same length. You can use them together to be on a trend wave always!
Bollinger Band Crossover SignalI'm a little surprised I couldn't find a BB crossover script on here since I've always used it on other charting software. So of course I had to write one in for TradingView.
Essentially what this script signifies are price breakouts when price crosses over the upper BB band. So what it shows is that market conditions are entering overbought territory.
Length is set to 20 and Standard Deviation is set to 2. These are the default settings.
The way I use the script is to identify breakouts in price, as well as a signal to start scaling out of a position if I am already in one.
RSI Chart Bars 8 55 45Dear Traders
This RSI 8 period made for perfect entry for Long and Short for Intraday/Scalping in any time frame, when RSI 8 crossed above 55 the Candle charged to White then you can go for Long/Buy and when crossed below 45 the Candle changed to Yellow so you can go for Short/Sell, it working in any time frame.
Thanks & Regards
Nesan