Support and Resistance Pivot Points/Lines [Mauserrifle]Support and Resistance Pivot Points/Lines by Mauserrifle. A personal take on drawing support and resistance pivot lines. This indicator was born as the core of bot strategies I am trying to build. I think this indicator with its feature called “Cooldown rounding” can be useful to others to manually scalp or analyze charts. I did not find other indicators to do the same so I hope you find it useful.
A summary of the features:
It will draw high/low pivot lines based on a maximum of eight higher timeframes
You can set up how many days the lines are valid and appear per timeframe. The default period days are based on a 2m chart strategy. Consider higher values for day charts.
The lines will be drawn from the moment when they are KNOWN, which helps analyzing historical charts. You can change this behavior to make them draw from the pivot (looking at future data on historic data)
The pivot point lines can be rounded by multiple methods: round, ceil/floor, roundn (decimal) and round_to_mintick. This general rounding feature is disabled by default because, in my opinion, a much more useful one can be used which I call “Cooldown rounding” described in the next point.
Cooldown rounding: Round lows and highs for a cooldown period to keep the previous pivot line instead of adding a new line when they match the rounded value within the cooldown period. The existing line will be extended. This feature is useful because it makes sure the initial line is added to the exact high/low pivot level but any future lines within the rounding will just extend the existing line. Consider using roundn on some intraday charts such as SPY 2m.
You can set a maximum minutes for the cooldown. The default is 3 years which is just based on some charting techniques for scalping 2m. It will just enable the cooldown rounding permanently on the intraday (due max bar limit) and with a limit on daily. Tweak it to your needs.
It is possible to always add new pivot lines when a new high is higher or low is lower compared to previous line. Thus ignoring the rounding logic. Consider disabling it on intraday charts such as SPY 2m.
NOTE:
Only configured timeframes EQUAL/ABOVE your chart timeframe will activate
The default period days are optimized for a 2m intraday trading strategy. Consider higher values for day charts.
Max lines rendered is set to 500
Line calculation is limited by the max bars of the chart and date range
Repainting may happen on intraday when for example using a 2m chart timeframe with pivots on 15m+ (as documented by tradingview). Rendered days 7+ will also cause repainting issues on 2m charts. See tradingview support docs: 43000478429. For scalping manually using already known lines this shouldn't be a problem I think but be aware!
The default settings have been set so every chart timeframe will show lines without further configuration.
Keep an eye on the data window how many lines are rendered. Make sure you never exceed 500. Anything above will cause earlier lines to disappear which could be a problem when you use it to analyze historical data.
I hope you find this useful!
DISCLAIMER
Trading is risky & most day traders lose money. This indicator is purely for informational & educational purposes only. Past performance does not guarantee future results.
Search in scripts for "bot"
HilalimSB Strategy HilalimSB A Wedding Gift 🌙
What is HilalimSB🌙?
First of all, as mentioned in the title, HilalimSB is a wedding gift.
HilalimSB - Revealing the Secrets of the Trend
HilalimSB is a powerful indicator designed to help investors analyze market trends and optimize trading strategies. Designed to uncover the secrets at the heart of the trend, HilalimSB stands out with its unique features and impressive algorithm.
Hilalim Algorithm and Fixed ATR Value:
HilalimSB is equipped with a special algorithm called "Hilalim" to detect market trends. This algorithm can delve into the depths of price movements to determine the direction of the trend and provide users with the ability to predict future price movements. Additionally, HilalimSB uses its own fixed Average True Range (ATR) value. ATR is an indicator that measures price movement volatility and is often used to determine the strength of a trend. The fixed ATR value of HilalimSB has been tested over long periods and its reliability has been proven. This allows users to interpret the signals provided by the indicator more reliably.
ATR Calculation Steps
1.True Range Calculation:
+ The True Range (TR) is the greatest of the following three values:
1. Current high minus current low
2. Current high minus previous close (absolute value)
3. Current low minus previous close (absolute value)
2.Average True Range (ATR) Calculation:
-The initial ATR value is calculated as the average of the TR values over a specified period
(typically 14 periods).
-For subsequent periods, the ATR is calculated using the following formula:
ATRt=(ATRt−1×(n−1)+TRt)/n
Where:
+ ATRt is the ATR for the current period,
+ ATRt−1 is the ATR for the previous period,
+ TRt is the True Range for the current period,
+ n is the number of periods.
Pine Script to Calculate ATR with User-Defined Length and Multiplier
Here is the Pine Script code for calculating the ATR with user-defined X length and Y multiplier:
//@version=5
indicator("Custom ATR", overlay=false)
// User-defined inputs
X = input.int(14, minval=1, title="ATR Period (X)")
Y = input.float(1.0, title="ATR Multiplier (Y)")
// True Range calculation
TR1 = high - low
TR2 = math.abs(high - close )
TR3 = math.abs(low - close )
TR = math.max(TR1, math.max(TR2, TR3))
// ATR calculation
ATR = ta.rma(TR, X)
// Apply multiplier
customATR = ATR * Y
// Plot the ATR value
plot(customATR, title="Custom ATR", color=color.blue, linewidth=2)
This code can be added as a new Pine Script indicator in TradingView, allowing users to calculate and display the ATR on the chart according to their specified parameters.
HilalimSB's Distinction from Other ATR Indicators
HilalimSB emerges with its unique Average True Range (ATR) value, presenting itself to users. Equipped with a proprietary ATR algorithm, this indicator is released in a non-editable form for users. After meticulous testing across various instruments with predetermined period and multiplier values, it is made available for use.
ATR is acknowledged as a critical calculation tool in the financial sector. The ATR calculation process of HilalimSB is conducted as a result of various research efforts and concrete data-based computations. Therefore, the HilalimSB indicator is published with its proprietary ATR values, unavailable for modification.
The ATR period and multiplier values provided by HilalimSB constitute the fundamental logic of a trading strategy. This unique feature aids investors in making informed decisions.
Visual Aesthetics and Clear Charts:
HilalimSB provides a user-friendly interface with clear and impressive graphics. Trend changes are highlighted with vibrant colors and are visually easy to understand. You can choose colors based on eye comfort, allowing you to personalize your trading screen for a more enjoyable experience. While offering a flexible approach tailored to users' needs, HilalimSB also promises an aesthetic and professional experience.
Strong Signals and Buy/Sell Indicators:
After completing test operations, HilalimSB produces data at various time intervals. However, we would like to emphasize to users that based on our studies, it provides the best signals in 1-hour chart data. HilalimSB produces strong signals to identify trend reversals. Buy or sell points are clearly indicated, allowing users to develop and implement trading strategies based on these signals.
For example, let's imagine you wanted to open a position on BTC on 2023.11.02. You are aware that you need to calculate which of the buying or selling transactions would be more profitable. You need support from various indicators to open a position. Based on the analysis and calculations it has made from the data it contains, HilalimSB would have detected that the graph is more suitable for a selling position, and by producing a sell signal at the most ideal selling point at 08:00 on 2023.11.02 (UTC+3 Istanbul), it would have informed you of the direction the graph would follow, allowing you to benefit positively from a 2.56% decline.
Technology and Innovation:
HilalimSB aims to enhance the trading experience using the latest technology. With its innovative approach, it enables users to discover market opportunities and support their decisions. Thus, investors can make more informed and successful trades. Real-Time Data Analysis: HilalimSB analyzes market data in real-time and identifies updated trends instantly. This allows users to make more informed trading decisions by staying informed of the latest market developments. Continuous Update and Improvement: HilalimSB is constantly updated and improved. New features are added and existing ones are enhanced based on user feedback and market changes. Thus, HilalimSB always aims to provide the latest technology and the best user experience.
Social Order and Intrinsic Motivation:
Negative trends such as widespread illegal gambling and uncontrolled risk-taking can have adverse financial effects on society. The primary goal of HilalimSB is to counteract these negative trends by guiding and encouraging users with data-driven analysis and calculable investment systems. This allows investors to trade more consciously and safely.
What is HilalimSB Strategy🌙?
HilalimSB Strategy is a strategy that is supported by the HilalimSB algorithm created by the creator of HilalimSB and continues transactions with take profit and stop loss levels determined by users who strategically and automatically open transactions as a result of the data it receives and automatically closes transactions under necessary conditions. It is a first in the tradingview world with its unique take profit and stop loss markings. HilalimSB Strategy is open to users' initiatives and is a trading strategy developed on BTC.
What does the HilalimSB Strategy target?
The main purpose of HilalimSB Strategy is to reduce the transaction load of traders and to be integrated into various brokerage firms and operated by automatic trading bots, and it is aimed to serve this purpose. In addition to the strategies currently available in the markets, HilalimSB Strategy offers a useful infrastructure to traders with its useful interface. HilalimSB Strategy, which was decided to be published as a result of various calculations, was offered to the users with its unique visual effects after the completion of the testing procedures under market conditions.
HilalimSB Strategy and Heikin Ashi
HilalimSB Strategy produces data in Heikin Ashi chart types, but since Heikin Ashi chart types have their own calculation method, HilalimSB Strategy has been published in a way that cannot produce data in this chart type due to HilalimSB Strategy's ideology of appealing to all types of users, and any confusion that may arise is prevented in this way.
After the necessary conditions determined by the creator of HilalimSB are met, HilalimSB Heikin Ashi will be shared exclusively with invited users only, upon request, to users who request an invitation.
Differences between HilalimSB Strategy and HilalimSB
HilalimSB Strategy has been shared as a strategy and its features have been explained above. HilalimSB is a trading indicator and this is the main difference between them.We can explain it briefly this way.
Here are the differences between indicators and strategies:
1.Purpose and Use:
Indicators: Analyze market data to provide information about price movements and trends. They typically generate buy and sell signals and give traders clues about when to make trades in the market.
Strategies: These are plans for trading based on specific rules. They use signals from indicators and other market data to execute buy and sell transactions.
2.Features:
Indicators: Operate independently and are based on specific mathematical formulas. Examples include moving averages, RSI, and MACD.
Strategies: Combine one or more indicators and other market analysis tools to create a comprehensive trading plan. This plan determines entry and exit points, risk management, and trade size.
3.Scope:
Indicators: Are single analysis tools focusing on specific time frames or price movements.
Strategies: Are comprehensive trading plans that typically involve multiple trades over a certain period.
4.Decision Making:
Indicators: Provide information to traders and help in the decision-making process.
Strategies: Are direct decision-making mechanisms that execute trades automatically according to predetermined rules.
5.Automation:
Indicators: Are mostly interpreted manually and used based on the trader’s discretion.
Strategies: Can be used in automated trading systems and execute trades automatically according to the set rules.
The shared image is a 1-hour chart of BTCUSDC.P determined by the user as 1 percent take profit and 1 percent stop loss. And transactions were opened on Binance with the commission rate determined as 0.017 for the USDC trading pair.
HilalimSB Strategy, which presents users with completely concrete data, has proven itself in testing processes and is a project of SB that aims to reach all user profiles.🌙
[Support and Resistance with Trend Lines] with Backtest (TSO) with Backtest (TSO)
===========================================================================
===========================================================================
This indicator serves as a comprehensive full-cycle trading system, providing alerts at each stage of the trade, from opening to closure. The algorithm uses most recent and historical S&R (Support and Resistance) levels with most recent and historical Trend Lines, generating signals for trades when Breaks/Bounces occur (Trade Open Signal triggers can be configured via very customizable indicator Input "Signal Trigger Matrix" settings). With signal for trade open, TP (Take Profit and SL (Stop Loss) levels are calculated as well and marked on the chart including alerts for each action of the trade. The indicator offers a variety of automated approaches for TP (Take-Profit) and SL (Stop-Loss) settings. These include static current/historical S&R (Support and Resistance) levels or S&R/Trend Lines dynamic breaks for TP (Take-Profit) and various SL (Stop-Loss) approaches, including ATR Trailing SL, opposite S&R (Support and Resistance) levels SL, opposite Trend Lines SL and more. This diverse set of tools ensure flexibility in tailoring TP (Take-Profit) and SL (Stop-Loss) parameters to different market conditions, contributing to a more adaptive and robust trading system. Additionally, a series of signal analysis tools, including market sentiment, candle bar analysis, divergence, and volume, enhance the precision of trading signals.
* Works with popular timeframes: 1M, 3M, 5M, 15M, 30M, 45M, 1H.
* Works well with Futures and Indices, can be used to trade Stocks, Crypto and FOREX.
* Includes LIVE alert/labels Breakouts and Bounces signal trigger feature, which can be used for scalping (NOTE: This approach cannot be backtested).
* Every action of the trade is calculated on a confirmed closed candle bar state (barstate.isconfirmed), so the indicator will never repaint.
==============================================================
Indicator examples:
---------------------------------------------------------------------------
Strategy Config: SRTL_MES_15M3Y_EODoff_ALL
Here is a nice example of MES (Micro E-Mini S&P 500 Index Futures) configuration, which uses S&R (Support and Resistance) breakouts as signal trigger with Elliot Wave confirmation and previous S&R historical levels for TP (Take-Profit).
---------------------------------------------------------------------------
An example of an intraday Tesla trade. Also the green arrows will be displayed IMMEDIATELY when Breakout/Reverse Bounce occurs (same an Alert will be triggered immediately).
===========================================================================
Trading open/close/TP/SL labels, plots and colors explanations:
---------------------------------------------------------------------------
>>> S&R (Support and Resistance) levels/lines: orange - support, blue - resistance (can be hidden).
>>> Trend Lines: yellow - support, green - resistance (can be hidden).
>>> Blue labels show resistance breakouts and bounces, light-blue - bullish, dark-blue - bearish
>>> Yellow labels show resistance breakouts and bounces, light-yellow - bullish, dark-yellow - bearish
>>> Green/Red arrows on top/bottom of candle bar will show LIVE breakouts (if turned on)
>>>>> LONG open: green "house" looking arrow below candle bar.
>>>>> SHORT open: red "house" looking arrow above candle bar.
>>>>> LONG/SHORT take-profit target: green/red circles (multi-profit > TP2/3/4/5 smaller circles).
>>>>> LONG/SHORT stop-loss target: green/red + crosses.
>>>>> LONG/SHORT take-profit hits: green/red diamonds.
>>>>> LONG/SHORT stop-loss hits: green/red X-crosses.
>>>>> LONG/SHORT EOD (End of Day | Intraday style) close (profitable trade): green/red squares.
>>>>> LONG/SHORT EOD (End of Day | Intraday style) close (loss trade): green/red PLUS(+)-crosses.
===========================================================================
STATS TABLE ///////////////////////////////////////////////////////////////
---------------------------------------------------------------------------
>>> Trading STATS table on the chart showing current trade direction, Last TP (Take-Profit) Taken, Current Trade PL (profit/loss in price difference from trade open to the very current state).
---------------------------------------------------------------------------
CUSTOM TRADING DATE RANGE /////////////////////////////////////////////////
---------------------------------------------------------------------------
>>>>> This feature can be used to manually set indicator trading range from and to a specific date and time. NOTE: This is not intended for a very long date range backtesting, utilize TradingView Strategy Tester for that.
* Use TradingView “Strategy Tester” to see Backtesting results
NOTE: If Strategy Tester does not show any results with Date Ranged fully unchecked, there may be an issue where a script opens a trade, but there is not enough TradingView power to set the Take-Profit and Stop-Loss and somehow an open trade gets stuck and never closes, so there are “no trades present”. In such case - manually check “Start”/“End” dates or use “Deep Backtesting” feature!
---------------------------------------------------------------------------
INTRADAY ACTIVE TRADING SESSION CONFIGURATION /////////////////////////////
---------------------------------------------------------------------------
>>> Regional Active Trading Session Hours Schedule: If selected - trades will only open during regional active trading session, if 'OFF', there will be no trading schedule and trades will open 24/7.
>>> EOD(End of Day) Close - On/Off: Close the trade if it's still open at the end of active trading session (on the very last candle bar). NOTE: If no region is selected at 'Regional Active Trading Session Schedule' - there will be no EOD(End of Day) Close and trades will run overnight until either SL(Stop-Loss) or TP(Take-Profit) is hit!
>>>>> EOD(End of Day) Close - 1 candle bar before last: This is specifically for stocks as while usually indices can be closed 15minutes after the market closes, for stocks - the last candle bar closes at the same time with the market active trading session, which if closed - trades can't be closed until next day/session! Enable this setting for the trade to close/alert 1 candle bar before the last one, so there is still time to close the trade at the Broker (NOTE: depending on the timeframe, 1 candle bar can be: 15sec, 30sec, 1min, 3min, 5min, 15min, 30min, 45min, 1h).
---------------------------------------------------------------------------
SIGNAL TRIGGER MATRIX ////////////////////////////////////////////////
---------------------------------------------------------------------------
>>> Trading Engine: This setting turns on TradingView Strategy trading engine for backtesting.
>>> Market Session Only: With this setting turned on, all signal trigger Breaks/Bounces will be hidden during Pre/Post market time.
>>> Plot S&R Levels/Lines: Plot S&R (Support and Resistance) on chart. Note: historical levels/lines will only be plotted if hit (Break/Bounce).
>>> Plot Trend Lines Levels/Lines: Plot Trend Lines levels/lines on chart. Note: historical levels/lines will only be plotted if hit (Break/Bounce).
>>> Use S&R Current Levels | Use S&R Historical Levels | Use Trend Lines Current Levels | Use Trend Lines Historical Levels |: Choose which levels should be used for Breaks/Bounces to be captured on. If all triggers are turned on/checked - whatever happens 1st wins the trigger.
>>> Breaks | Bounces: 'Breaks': Turn on Breaks through levels/lines signal trigger. | 'Bounces': Turn on Bounces off levels/lines signal trigger.
>>> Signal: Regular | Signal: S&R Combo | Signal: TL Combo | Signal: S&R + TL Combo | Signal: Repeat Action |: Trade open signal trigger execution approach MATRIX (If 1 or more turned on at the same time - whatever comes first will be the trade signal trigger). 'Regular': A single Break/Bounce must occur on a closed bar for signal trigger. 'S&R Combo': A combination of 2 Current + Historical S&R (Support and Resistance) Break/Bounce must happen in the same direction on same bar for signal trigger. 'TL Combo': A combination of 2 Current + Historical Trend Lines Break/Bounce must happen in the same direction on same bar for signal trigger. 'S&R + TL Combo': a combination of ANY S&R and Trend Line Break/Bounce must happen in the same direction on same bar for signal trigger. 'Repeat Action': Initial and then confirmation (2nd/3rd/etc. consecutive occurence) Break/Bounce must occur on same level/line for signal trigger.
>>> Historical - Look Back (# of days): How far back (in # of days) will historical S&R/Trend Lines will be used for Trade Open signals/TP/SL/etc.
>>> Historical - Look Back Invalidation (# of days): IF THERE IS TOO MUCH HISTORICAL LEVELS/LINES ON CHART - LOWER THIS SETTING + MAKE SURE IT'S SMALLER THAN 'Historical - Look Back (# of days)'. With big Look back period (5+ days) - it can become very messy with too many historical levels/lines. To clear oldest historical levels/lines - set Look Back Invalidation # of days to less than Historical Look Back # of days. (After X # of Look Back Invalidation days - older levels/lines will become invalidated and no longer used for opening trades/TP (Take-Profit)/SL (Stop-Loss), while newer levels/lines will still be discovered.
>>> S&R/Trend Lines - Support/Resistance combined into 1 entity: Every level or a line becomes simply a level or a line, regardless if it originally was a support or resistance. By default, depending on the level/line originally being support or resistance - the signal direction will be such as: Resistance is broken > LONG / bounced > SHORT; Support is broken > SHORT / bounced > LONG; with this setting on, either level or line can be both broken or bounced off in ANY direction, trade open direction will depend on current market sentiment only.
---------------------------------------------------------------------------
S&R CONFIGURATION ////////////////////////////////////////////////
---------------------------------------------------------------------------
>>> S&R Search - Left Bars (current): This setting is for calculating optimal S&R (Support and Resistance) levels (in combination with below - Right Bars).
>>> S&R Search - Right Bars (current): This setting is for calculating optimal S&R (Support and Resistance) levels (in combination with above - Left Bars).
>>> S&R Search - Custom Resolution (current): This is a custom timeframe setting specifically for S&R Search, it disregards current chart timeframe. This is great to use for scalping, for example: with main chart set to 1min and the custom timeframe set to 3min or 5min - there will be stronger support/resistance levels with more detailed price action.
>>> S&R Search - Left Bars (historical): This setting is for calculating optimal S&R (Support and Resistance) levels (in combination with below - Right Bars).
>>> S&R Search - Right Bars (historical): This setting is for calculating optimal S&R (Support and Resistance) levels (in combination with above - Left Bars).
>>> S&R Search - Custom Resolution (historical): This is a custom timeframe setting specifically for S&R Search, it disregards current chart timeframe. This is great to use for scalping, for example: with main chart set to 1min and the custom timeframe set to 3min or 5min - there will be stronger support/resistance levels with more detailed price action.
>>> S&R - Historical S&R Levels - Extend to the right: Extend all S&R lines to the right.
>>> S&R (Current/Historical) - Live Breakout/Bounce - ALERT/SHOW: NOTE: Alert wlil trigger immediately at price Breaking thru or Bouncing off level/line and an arrow above /below the bar will show the direction of breakout/bounce. If on that same live bar - price comes back causing the Breakout/Bounce become no longer valid - the arrow will disappear as the condition of the Break/Bounce will no longer be valid.
---------------------------------------------------------------------------
TREND LINES CONFIGURATION ////////////////////////////////////////////////
---------------------------------------------------------------------------
>>> Show: Trend Line development (where it 'did not exist' yet): It takes 2 pivots to develop a trend line, pivot is established at least 3 candle bars later from where the pivot is. With this setting turned on - it will plot dashed lines where trend lines originated connecting the 1st and 2nd pivot point up to where the trend line became established (where in reality you would now be able to draw a certain trend line). Established already generated trend line are plotted with a solid line.
>>> Trend Lines - Line Slope Confirmation: LONG breakout will only be shown if trend line is goind downslope \. SHORT breakout will only be shown if trend line is goind upslope /.
>>> Trend Lines - Search - Left Bars (current): This setting is for calculating optimal Trend Lines.
>>> Trend Lines - Search - Right Bars (current): This setting is for calculating optimal Trend Lines.
>>> Trend Lines - Custom Resolution (current): This is a custom timeframe setting specifically for S&R Search, it disregards current chart timeframe. This is great to use for scalping, for example: with main chart set to 1min and the custom timeframe set to 3min or 5min - there will be stronger support/resistance levels with more detailed price action.
>>> Trend Lines - Search - Left Bars (historical): This setting is for calculating optimal Trend Lines.
>>> Trend Lines - Search - Right Bars (historical): This setting is for calculating optimal Trend Lines.
>>> Trend Lines - Custom Resolution (historical): This is a custom timeframe setting specifically for S&R Search, it disregards current chart timeframe. This is great to use for scalping, for example: with main chart set to 1min and the custom timeframe set to 3min or 5min - there will be stronger support/resistance levels with more detailed price action.
>>> Trend Lines - Historical Trend Lines - Extend to the right: Extend all Trend Lines to the right.
>>> Trend Lines (Current/Historical) - Live Breakout/Bounce - ALERT/SHOW: NOTE: Alert will trigger immediately at price Breaking thru or Bouncing off level/line and an arrow above /below the bar will show the direction of breakout/bounce. If on that same live bar - price comes back causing the Breakout/Bounce become no longer valid - the arrow will disappear as the condition of the Break/Bounce will no longer be valid.
---------------------------------------------------------------------------
TAKE-PROFIT/STOP-LOSS CONFIGURATION ///////////////////////////////////////
---------------------------------------------------------------------------
>>> TP (Take-Profit) System: 'S&R Static Current/Historical': TP (Take-Profit) is calculated using current/historical S&R (Support & Resistance) levels at trade open and remains static. 'S&R/Trend Lines Dynamic Breaks': TP (Take-Profit) is fully dynamic and will be trigger at price above trade open price and with Breakout occurence (S&R or Trend Line current/historical breakout).
>>> TP (Take-Profit) # of targets: It is wise to divide the trade into several profit targets. With this setting - up to 5 TP (Take-Profit) targets can be approached. The trade will be equally divided up by the selected # of TP (Take-Profit) targets.
>>> SL (Stop-Loss) System: 'ATR-Trailing-SL': SL (Stop-Loss) is trail-following the ATR (Average True Range) line, NOTE: If at signal trigger, ATR will be against the trade direction - trade open signal will be skipped; 'S&R-Static-SL': SL (Stop-Loss) is set at trade open per optimal most recent S&R level and remains there until trade closes; 'TrendLines-Static-SL': SL (Stop-Loss) is set at trade open per optimal most recent trend line and remains there until trade closes; 'TrendLines-Dynamic-SL': SL (Stop-Loss) will be set per current opposite trend line and follow it until trade is open.; 'Oppos-Sig-Trd-in-Loss': SL (Stop-Loss) will trigger at opposite signal with trade currently at loss.
>>> SL (Stop-Loss) - On/Off: Without SL (Stop-Loss), unless EOD (End of Day) Close is turned on - there will be no SL (Stop-Loss) at all!
---------------------------------------------------------------------------
MARKET SENTIMENT CONFIRMATION ///////////////////////////////////////
---------------------------------------------------------------------------
>>> Market Sentiment: Signal is confirmed per Market Sentiment direction. If Market Sentiment is turned off - whatever signal comes 1st will be the trade open trigger.
---------------------------------------------------------------------------
SIGNAL ANALYSIS AND CLEANUP ///////////////////////////////////////////////
---------------------------------------------------------------------------
>>> Signal Cleanup - Bar Color: Include Bar Color (bullish/bearish) confirmation, LONG signal will only be opened if signal bar is green/bullish, SHORT if red/bearish.
>>> Signal Cleanup - Bar Directional Structure: Skip opposite bar structure types signals (For example: bearish green hammer).
>>> Signal Cleanup - Bar Doji Skip: Skip doji (indecisive) candles signals.
>>> Signal Cleanup - EWO (Elliott Wave Oscillator): Include EWO (Elliott Wave Oscillator), LONG will only be opened if EWO is bullish / SHORT if EWO is bearish.
>>> Signal Cleanup - VWAP (Volume-Weighted Average Price): Include VWAP (Volume-Weighted Average Price), LONG will only be opened if price is above VWAP / SHORT if price is below VWAP.
>>> Signal Cleanup - MA (Moving Average) Confirmation: Include MA (Moving Average), LONG will only be opened if MA is bullish / SHORT if MA is bearish.
>>> Signal Cleanup - ATR (Average True Range): Include ATR (Average True Range) confirmation, LONG will only be opened if ATR is bullish / SHORT if ATR is bearish.
>>> Signal Cleanup - Divergence(RSI + MACD): Include Divergence (RSI + MACD ) confirmation, LONG will only be opened if Divergence is bullish / SHORT if Divergence is bearish.
>>> Signal Cleanup - Volume % Strength: Include Volume strength/percentage confirmation, LONG/SHORT will only be opened with strong Volume matching the signal direction | By default, strong Volume percentage is set to 150% and weak to 50%.
>>> Signal Cleanup - Volume Above Average: Include Volume Above Moving Average (Volume closing bar closes above volume moving average) confirmation, LONG/SHORT will only be opened with Volume above average - Volume closed bar color must match the closed price color (bullish/bearish direction) + Volume bar must be closed above volume MA line).
---------------------------------------------------------------------------
===========================================================================
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
TP System - VERY IMPORTANT INFO!
-------------------------------------------------------------------------------------------------------------------
"TP PERCENTAGE" - amount by which current trade/position needs to be reduced/partially closed/sold.
-------------------------------------------------------------------------------------------------------------------
TP System: Dynamic
"TP PERCENTAGE" - will always be the same amount (trade/position size divided by the # of take-profit(TP) targets) and percentage to be closed will always be of the ORIGINAL trade/position.
-------------------------------------------------------------------------------------------------------------------
TP System: Static
"TP PERCENTAGE" - will always be the same amount IF take-profit(TP) targets are hit 1-by-1 (TP1 > TP2 > TP3 > TP4 > TP5), otherwise it will vary and unless it is a 1st take-profit(TP1), the REMAINING trade/position size will always be smaller than original and therefore the percentage to be closed will always be of the REMAINING trade/position and NOT the original one!
-------------------------------------------------------------------------------------------------------------------
"TP PERCENTAGE" CheatSheet (these are the only percentages you may see)
-----------------------------------------------------------------------
TP PERCENTAGE---Close/Sell Amount-------------Example (trade size: 50 stocks)
20%-------------trade size * 0.2--------------50 * 0.2 = 10 stocks
25%-------------trade size * 0.25-------------50 * 0.25 = 12.5(~13) stocks
34%-------------trade size * 0.34-------------50 * 0.34 = 17 stocks
40%-------------trade size * 0.4--------------50 * 0.4 = 20 stocks
50%-------------trade size * 0.5--------------50 * 0.5 = 25 stocks
60%-------------trade size * 0.6--------------50 * 0.6 = 30 stocks
66%-------------trade size * 0.66-------------50 * 0.66 = 33 stocks
75%-------------trade size * 0.75-------------50 * 0.75 = 37.5(~38) stocks
80%-------------trade size * 0.8--------------50 * 0.8 = 40 stocks
100%------------trade size--------------------50 = 50 stocks
-----------------------------------------------------------------------
If for any reason a portion of the current/remaining trade closed at such occurrence was slightly wrong, it is not an issue. Such occurrences are rare and with slight difference in partial TP closed is not significant to overall performance of our algorithms.
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
===========================================================================
Alert Settings (you don’t have to touch this section unless you will be using TradingView alerts through a Webhook to use with trading bot)
---------------------------------------------------------------------------
Here is how a LONG OPEN alert looks like.
NOTE: Each label , , etc. is customizable, you can change the text of it within indicator Input settings.
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
LONG: OPEN
ENTRY: 20000
TP1: 20500
TP2: 21000
TP3: 21500
TP4: 22500
TP5: 23500
SL: 19000
Leverage: 0
---------------------------------------------------------------------------
Here is how a TP1 alert will look with 5 TPs breakdown of the trade.
NOTE1: Next to TP1 taken it will show at which price it was triggered.
NOTE2: Next to "TP Percentage" it shows how much of the CURRENT/ACTIVE/REMAINING trade needs to be closed.
NOTE2: If TP2/3/4/5 comes before TP1 - the alert will tell you exactly how many percent of the trade needs to be closed!
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
LONG: TP1
TP1: 20500
TP Percentage: 20%
---------------------------------------------------------------------------
Here is how an alert will look for LONG - STOP-LOSS.
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
ENTRY: 20000
LONG: SL
SL: 19000
---------------------------------------------------------------------------
Here is how an alert will look for LONG - EOD (End of Day) In Profit close.
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
LONG: EOD-Close (profit)
ENTRY: 20000
EOD-Close: 21900
===========================================================================
Adding Alerts in TradngView
---------------------------------------------------------------------------
-Add indicator to chart and make sure the correct strategy is configured (check Backtesting results)
-Right-click anywhere on the TradingView chart
-Click on Add alert
-Condition: Select this indicator by it’s name
-Immediately below, change it to "alert() function calls only", as other wise there will be 2 alerts for every alert!
-Expiration: Open-ended (that may require higher tier TradingView account, otherwise the alert will need to be occasionally re-triggered)
-Alert name: Whatever you desire
-Hit “Create”
-Note: If you change ANY Settings within the indicator – you must DELETE the current alert and create a new one per steps above, otherwise it will continue triggering alerts per old Settings!
===========================================================================
Good Luck! (NOTE: Trading is very risky, past performance is not necessarily indicative of future results, so please trade responsibly!)
---------------------------------------------------------------------------
NOTE: There seems to be a strange glitch when strategy is running live, it will show "double-take" take-profits labels on the chart. This is not affecting the script logic and backtesting results, if you simply change the timeframe real quick to something else then back - it will no longer show the duplicate orders... this must be some sort of a glitch as every alert was thoroughly tested to make sure everything is working!
Spot Martingale KuCoin - The Quant ScienceINTRODUCTION
Backtesting software of the Spot Martingale algorithm offered by the KuCoin exchange.
This script replicates the logic used by the KuCoin bot and is useful for analyzing strategy on any cryptocurrency historical series.
It's not intended as an automatic trading algorithm and does not offer the possibility of automatic order execution.
The trader will use this software exclusively to research the best parameters with which to work on KuCoin.
LOGIC OF EXECUTION
The execution of orders is composed as follows:
1) Start Martingale: initial order
2) Martingale-Number: orders following Start Martingale
(A) The software is designed and developed to replicate trading without taking into account technical indicators or particular market conditions. The Initial Order (Start Martingale) will be executed immediately the close of the previous Martingale when the balance of market orders is zero. It will use the capital set in the Properties section for the initial order.
(B) After the first order, the software will open new orders as the price decreases. For orders following Start Martingale, the initial capital, multiplier, and number of orders in the exponential growth context are considered. The multiplier is the factor that determines the proportional increase in capital with each new order. The number of orders, indicates how many times the multiplier is applied to increase the investment.
Example
To find out the capital used in Martingale order number 5, with a Multiple For Position Increase equal to 2 and a starting capital of $100, the formula will be as follows:
Martingale Order = ($100 * (2 * 2 * 2 * 2 * 2)) = $100 * 32 = $3.200
(C) A multiplier is used for each new order that will increase the quantity purchased.
(D) All previously open orders are closed once the take profit is reached.
USER MANUAL
The user interface consists of two main sections:
1. Settings
Percentage Drop for Position Increase (0.1-15%) : percentage distance between Martingale orders. For example, if you set 5% each new order will be opened after a 5% price decrease from the previous one.
Max Position Increases (1-15) : number of Martingale orders to be executed after Start Martingale. For example, if you set 10, up to10 orders will be opened after Start Martingale.
Multiple For Position Increase (1-2x) : capital multiplier. For example, if you set 2 each for each new order, the capital involved will be doubled, order by order.
Take Profit Percentage (0.5-1000%) : percentage take profit, calculated on the average entry price.
2. Date Range Backtesting
The Date Range Backtesting section adjusts the analysis period. The user can easily adjust the UI parameters, and automatically the software will update the data.
LIMITATIONS OF THE MODEL
Although the Martingale model is widely used in position management, even this model has limitations and is subject to real risks during particular market conditions. Knowing these conditions will help you understand which asset is best to use the strategy on.
The main risks in adopting this automatic strategy are 2:
1) The price falls below our last order.
It happens during periods of strong bear-market in which the price collapses abruptly without experiencing any pullback. In this case the algorithm will enter a drawdown phase and the strategy will become a loser. The trader will then have to consider whether to wait for a price recovery or to incur a loss by manually closing the algorithm.
2) The price increases quickly.
It happens during periods of strong bull-market in which the price rises abruptly without experiencing any pullback. In this case the algorithm will not optimize order execution, working only with Start Martingale in the vast majority of trades. Given the exponential nature of the investment, the algorithm will in this case generate a profit that is always less than that of the reference market.
The best market conditions to use this strategy are characterized by high volatility such as correction phases during a bull run and/or markets that exhibit sideways price trends (such as areas of accumulation or congestion where price will generate many false signals).
FEATURES
This script was developed by including features to optimize the user experience.
Includes a dashboard at launch that allows the user to intuitively enter backtesting parameters.
Includes graphical indicator that helps the user analyze the behavior of the strategy.
Includes a date period backtesting feature that allows the user to adjust and choose custom historical periods.
DISCLAIMER
This script was released using parameters researched solely for the BTC/USDT pair, 4H timeframe, traded on the KuCoin Exchange (2017-present). Do not consider this combination of parameters as universal and usable on all assets and timeframes.
Alligator + Fractals + Divergent & Squat Bars + Signal AlertsThe indicator includes Williams Alligator, Williams Fractals, Divergent Bars, Market Facilitation Index, Highest and Lowest Bars, maximum and minimum peak of Awesome Oscillator, and signal alerts based on Bill Williams' Profitunity strategy.
MFI and Awesome Oscillator
According to the Market Facilitation Index Oscillator, the Squat bar is colored blue, all other bars are colored according to the Awesome Oscillator color, except for the Fake bars, colored with a lighter AO color. In the indicator settings, you can enable the display of "Green" bars (in the "Green Bars > Show" field). In the indicator style settings, you can disable changing the color of bars in accordance with the AO color (in the "AO bars" field), including changing the color for Fake bars (in the "Fake AO bars" field).
MFI is calculated using the formula: (high - low) / volume.
A Squat bar means that, compared to the previous bar, its MFI has decreased and at the same time its volume has increased, i.e. MFI < previous bar and volume > previous bar. A sign of a possible price reversal, so this is a particularly important signal.
A Fake bar is the opposite of a Squat bar and means that, compared to the previous bar, its MFI has increased and at the same time its volume has decreased, i.e. MFI > previous bar and volume < previous bar.
A "Green" bar means that, compared to the previous bar, its MFI has increased and at the same time its volume has increased, i.e. MFI > previous bar and volume > previous bar. A sign of trend continuation. But a more significant trend confirmation or warning of a possible reversal is the Awesome Oscillator, which measures market momentum by calculating the difference between the 5 Period and 34 Period Simple Moving Averages (SMA 5 - SMA 34) based on the midpoints of the bars (hl2). Therefore, by default, the "Green" bars and their opposite "Fade" bars are colored according to the color of the Awesome Oscillator.
According to Bill Williams' Profitunity strategy, using the Awesome Oscillator, the third Elliott wave is determined by the maximum peak of AO in the range from 100 to 140 bars. The presence of divergence between the maximum AO peak and the subsequent lower AO peak in this interval also warns of a possible correction, especially if the AO crosses the zero line between these AO peaks. Therefore, the chart additionally displays the prices of the highest and lowest bars, as well as the maximum or minimum peak of AO in the interval of 140 bars from the last bar. In the indicator settings, you can hide labels, lines, change the number of bars and any parameters for the AO indicator - method (SMA, Smoothed SMA, EMA and others), length, source (open, high, low, close, hl2 and others).
Bullish Divergent bar
🟢 A buy signal (Long) is a Bullish Divergent bar with a green circle displayed above it if such a bar simultaneously meets all of the following conditions:
The high of the bar is below all lines of the Alligator indicator.
The closing price of the bar is above its middle, i.e. close > (high + low) / 2.
The low of the bar is below the low of 2 previous bars or below the low of one previous bar, and the low of the second previous bar is a lower fractal (▼). By default, Divergent bars are not displayed, the low of which is lower than the low of only one previous bar and the low of the 2nd previous bar is not a lower fractal (▼), but you can enable the display of any Divergent bars in the indicator settings (by setting the value "no" in the " field Divergent Bars > Filtration").
The following conditions strengthen the Bullish Divergent bar signal:
The opening price of the bar, as well as the closing price, is higher than its middle, i.e. Open > (high + low) / 2.
The high of the bar is below all lines of the open Alligator indicator, i.e. the green line (Lips) is below the red line (Teeth) and the red line is below the blue line (Jaw). In this case, the color of the circle above the Bullish Divergent bar is dark green.
Squat Divergent bar.
The bar following the Bullish Divergent bar corresponds to the green color of the Awesome Oscillator.
Divergence on Awesome Oscillator.
Formation of the lower fractal (▼), in which the low of the Divergent bar is the peak of the fractal.
Bearish Divergent bar
🔴 A signal to sell (Short) is a Bearish Divergent bar under which a red circle is displayed if such a bar simultaneously meets all the following conditions:
The low of the bar is above all lines of the Alligator indicator.
The closing price of the bar is below its middle, i.e. close < (high + low) / 2.
The high of the bar is higher than the high of 2 previous bars or higher than the high of one previous bar, and the high of the second previous bar is an upper fractal (▲). By default, Divergent bars are not displayed, the high of which is higher than the high of only one previous bar and the high of the 2nd previous bar is not an upper fractal (▲), but you can enable the display of any Divergent bars in the indicator settings (by setting the value "no" in the " field Divergent Bars > Filtration").
The following conditions strengthen the Bearish Divergent bar signal:
The opening price of the bar, as well as the closing price, is below its middle, i.e. open < (high + low) / 2.
The low of the bar is above all lines of the open Alligator indicator, i.e. the green line (Lips) is above the red line (Teeth) and the red line is above the blue line (Jaw). In this case, the color of the circle under the Bearish Divergent bar is dark red.
Squat Divergent bar.
The bar following the Bearish Divergent bar corresponds to the red color of the Awesome Oscillator.
Divergence on Awesome Oscillator.
Formation of the upper fractal (▲), in which the high of the Divergent bar is the peak of the fractal.
Alligator lines crossing
Bars crossing the green line (Lips) of the open Alligator indicator is the first warning of a possible correction (price rollback) if one of the following conditions is met:
If the bar closed below the Lips line, which is above the Teeth line, and the Teeth line is above the Jaw line, while the closing price of the previous bar is above the Lips line.
If the bar closed above the Lips line, which is below the Teeth line, and the Teeth line is below the Jaw line, while the closing price of the previous bar is below the Lips line.
The intersection of all open Alligator lines by bars is a sign of a deep correction and a warning of a possible trend change.
Frequent intersection of Alligator lines with each other is a sign of a sideways trend (flat).
Signal Alerts
To receive notifications about signals when creating an alert, you must select the condition "Any alert() function is call", in which case notifications will arrive in the following format:
D — timeframe, for example: D, 4H, 15m.
🟢 BDB⎾ - a signal for a Bullish Divergent bar to buy (Long), triggers once after the bar closes and includes additional signals:
/// — if Alligator is open.
⏉ — if the opening price of the bar, as well as the closing price, is above its middle.
+ Squat 🔷 - Squat bar or + Green ↑ - "Green" bar or + Fake ↓ - Fake bar.
+ AO 🟩 - if after the Divergent bar closes, the oscillator color change for the next bar corresponds the green color of the Awesome Oscillator. ┴/┬ — AO above/below the zero line. ∇ — if there is divergence on AO in the interval of 140 bars from the last bar.
🔴 BDB⎿ - a signal for a Bearish Divergent bar to sell (Short), triggers once after the bar closes and includes additional signals:
/// — if Alligator is open.
⏊ — if the opening price of the bar, as well as the closing price, is below its middle.
+ Squat 🔷 - Squat bar or + Green ↑ - "Green" bar or + Fake ↓ - Fake bar.
+ AO 🟥 - if after the Divergent bar closes, the oscillator color change for the next bar corresponds to the red color of the Awesome Oscillator. ┴/┬ — AO above/below the zero line. ∇ — if there is divergence on AO in the interval of 140 bars from the last bar.
Alert for bars crossing the green line (Lips) of the open Alligator indicator (can be disabled in the indicator settings in the "Alligator > Enable crossing lips alerts" field):
🔴 Crossing Lips ↓ - if the bar closed below the Lips line, which is above than the other lines, while the closing price of the previous bar is above the Lips line.
🟢 Crossing Lips ↑ - if the bar closed above the Lips line, which is below the other lines, while the closing price of the previous bar is below the Lips line.
The fractal signal is triggered after the second bar closes, completing the formation of the fractal, if alerts about fractals are enabled in the indicator settings (the "Fractals > Enable alerts" field):
🟢 Fractal ▲ - upper (Bearish) fractal.
🔴 Fractal ▼ — lower (Bullish) fractal.
⚪️ Fractal ▲/▼ - both upper and lower fractal.
↳ (H=high - L=low) = difference.
If you redirect notifications to a webhook URL, for example, to a Telegram bot, then you need to set the notification template for the webhook in the indicator settings in the "Webhook > Message" field (contains a tooltip with an example), in which you just need to specify the text {{message}}, which will be automatically replaced with the alert text with a ticker and a link to TradingView.
‼️ A signal is not a call to action, but only a reason to analyze the chart to make a decision based on the rules of your strategy.
***
Индикатор включает в себя Williams Alligator, Williams Fractals, Дивергентные бары, Market Facilitation Index, самый высокий и самый низкий бары, максимальный и минимальный пик Awesome Oscillator, а также оповещения о сигналах на основе стратегии Profitunity Билла Вильямса.
MFI и Awesome Oscillator
В соответствии с осциллятором Market Facilitation Index Приседающий бар окрашен в синий цвет, все остальные бары окрашены в соответствии с цветом Awesome Oscillator, кроме Фальшивых баров, которые окрашены более светлым цветом AO. В настройках индикатора вы можете включить отображение "Зеленых" баров (в поле "Green Bars > Show"). В настройках стиля индикатора вы можете выключить изменение цвета баров в соответствии с цветом AO (в поле "AO bars"), в том числе изменить цвет для Фальшивых баров (в поле "Fake AO bars").
MFI рассчитывается по формуле: (high - low) / volume.
Приседающий бар означает, что по сравнению с предыдущим баром его MFI снизился и в тоже время вырос его объем, т.е. MFI < предыдущего бара и объем > предыдущего бара. Признак возможного разворота цены, поэтому это особенно важный сигнал.
Фальшивый бар является противоположностью Приседающему бару и означает, что по сравнению с предыдущим баром его MFI увеличился и в тоже время снизился его объем, т.е. MFI > предыдущего бара и объем < предыдущего бара.
"Зеленый" бар означает, что по сравнению с предыдущим баром его MFI увеличился и в тоже время вырос его объем, т.е. MFI > предыдущего бара и объем > предыдущего бара. Признак продолжения тренда. Но более значимым подтверждением тренда или предупреждением о возможном развороте является Awesome Oscillator, который измеряет движущую силу рынка путем вычисления разницы между 5 Периодной и 34 Периодной Простыми Скользящими Средними (SMA 5 - SMA 34) по средним точкам баров (hl2). Поэтому по умолчанию "Зеленые" бары и противоположные им "Увядающие" бары окрашены в соответствии с цветом Awesome Oscillator.
По стратегии Profitunity Билла Вильямса с помощью осциллятора Awesome Oscillator определяется третья волна Эллиота по максимальному пику AO в интервале от 100 до 140 баров. Наличие дивергенции между максимальным пиком AO и следующим за ним более низким пиком AO в этом интервале также предупреждает о возможной коррекции, особенно если AO переходит через нулевую линию между этими пиками AO. Поэтому на графике дополнительно отображаются цены самого высокого и самого низкого баров, а также максимальный или минимальный пик АО в интервале 140 баров от последнего бара. В настройках индикатора вы можете скрыть метки, линии, изменить количество баров и любые параметры для индикатора AO – метод (SMA, Smoothed SMA, EMA и другие), длину, источник (open, high, low, close, hl2 и другие).
Бычий Дивергентный бар
🟢 Сигналом на покупку (Long) является Бычий Дивергентный бар над которым отображается зеленый круг, если такой бар соответствует одновременно всем следующим условиям:
Максимум бара ниже всех линий индикатора Alligator.
Цена закрытия бара выше его середины, т.е. close > (high + low) / 2.
Минимум бара ниже минимума 2-х предыдущих баров или ниже минимума одного предыдущего бара, а минимум второго предыдущего бара является нижним фракталом (▼). По умолчанию не отображаются Дивергентные бары, минимум которых ниже минимума только одного предыдущего бара и минимум 2-го предыдущего бара не является нижним фракталом (▼), но вы можете включить отображение любых Дивергентных баров в настройках индикатора (установив значение "no" в поле "Divergent Bars > Filtration").
Усилением сигнала Бычьего Дивергентного бара являются следующие условия:
Цена открытия бара, как и цена закрытия, выше его середины, т.е. Open > (high + low) / 2.
Максимум бара ниже всех линий открытого индикатора Alligator, т.е. зеленая линия (Lips) ниже красной линии (Teeth) и красная линия ниже синей линии (Jaw). В этом случае цвет круга над Бычьим Дивергентным баром окрашен в темно-зеленый цвет.
Приседающий Дивергентный бар.
Бар, следующий за Бычьим Дивергентным баром, соответствует зеленому цвету Awesome Oscillator.
Дивергенция на Awesome Oscillator.
Образование нижнего фрактала (▼), у которого минимум Дивергентного бара является пиком фрактала.
Медвежий Дивергентный бар
🔴 Сигналом на продажу (Short) является Медвежий Дивергентный бар под которым отображается красный круг, если такой бар соответствует одновременно всем следующим условиям:
Минимум бара выше всех линий индикатора Alligator.
Цена закрытия бара ниже его середины, т.е. close < (high + low) / 2.
Максимум бара выше маскимума 2-х предыдущих баров или выше максимума одного предыдущего бара, а максимум второго предыдущего бара является верхним фракталом (▲). По умолчанию не отображаются Дивергентные бары, максимум которых выше максимума только одного предыдущего бара и максимум 2-го предыдущего бара не является верхним фракталом (▲), но вы можете включить отображение любых Дивергентных баров в настройках индикатора (установив значение "no" в поле "Divergent Bars > Filtration").
Усилением сигнала Медвежьего Дивергентного бара являются следующие условия:
Цена открытия бара, как и цена закрытия, ниже его середины, т.е. open < (high + low) / 2.
Минимум бара выше всех линий открытого индикатора Alligator, т.е. зеленая линия (Lips) выше красной линии (Teeth) и красная линия выше синей линии (Jaw). В этом случае цвет круга под Медвежьим Дивергентным Баром окрашен в темно-красный цвет.
Приседающий Дивергентный бар.
Бар, следующий за Медвежьим Дивергентным баром, соответствует красному цвету Awesome Oscillator.
Дивергенция на Awesome Oscillator.
Образование верхнего фрактала (▲), у которого максимум Дивергентного бара является пиком фрактала.
Пересечение линий Alligator
Пересечение барами зеленой линии (Lips) открытого индикатора Alligator является первым предупреждением о возможной коррекции (откате цены) при выполнении одного из следующих условий:
Если бар закрылся ниже линии Lips, которая выше линии Teeth, а линия Teeth выше линии Jaw, при этом цена закрытия предыдущего бара находится выше линии Lips.
Если бар закрылся выше линии Lips, которая ниже линии Teeth, а линия Teeth ниже линии Jaw, при этом цена закрытия предыдущего бара находится ниже линии Lips.
Пересечение барами всех линий открытого Alligator является признаком глубокой коррекции и предупреждением о возможной смене тренда.
Частое пересечение линий Alligator между собой является признаком бокового тренда (флэт).
Оповещения о сигналах
Для получения уведомлений о сигналах при создании оповещения необходимо выбрать условие "При любом вызове функции alert()", в таком случае уведомления будут приходить в следующем формате:
D — таймфрейм, например: D, 4H, 15m.
🟢 BDB⎾ — сигнал Бычьего Дивергентного бара на покупку (Long), срабатывает один раз после закрытия бара и включает дополнительные сигналы:
/// — если Alligator открыт.
⏉ — если цена открытия бара, как и цена закрытия, выше его середины.
+ Squat 🔷 — Приседающий бар или + Green ↑ — "Зеленый" бар или + Fake ↓ — Фальшивый бар.
+ AO 🟩 — если после закрытия Дивергентного бара, изменение цвета осциллятора для следующего бара соответствует зеленому цвету Awesome Oscillator. ┴/┬ — AO выше/ниже нулевой линии. ∇ — если есть дивергенция на AO в интервале 140 баров от последнего бара.
🔴 BDB⎿ — сигнал Медвежьего Дивергентного бара на продажу (Short), срабатывает один раз после закрытия бара и включает дополнительные сигналы:
/// — если Alligator открыт.
⏊ — если цена открытия бара, как и цена закрытия, ниже его середины.
+ Squat 🔷 — Приседающий бар или + Green ↑ — "Зеленый" бар или + Fake ↓ — Фальшивый бар.
+ AO 🟥 — если после закрытия Дивергентного бара, изменение цвета осциллятора для следующего бара соответствует красному цвету Awesome Oscillator. ┴/┬ — AO выше/ниже нулевой линии. ∇ — если есть дивергенция на AO в интервале 140 баров от последнего бара.
Сигнал пересечения барами зеленой линии (Lips) открытого индикатора Alligator (можно отключить в настройках индикатора в поле "Alligator > Enable crossing lips alerts"):
🔴 Crossing Lips ↓ — если бар закрылся ниже линии Lips, которая выше остальных линий, при этом цена закрытия предыдущего бара находится выше линии Lips.
🟢 Crossing Lips ↑ — если бар закрылся выше линии Lips, которая ниже остальных линий, при этом цена закрытия предыдущего бара находится ниже линии Lips.
Сигнал фрактала срабатывает после закрытия второго бара, завершающего формирование фрактала, если оповещения о фракталах включены в настройках индикатора (поле "Fractals > Enable alerts"):
🟢 Fractal ▲ — верхний (Медвежий) фрактал.
🔴 Fractal ▼ — нижний (Бычий) фрактал.
⚪️ Fractal ▲/▼ — одновременно верхний и нижний фрактал.
↳ (H=high - L=low) = разница.
Если вы перенаправляете оповещения на URL вебхука, например, в бота Telegram, то вам необходимо установить шаблон оповещения для вебхука в настройках индикатора в поле "Webhook > Message" (содержит подсказку с примером), в котором в качестве текста сообщения достаточно указать текст {{message}}, который будет автоматически заменен на текст оповещения с тикером и ссылкой на TradingView.
‼️ Сигнал — это не призыв к действию, а лишь повод проанализировать график для принятия решения на основе правил вашей стратегии.
BitBell - EMA PullBack RSI EXO
🔵 Introduction
Version 1.1
This is a Pine 5 trend following strategy. It has a four strategy with several alerts and signals. The design intent is to produce a commercial grade signal generator that can be adapted to any symbol in cryptocurrency and only 1H Chart. Ideally, the script is reliable enough to be the basis of an automated trading system web-hooked to a server with API access to crypto brokerages. The strategy can be run in three different modes: long, short and bidirectional.
As a trend following strategy, the behavior of the script is to buy on strength and sell on weakness. As such the trade orders maintain its directional bias according to price pressure. What you will see on the chart is long positions on the left side of the mountain and short on the right. Long and short positions are not intermingled as long as there exists a detectable trend. This is extremely beneficial feature in long running bull or bear markets. The script uses multiple setups to avoid the situation where you got in on the trend, took a small profit but couldn’t get back in because the logic is waiting for a pullback or some other intricate condition.
Deep draw-downs are a characteristic of trend following systems and this system is no different. However, this script makes use of the TradingView pyramid feature with three NPUs to find better place and even you can change drop percentage in settings for another trigger, accessible from the properties tab.
When trend market break it will stop the trade and usually it takes 2-4 percent loss but don't worry it has prefect money management and you can use it for Futures market and even Spot market.
🔵 Design
This script uses twelve indicators on two time frames. The chart (primary) interval and one higher time frame which is based on the primary. The higher time frame identifies the trend for which the primary will trade. I’ve tried to keep the higher time frame around five times greater than the primary. The original trading algorithms are a port from a much larger program on another trading platform. I’ve converted some of the statistical functions to use standard indicators available on TradingView. The setups make heavy use of the Hull Moving Average in conjunction with EMAs that form the Bill Williams Alligator as described in his book “New Trading Dimensions” Chapter 3. Lag between the Hull and the EMAs form the basis of the entry and exit points. The alligator itself is used to identify the trend main body.
The entire script is around 740 lines of Pine code which is the maximum incidental size given the TradingView limits: local scopes, run-time duration and compile time. I’ve been working on this script for over a year and have tested it on various instruments stock crypto. It performs well on higher liquidity markets that have at least a year of historical data. Though it can be configured to work on any interval between 15 minutes and 4 hour, trend trading is generally a longer term paradigm. For day trading the 10 to 15 minute interval will allow you to catch momentum breakouts. For intraweek trades 30 minutes to 1 hour should give you a trade every other a day.
Inputs to the script use cone centric measurements in effort to avoid exposing adjustments to the various internal indicators. The goal was to keep the inputs relevant to the actual trade entry and exit locations as opposed to a series of MA input values and the like. As a result the strategy exposes over 12 inputs grouped into long or short sections. Inputs are available for the usual minimum profit and stop-loss as well as trade, modes, presets, reports and lots of calibrations. The inputs are numerous, I’m aware. Unfortunately, at this time, TradingView does not offer any other method to get data in the script. The usual initialization files such as cnf, cfg, ini, json and xml files are currently unsupported.
Example configurations for various instruments along with a detailed PDF user manual is available.
it has no repaint i guaranty this, and you can have 10 days free with comment and check it by yourself
One issue that comes up when comparing the strategy with the study is that the strategy trades show on the chart one bar later than the study. This problem is due to the fact that “strategy.entry()” and “strategy_close()” do not execute on the same bar called. The study, on the other hand, has no such limitation since there are no position routines. However, alerts that are subsequently fired off when triggered in the study are dispatched from the TradingView servers one bar later from the study plot. Therefore the alert you actually receive on your cell phone matches the strategy plot but is one bar later than the study plot.
Please be aware that the data source matters. Cryptocurrency has no central tick repository so each exchange supplies TradingView its feed. Even though it is the same symbol the quality of the data and subsequently the bars that are supplied to the chart varies with the exchange. This script will absolutely produce different results on different data feeds of the same symbol. Be sure to backtest this script on the same data you intend to receive alerts for. Any example settings I share with you will always have the exchange name used to generate the test results.
🟡 Usage
It sends long and short signals with pyramid orders of up to 3, meaning that the strategy can trigger up to 3 orders in the same direction. Good risk and money management.
It's important to note that the strategy combines 2 systems working together (Long and LongX). Let’s describe the specific features of this strategy.
🔵 If Findes Supports And Ressitances And Trend Lines As Best As It Can, And You Can See:
🟢 Frist Simple Long Condition = It Look At The Trend Wait For RSI Cross 30 Number Then Ckeck Risk To Reward, check something else such as divergence:
🟢 Another Long Example:
🔴 Frist Simple Short Condition = It Look At The Trend Wait For RSI Cross 70 Number Then Ckeck Risk To Reward, check something else such as divergence:
🔴 Another Short Example:
The following steps provide a very brief set of instructions that will get you started but will most certainly not produce the best backtest. A trading system that you are willing to risk your hard earned capital will require a well crafted configuration that involves time, expertise and clearly defined goals. As previously mentioned, I have several example configs that I use for my own trading that I can share with you along with a PDF which describes each input in detail. To get hands on experience in setting up your own symbol from scratch please follow the steps below.
The input dialog box contains over 12 inputs, There are four options must to be configured: Choose Target, side, Choose Settings, Money Management,and settings that apply to both. The following steps address these four main options only.
Money Management System For Leverage 10:
Bot Finds Last Lower Low And Calculate Distance From Entry Price, Then Cross It To Initial Capitan And Cross Leverage =>
Position_Size = (((1.64) * (initial Capital)) * (leverage))
And Check Dominances Too For Getting Best Money Management Result
🔵 Settings
* Side, You Can Set Long Or Short Or Both.
* Choose Target, You Can Set One Target Or All Targets.
* Money Management, You Can ON Or OFF It, With OFF You Can USE It For SPOT Trades.
* Choose Settings, In This Field You Can Set Mathematical Optimization, Ddepends On Which Pair You USE.
* Clear With Daily PullBack?, With This Check Box You Can Clear Signals With Daily PullBack.
* Long X, You Can Set Long Leverage.
* Short X, You Can Set Short Leverage.
* Second Order X, You Can Set Pyramiding Leverage.
* Target Long, You Can Set Percent For Long Target.
* Target Short, You Can Set Percent For Short Target.
* Short Martin Percent, You Can Set Short Martingale Percent.
* Long Martin Percent, You Can Set Long Martingale Percent.
🟡 Pyraming 3
🟡 Commission Is 0.065 %
🟡 Slippage Is 10 ticks
🔴Only Use For 1 Hour Chart
🔴 CONCLUSION
We believe that success lies in the association of the user with the indicator, opposed to many traders who have the perspective that the indicator itself can make them become profitable. The reality is much more complicated than that.
The aim is to provide an indicator comprehensive, customizable, and intuitive enough that any trader can be led to understand this truth and develop an actionable perspective of technical indicators as support tools for decision making.
🔴 RISK DISCLAIMER
Trading is risky & most day traders lose money. All content, tools, scripts, articles, & education provided by BitBell are purely for informational & educational purposes only. Past performance does not guarantee future results.
[Opening Range Breakout] S&R Strategy with Backtest (TSO) S&R Strategy with Backtest (TSO)
===========================================================================
===========================================================================
This indicator serves as a comprehensive full-cycle trading system, providing alerts at each stage of the trade, from opening to closure. The algorithm initiates by calculating the Opening/Pre-Market Price Range, waiting for a breakout to generate signals, and establishing TP (Take Profit and SL (Stop Loss) levels. The Opening/Pre-Market range, known for its robust support and resistance levels, is a key element. To filter out false breakouts and capture valid ones, the indicator incorporates a Smart Breakout feature, requiring confirmation through an initial breakout, a confirmation bounce, and a subsequent confirmation breakout. The indicator offers a variety of automated approaches for TP (Take-Profit) and SL (Stop-Loss) settings. These include leveraging opening range levels, both the most recent and historical S&R (Support and Resistance) levels, and an ATR (Average True Range) trailing stop-loss. This diverse set of tools ensure flexibility in tailoring TP (Take-Profit) and SL (Stop-Loss) parameters to different market conditions, contributing to a more adaptive and robust trading system. Additionally, a series of signal analysis tools, including candle bar analysis, divergence, and volume, enhance the precision of trading signals.
* Works with popular timeframes: 1M, 3M, 5M, 15M, 30M, 45M, 1H.
* Works best with Indices, Stocks, and Commodities, since there is pre-market price movement, which is used to obtain support and resistance price range.
* Every action of the trade is calculated on a confirmed closed candle bar state (barstate.isconfirmed), so the indicator will never repaint.
==============================================================
Indicator visual examples with various instruments:
---------------------------------------------------------------------------
Strategy Config: ORB_AAPL(NASDAQ)_15M
Example of Signal Cleanup confirmations via SMA and ATR. Take-Profit is calculated per optimal S&R (resistance) most recent levels.
---------------------------------------------------------------------------
Strategy Config: ORB_AMD(NASDAQ)_5M
Example of optimal S&R (resistance) level from previous day for Take-Profit 1 target, which gets hit.
---------------------------------------------------------------------------
Strategy Config: ORB_META(NASDAQ)_5M
Example of dynamic SL (Stop-Loss), which reduces the risk by moving to the new support level, which is at the same time is below the current price. Also Signal Cleanup confirmations via SMA, ATR and VWAP
---------------------------------------------------------------------------
Strategy Config: ORB_MSFT(NASDAQ)_15M
Example of automated ATR Trail Stop-Loss activation at no optimal S&R (support) feature.
---------------------------------------------------------------------------
Strategy Config: ORB_NFLX(NASDAQ)_3M
Example of a skipped LONG trade due to no optimal S&R (support) for Stop-Loss (can be seen per chart that it would be a loss trade). On another side, a SHORT SMA Confirmed trade hits all 3 profit targets.
---------------------------------------------------------------------------
Strategy Config: ORB_NVDA(NASDAQ)_15M
Example of no optimal support for SHORT Take-Profit targets, with ATR Trail Stop-Loss.
---------------------------------------------------------------------------
Strategy Config: ORB_SPY(AMEX)_15M
Example of several signal confirmations at the same time (SMA, VWAP, EWO) and S&R-TP-Entry-SL SL (Stop-Loss) system, which at trade open sets SL (Stop-Loss) per optimal S&R (since this is a LONG trade - support) and then moves to Entry at first take-profit.
===========================================================================
Trading open/close/TP/SL labels, plots and colors explanations:
---------------------------------------------------------------------------
>>> Opening/Pre-Market range: White dashed lines show opening range/pre-market levels with dotted white line extend along the Trading Schedule (if Trading Schedule is turned off - it will extend until next day).
>>> Smart Breakout: 1) Initial Breakout: "init_Brekout" | 2) Confirmation Bounce: "conf_Bounce" | 3) Confirmation Breakout: "conf_Breakout" (additional lables on chart can be hidden with only Confirmation Breakout shown).
>>> Additional S&R (Support and Resistance) lines: yellow - support, blue - resistance (can be hidden).
>>>>> LONG open: green "house" looking arrow below candle bar.
>>>>> SHORT open: red "house" looking arrow above candle bar.
>>>>> LONG/SHORT take-profit target: green/red circles (multi-profit > TP2/3/4/5 smaller circles).
>>>>> LONG/SHORT stop-loss target: green/red + crosses.
>>>>> LONG/SHORT take-profit hits: green/red diamonds.
>>>>> LONG/SHORT stop-loss hits: green/red X-crosses.
>>>>> LONG/SHORT EOD (End of Day | Intraday style) close (profitable trade): green/red squares.
>>>>> LONG/SHORT EOD (End of Day | Intraday style) close (loss trade): green/red PLUS(+)-crosses.
===========================================================================
STATS TABLE ///////////////////////////////////////////////////////////////
---------------------------------------------------------------------------
>>> Trading STATS table on the chart showing current trade direction, Last TP (Take-Profit) Taken, Current Trade PL (profit/loss in price difference from trade open to the very current state).
---------------------------------------------------------------------------
CUSTOM TRADING DATE RANGE /////////////////////////////////////////////////
---------------------------------------------------------------------------
>>>>> This feature can be used to manually set indicator trading range from and to a specific date and time. NOTE: This is not intended for a very long date range backtesting, utilize TradingView Strategy Tester for that.
* Use TradingView “Strategy Tester” to see Backtesting results
NOTE: If Strategy Tester does not show any results with Date Ranged fully unchecked, there may be an issue where a script opens a trade, but there is not enough TradingView power to set the Take-Profit and Stop-Loss and somehow an open trade gets stuck and never closes, so there are “no trades present”. In such case - manually check “Start”/“End” dates or use “Deep Backtesting” feature!
---------------------------------------------------------------------------
INTRADAY/TRADING SCHEDULE | ET (EASTERN TIMEZONE) ////////////////////////
---------------------------------------------------------------------------
>>> Trading Schedule - On/Off: This is where an Intraday Session or any custom session can be turned on and then scheduled.
>>>>> Trading Schedule - Time: Trade open Signals/Alerts time zone Hours. | NOTE: US Market Active Hours: 09:30 - 16:00 ET / Power Hour: 15:00 - 16:00 ET)
>>> Trading Schedule - EOD(End of Day) Close - On/Off: Close trade if still open by certain hour (set below).
>>>>> Trading Schedule - EOD(End of Day) Close - Hour (ET): US trading session closes at 4PM ET > 16:00.
Here is when the trade will close with EOD(End of Day) Close/Trading Cut Off Hour set to 16, which is end of US trading session:
1/3/5min > will close at 15:55pm ET
15min > will close at 15:45pm ET
30min > will close at 15:30pm ET
45min > will close at 15:45pm ET
60min > will close at 16:00pm ET
Here is when the trade will close with EOD(End of Day) Close/Trading Cut Off Hour set to 15, which is 1 hour before the end of US trading session (right before power hour starts):
1/3/5min > will close at 14:55pm ET
15min > will close at 14:45pm ET
30min > will close at 14:30pm ET
45min > will close at 14:45pm ET
60min > will close at 15:00pm ET
---------------------------------------------------------------------------
TRADE SIGNAL CONFIGURATION ////////////////////////////////////////////////
---------------------------------------------------------------------------
>>> Opening Range - Time Period (ET): Opening/Pre-Market Range time, which by default is set to US Session Pre-Market Range, can be customized to any time range as there are different market hours around the world and this setting can be customized to any time. Pre-Market Time/Price Range Hours(ET) | Pre-Market EU/Asia Hours: 4:00-9:30 ET | Pre-Market US (NY) Hours: 7:00-9:30 ET | Post-Market US Hours: 16:00-19:00 ET | First US Market Hour: 9:30-10:30 ET | Power Hour: 15:00-16:00)
>>> Opening Range - Levels Structure: determines how the price range is calculated, based on the highest/lowest price zones or based on the candle body bar.
>>> Opening Range - Breakout System: "Simple": bar close price has to simply break the opening range level | "Smart": After initial breakout (which is basically 'Simple' Breakout), a price come back is expected to the opening range level, a bounce, then a confirmation breakout with price closing ahead of the initial breakout.
>>>>> Opening Range - Smart Breakout: # of bars until Initial Breakout becomes invalid
>>>>> Opening Range - Smart Breakout: Bounce Settings, "Cross-Return" - LONG: Price has to cross down the initial breakout S&R, but never close below it; SHORT: Price has to cross up the initial breakout S&R, but then close above it; ||| "Cross-Close-Return" - LONG: At least 1 candle has to close below initial breakout S&R; SHORT: At least 1 candle has to close above initial breakout S&R.
>>>>> Alerts - Opening Range - Smart Breakout: Confirmation Bounce Alert. Trigger an alert at confirmation bounce. This is for live trading (especially scalping) Smart Breakout approach - to get ready to open the trade in the correct direction.
---------------------------------------------------------------------------
TAKE-PROFIT/STOP-LOSS CONFIGURATION ///////////////////////////////////////
---------------------------------------------------------------------------
>>> TP (Take-Profit) and SL (Stop-Loss): S&R Search - Left Bars: This setting is for calculating optimal S&R (Support and Resistance) levels (in combination with below - Right Bars) for S&R (Support and Resistance) TP (Take-Profit) levels calculations. NOTE: if at any point - there will be no available S&R (Support & Resistance) found for SL (Stop-Loss, 'S&R-Dynamic-SL' or 'S&R-Static-SL' setting, since both settings search for optimal SL (Stop-Loss) at trade open) or TP (Take-Profit, at any setting, since at trade open, an optimal TP (Take-Profit) level is searched) > SL (Stop-Loss) will automatically switch to trailing ATR-Trailing-SL and the trade will continue to run until it either hits ATR-Trailing-SL (Stop-Loss) or closes at EOD (End of Day).
>>> TP (Take-Profit) and SL (Stop-Loss): S&R Search - Right Bars: This setting is for calculating optimal S&R (Support and Resistance) levels (in combination with above - Left Bars) for S&R (Support and Resistance) TP (Take-Profit) levels calculations. NOTE: if at any point - there will be no available S&R (Support & Resistance) found for SL (Stop-Loss, 'S&R-Dynamic-SL' or 'S&R-Static-SL' setting, since both settings search for optimal SL (Stop-Loss) at trade open) or TP (Take-Profit, at any setting, since at trade open, an optimal TP (Take-Profit) level is searched) > SL (Stop-Loss) will automatically switch to trailing ATR-Trailing-SL and the trade will continue to run until it either hits ATR-Trailing-SL (Stop-Loss) or closes at EOD (End of Day).
>>> TP (Take-Profit) and SL (Stop-Loss): S&R Search - Custom Resolution: This is a custom timeframe setting specifically for S&R Search, it disregards current chart timeframe. This is great to use for scalping, for example: with main chart set to 1min and the custom timeframe set to 3min or 5min - there will be stronger support/resistance levels with more detailed price action.
>>> TP (Take-Profit) and SL (Stop-Loss): # of Bars (5000 max) to search back for optimal Support and Resistance levels: This is how many candles will be searched backwards for previous S&Rs (Support and Resistance) to find the optimal levels for TP (Take-Profit) and SL (Stop-Loss). NOTE: If SL (Stop-Loss) System is set to 'ATR-Trailing-SL' - this setting is only relevant for searching TP (Take-Profit) levels.
>>> TP (Take-Profit) and SL (Stop-Loss): At Trade Open - No S&R (Support and Resistance) found behavior: 'Skip Trade': If at trade open there are no S&R (Support and Resistance) levels for TP1 (Take-Profit 1) or SL (Stop-Loss) - trade is skipped. 'Open/ATR-Trailing-SL': If at trade open there are no S&R (Support and Resistance) levels for TP1 (Take-Profit 1) or SL (Stop-Loss), the trade will still be open with SL (Stop-Loss) set to 'ATR-Trailing-SL'.
>>> TP (Take-Profit) System: Pre-Market-Range-TP: All TP (Take-Profit) targets are calculated at trade open using the distance between Support and Resistance per Opening Pre-market Range and then divided by TP (Take-Profit) Divider, which can be set below; S&R-Current-Optimal-TP1: TP1 (Take-Profit) level is set per currently available S&R (Support & Resistance), if none available - historical S&R (Support & Resistance) levels will be searched, remaining TP (Take-Profit) targets (if selected, up to 5 # of TPs) are searched through most recent closest historical S&R (Support & Resistance) levels; S&R-Historic-Optimal-TP1: TP1 (Take-Profit) level is set per historically most recent closest available S&R (Support & Resistance) to the Entry price, remaining TP (Take-Profit) targets (if selected, up to 5 # of TPs) are searched through historical S&R (Support & Resistance) levels as well.
>>> TP (Take-Profit, Pre-Market-Range-TP) Divider #: This is for 'Pre-Market-Range-TP' setting only, where TP (Take-Profit) level is the distance between top/bottom levels of the opening range. It can be reduced by the divider #. (1 - full distance; 2 - 1/2 distance; 3 - 1/3 distance; etc.
>>> TP (Take-Profit) # of targets: It is wise to divide the trade into several profit targets. With this setting - up to 5 TP (Take-Profit) targets can be approached. The trade will be equally divided up by the selected # of TP (Take-Profit) targets.
>>> TP (Take-Profit) target(s) Consumed: Signal Bar consuming Take-Profits - trade signal bar is big enough to 'consume'/close ahead of the first TP setting > the signal can either be skipped, or all Take-Profit targets pushed ahead by average bar size).
>>> TP (Take-Profit) Offset - On/Off: This is a feature where TP (Take-Profit) target will be considered taken even if the price never crosses the target(s), but comes close enough (based on the offset amount). Set the offset amount below.
>>>>> TP (Take-Profit) Offset - Amount: Some Examples: (for SPY 0.1 would be $0.10 offset - if TP1 is $400 and price hits $399.90 > TP1 considered taken/signal shown/alert) | NOTE: For EURUSD, it is very different and if wrong will show TP1 immediately at trade open, typical good offset for EURUSD is: 0.0005 | Similar for BTCUSD, for example: 10 - $10 offset, if TP is $15,000 > $14,990.
>>> SL (Stop-Loss) System: 'Pre-Market-Range-SL': SL (Stop-Loss) is set to the opposite market range level from trade direction; 'S&R-Static-SL': SL (Stop-Loss) is set at trade open per optimal most recent S&R level and remains there until trade closes; 'S&R-Dynamic-SL': SL (Stop-Loss) is set at a trade open per optimal S&R (Support and Resistance) level from the most recent AND historical S&Rs (Support and Resistance), with every bar closed it will check if there are new S&Rs (Support and Resistance) levels, if these levels appear closer to the current price then current level - it will move SL (Stop-Loss) to that level, therefore reducing the risk; 'ATR-Trailing-SL': SL (Stop-Loss) is trail-following the ATR (Average True Range) line, NOTE: If at signal trigger, ATR will be against the trade direction - trade open signal will be skipped; 'S&R-TP-Entry-SL': SL (Stop-Loss) initially is set per S&R, then moves to Entry price at the very first TP (Take-Profit) hit and remains there until trade closes; 'S&R-TP-Trail-SL': SL (Stop-Loss) initially is set per S&R, then moves to Entry at TP1 (Take-Profit 1) hit, then keeps trailing per previously taken profit targets (TP2 taken, SL moves to TP1 | TP3 taken, SL moves to TP2 | TP4 taken, SL moves to TP3). NOTE: 'ATR-Trailing-SL' will not switch automatically if 'S&R-Dynamic-SL', S&R-TP-Entry-SL', 'S&R-TP-Trail-SL' system is selected, as already the most optimal SL (Stop-Loss) level is calculated - it will switch automatically only with 'S&R-Static-SL' system.
>>> SL (Stop-Loss) - On/Off: Without SL (Stop-Loss), unless EOD (End of Day) Close is turned on - there will be no SL (Stop-Loss) at all!
---------------------------------------------------------------------------
SIGNAL ANALYSIS AND CLEANUP ///////////////////////////////////////////////
---------------------------------------------------------------------------
>>> Signal Cleanup - Bar Color: Include Bar Color (bullish/bearish) confirmation, LONG signal will only be opened if signal bar is green/bullish, SHORT if red/bearish.
>>> Signal Cleanup - Bar Directional Structure: Skip opposite bar structure types signals (For example: bearish green hammer).
>>> Signal Cleanup - Bar Doji Skip: Skip doji (indecisive) candles signals.
>>> Signal Cleanup - EWO (Elliott Wave Oscillator): Include EWO (Elliott Wave Oscillator), LONG will only be opened if EWO is bullish / SHORT if EWO is bearish.
>>> Signal Cleanup - VWAP (Volume-Weighted Average Price): Include VWAP (Volume-Weighted Average Price), LONG will only be opened if price is above VWAP / SHORT if price is below VWAP.
>>> Signal Cleanup - MA (Moving Average) Confirmation: Include MA (Moving Average), LONG will only be opened if MA is bullish / SHORT if MA is bearish.
>>> Signal Cleanup - ATR (Average True Range): Include ATR (Average True Range) confirmation, LONG will only be opened if ATR is bullish / SHORT if ATR is bearish.
>>> Signal Cleanup - Divergence(RSI + MACD): Include Divergence (RSI + MACD ) confirmation, LONG will only be opened if Divergence is bullish / SHORT if Divergence is bearish.
>>> Signal Cleanup - Volume % Strength: Include Volume strength/percentage confirmation, LONG/SHORT will only be opened with strong Volume matching the signal direction | By default, strong Volume percentage is set to 150% and weak to 50%.
>>> Signal Cleanup - Volume Above Average: Include Volume Above Moving Average (Volume closing bar closes above volume moving average) confirmation, LONG/SHORT will only be opened with Volume above average - Volume closed bar color must match the closed price color (bullish/bearish direction) + Volume bar must be closed above volume MA line).
---------------------------------------------------------------------------
===========================================================================
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
TP System - VERY IMPORTANT INFO!
-------------------------------------------------------------------------------------------------------------------
"TP PERCENTAGE" - amount by which current trade/position needs to be reduced/partially closed/sold.
-------------------------------------------------------------------------------------------------------------------
TP System: Dynamic
"TP PERCENTAGE" - will always be the same amount (trade/position size divided by the # of take-profit(TP) targets) and percentage to be closed will always be of the ORIGINAL trade/position.
-------------------------------------------------------------------------------------------------------------------
TP System: Static
"TP PERCENTAGE" - will always be the same amount IF take-profit(TP) targets are hit 1-by-1 (TP1 > TP2 > TP3 > TP4 > TP5), otherwise it will vary and unless it is a 1st take-profit(TP1), the REMAINING trade/position size will always be smaller than original and therefore the percentage to be closed will always be of the REMAINING trade/position and NOT the original one!
-------------------------------------------------------------------------------------------------------------------
"TP PERCENTAGE" CheatSheet (these are the only percentages you may see)
-----------------------------------------------------------------------
TP PERCENTAGE---Close/Sell Amount-------------Example (trade size: 50 stocks)
20%-------------trade size * 0.2--------------50 * 0.2 = 10 stocks
25%-------------trade size * 0.25-------------50 * 0.25 = 12.5(~13) stocks
34%-------------trade size * 0.34-------------50 * 0.34 = 17 stocks
40%-------------trade size * 0.4--------------50 * 0.4 = 20 stocks
50%-------------trade size * 0.5--------------50 * 0.5 = 25 stocks
60%-------------trade size * 0.6--------------50 * 0.6 = 30 stocks
66%-------------trade size * 0.66-------------50 * 0.66 = 33 stocks
75%-------------trade size * 0.75-------------50 * 0.75 = 37.5(~38) stocks
80%-------------trade size * 0.8--------------50 * 0.8 = 40 stocks
100%------------trade size--------------------50 = 50 stocks
-----------------------------------------------------------------------
If for any reason a portion of the current/remaining trade closed at such occurrence was slightly wrong, it is not an issue. Such occurrences are rare and with slight difference in partial TP closed is not significant to overall performance of our algorithms.
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||| *** ||||||||||||||||||||||||||||||||||| *** |||||||||||||||||||||||||||||||||||
===========================================================================
Alert Settings (you don’t have to touch this section unless you will be using TradingView alerts through a Webhook to use with trading bot)
---------------------------------------------------------------------------
Here is how a LONG OPEN alert looks like.
NOTE: Each label , , etc. is customizable, you can change the text of it within indicator Input settings.
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
LONG: OPEN
ENTRY: 20000
TP1: 20500
TP2: 21000
TP3: 21500
TP4: 22500
TP5: 23500
SL: 19000
Leverage: 0
---------------------------------------------------------------------------
Here is how a TP1 alert will look with 5 TPs breakdown of the trade.
NOTE1: Next to TP1 taken it will show at which price it was triggered.
NOTE2: Next to "TP Percentage" it shows how much of the CURRENT/ACTIVE/REMAINING trade needs to be closed.
NOTE2: If TP2/3/4/5 comes before TP1 - the alert will tell you exactly how many percent of the trade needs to be closed!
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
LONG: TP1
TP1: 20500
TP Percentage: 20%
---------------------------------------------------------------------------
Here is how an alert will look for LONG - STOP-LOSS.
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
ENTRY: 20000
LONG: SL
SL: 19000
---------------------------------------------------------------------------
Here is how an alert will look for LONG - EOD (End of Day) In Profit close.
ALERT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
COIN: BTCUSD
TIMEFRAME: 15M
LONG: EOD-Close (profit)
ENTRY: 20000
EOD-Close: 21900
===========================================================================
Adding Alerts in TradngView
---------------------------------------------------------------------------
-Add indicator to chart and make sure the correct strategy is configured (check Backtesting results)
-Right-click anywhere on the TradingView chart
-Click on Add alert
-Condition: Select this indicator by it’s name
-Immediately below, change it to "alert() function calls only", as other wise there will be 2 alerts for every alert!
-Expiration: Open-ended (that may require higher tier TradingView account, otherwise the alert will need to be occasionally re-triggered)
-Alert name: Whatever you desire
-Hit “Create”
-Note: If you change ANY Settings within the indicator – you must DELETE the current alert and create a new one per steps above, otherwise it will continue triggering alerts per old Settings!
===========================================================================
If you have any questions or issues with the indicator, please message me directly via TradingView.
---------------------------------------------------------------------------
Good Luck! (NOTE: Trading is very risky, past performance is not necessarily indicative of future results, so please trade responsibly!)
---------------------------------------------------------------------------
NOTE: There seems to be a strange glitch when strategy is running live, it will show "double-take" take-profits labels on the chart. This is not affecting the script logic and backtesting results, if you simply change the timeframe real quick to something else then back - it will no longer show the duplicate orders... this must be some sort of a glitch as every alert was thoroughly tested to make sure everything is working!
Session Breakout Scalper Trading BotHi Traders !
Introduction:
I have recently been exploring the world of automated algorithmic trading (as I prefer more objective trading strategies over subjective technical analysis (TA)) and would like to share one of my automation compatible (PineConnecter compatible) scripts “Session Breakout Scalper”.
The strategy is really simple and is based on time conditional breakouts although has more ”relatively” advanced optional features such as the regime indicators (Regime Filters) that attempt to filter out noise by adding more confluence states and the ATR multiple SL that takes into account volatility to mitigate the down side risk of the trade.
What is Algorthmic Trading:
Firstly what is algorithmic trading? Algorithmic trading also known as algo-trading, is a method of using computer programs (in this case pine script) to execute trades based on predetermined rules and instructions (this trading strategy). It's like having a robot trader who follows a strict set of commands to buy and sell assets automatically, without any human intervention.
Important Note:
For Algorithmic trading the strategy will require you having an essential TV subscription at the minimum (so that you can set alerts) plus a PineConnecter subscription (scroll down to the .”How does the strategy send signals” headings to read more)
The Strategy Explained:
Is the Time input true ? (this can be changed by toggling times under the “TRADE MEDIAN TIMES” group for user inputs).
Given the above is true the strategy waits x bars after the session and then calculates the highest high (HH) to lowest low (LL) range. For this box to form, the user defined amount of bars must print after the session. The box is symmetrical meaning the HH and LL are calculated over a lookback that is equal to the sum of user defined bars before and after the session (+ 1).
The Strategy then simultaneously defines the HH as the buy level (green line) and the LL as the sell level (red line). note the strategy will set stop orders at these levels respectively.
Enter a buy if price action crosses above the HH, and then cancel the sell order type (The opposite is true for a stop order).
If the momentum based regime filters are true the strategy will check for the regime / regimes to be true, if the regime if false the strategy will exit the current trade, as the regime filter has predicted a slowing / reversal of momentum.
The image below shows the strategy executing these trading rules ( Regime filters, "Trades on chart", "Signal & Label" and "Quantity" have been omitted. "Strategy label plots" has been switched to true)
Other Strategy Rules:
If a new session (time session which is user defined) is true (blue vertical line) and the strategy is currently still in a trade it will exit that trade immediately.
It is possible to also set a range of percentage gain per day that the strategy will try to acquire, if at any point the strategy’s profit is within the percentage range then the position / trade will be exited immediately (This can be changed in the “PERCENT DAY GAIN” group for user inputs)
Stops and Targets:
The strategy has either static (fixed) or variable SL options. TP however is only static. The “STRAT TP & TP” group of user inputs is responsible for the SL and TP values (quoted in pips). Note once the ATR stop is set to true the SL values in the above group no longer have any affect on the SL as expected.
What are the Regime Filters:
The Larry Williams Large Trade Index (LWLTI): The Larry Williams Large Trade Index (LWTI) is a momentum-based technical indicator developed by iconic trader Larry Williams. It identifies potential entries and exits for trades by gauging market sentiment, particularly the buying and selling pressure from large market players. Here's a breakdown of the LWTI:
LWLTI components and their interpretation:
Oscillator: It oscillates between 0 and 100, with 50 acting as the neutral line.
Sentiment Meter: Values above 75 suggest a bearish market dominated by large selling, while readings below 25 indicate a bullish market with strong buying from large players.
Trend Confirmation: Crossing above 75 during an uptrend and below 25 during a downtrend confirms the trend's continuation.
The Andean Oscillator (AO) : The Andean Oscillator is a trend and momentum based indicator designed to measure the degree of variations within individual uptrends and downtrends in the prices.
Regime Filter States:
In trading, a regime filter is a tool used to identify the current state or "regime" of the market.
These Regime filters are integrated within the trading strategy to attempt to lower risk (equity volatility and/or draw down). The regime filters have different states for each market order type (buy and sell). When the regime filters are set to true, if these regime states fail to be true the trade is exited immediately.
For Buy Trades:
LWLTI positive momentum state: Quotient of the lagged trailing difference and the ATR > 50
AO positive momentum state: Bull line > Bear line (signal line is omitted)
For Sell Trades:
LWLTI negative momentum stat: Quotient of the lagged trailing difference and the ATR < 50
AO negative momentum state: Bull line < Bear line (signal line is omitted)
How does the Strategy Send Signals:
The strategy triggers a TV alert (you will neet to set a alert first), TV then sends a HTTP request to the automation software (PineConnecter) which receives the request and then communicates to an MT4/5 EA to automate the trading strategy.
For the strategy to send signals you must have the following
At least a TV essential subscription
This Script added to your chart
A PineConnecter account, which is paid and not free. This will provide you with the expert advisor that executes trades based on these strategies signals.
For more detailed information on the automation process I would recommend you read the PineConnecter documentation and FAQ page.
Dashboard:
This Dashboard (top right by defualt) lists some simple trading statistics and also shows when a trade is live.
Important Notice:
- USE THIS STRATEGY AT YOUR OWN RISK AND ALWAYS DO YOUR OWN RESEARCH & MANUAL BACKTESTING !
- THE STRATEGY WILL NOT EXHIBIT THE BACKTEST PERFORMANCE SEEN BELOW IN ALL MARKETS !
MACD of Relative Strenght StrategyMACD Relative Strenght Strategy :
INTRODUCTION :
This strategy is based on two well-known indicators: MACD and Relative Strenght (RS). By coupling them, we obtain powerful buy signals. In fact, the special feature of this strategy is that it creates an indicator from an indicator. Thus, we construct a MACD whose source is the value of the RS. The strategy only takes buy signals, ignoring SHORT signals as they are mostly losers. There's also a money management method enabling us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
RELATIVE STRENGHT :
RS is an indicator that measures the anomaly between momentum and the assumption of market efficiency. It is used by professionals and is one of the most robust indicators. The idea is to own assets that do better than average, based on their past performance. We calculate RS using this formula :
RS = close/highest_high(RS_Length)
Where highest_high(RS_Length) = highest value of the high over a user-defined time period (which is the RS_Length).
We can thus situate the current price in relation to its highest price over this user-defined period.
MACD (Moving Average Convergence - Divergence) :
This is one of the best-known indicators, measuring the distance between two exponential moving averages : one fast and one slower. A wide distance indicates fast momentum and vice versa. We'll plot the value of this distance and call this line macdline. The MACD uses a third moving average with a lower period than the first two. This last moving average will give a signal when it crosses the macdline. It is therefore constructed using the values of the macdline as its source.
It's important to note that the first two MAs are constructed using RS values as their source. So we've just built an indicator of an indicator. This kind of method is very powerful because it is rarely used and brings value to the strategy.
PARAMETERS :
RS Length : Relative Strength length i.e. the number of candles back to find the highest high and compare the current price with this high. Default is 300.
MACD Fast Length : Relative Strength fast EMA length used to plot the MACD. Default is 14.
MACD Slow Length : Relative Strength slow EMA length used to plot the MACD. Default is 26.
MACD Signal Smoothing : Macdline SMA length used to plot the MACD. Default is 10.
Max risk per trade (in %) : The maximum loss a trade can incur (in percentage of the trade value). Default is 8%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. Default is 400, meaning that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:ETHUSD in 8h timeframe with the parameters set by default.
ENTER RULES :
The entry rules are very simple : we open a long position when the MACD value turns positive. You are therefore LONG when the MACD is green.
EXIT RULES :
We exit a position (whether losing or winning) when the MACD becomes negative, i.e. turns red.
RISK MANAGEMENT :
This strategy can incur losses, so it's important to manage our risks well. If the position is losing and has incurred a loss of -8%, our stop loss is activated to limit losses.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
Enjoy the strategy and don't forget to take the trade :)
Bollinger Bands StrategyBollinger Bands Strategy :
INTRODUCTION :
This strategy is based on the famous Bollinger Bands. These are constructed using a standard moving average (SMA) and the standard deviation of past prices. The theory goes that 90% of the time, the price is contained between these two bands. If it were to break out, this would mean either a reversal or a continuation. However, when a reversal occurs, the movement is weak, whereas when a continuation occurs, the movement is substantial and profits can be interesting. We're going to use BB to take advantage of this strong upcoming movement, while managing our risks reasonably. There's also a money management method for reinvesting part of the profits or reducing the size of orders in the event of substantial losses.
BOLLINGER BANDS :
The construction of Bollinger bands is straightforward. First, plot the SMA of the price, with a length specified by the user. Then calculate the standard deviation to measure price dispersion in relation to the mean, using this formula :
stdv = (((P1 - avg)^2 + (P2 - avg)^2 + ... + (Pn - avg)^2) / n)^1/2
To plot the two Bollinger bands, we then add a user-defined number of standard deviations to the initial SMA. The default is to add 2. The result is :
Upper_band = SMA + 2*stdv
Lower_band = SMA - 2*stdv
When the price leaves this channel defined by the bands, we obtain buy and sell signals.
PARAMETERS :
BB Length : This is the length of the Bollinger Bands, i.e. the length of the SMA used to plot the bands, and the length of the price series used to calculate the standard deviation. The default is 120.
Standard Deviation Multipler : adds or subtracts this number of times the standard deviation from the initial SMA. Default is 2.
SMA Exit Signal Length : Exit signals for winning and losing trades are triggered by another SMA. This parameter defines the length of this SMA. The default is 110.
Max Risk per trade (in %) : It's the maximum percentage the user can lose in one trade. The default is 6%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, meaning that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:BTCUSD in 8h timeframe with the following parameters :
BB Length = 120
Standard Deviation Multipler = 2
SMA Exit Signal Length = 110
Max Risk per trade (in %) = 6%
ENTER RULES :
The entry rules are simple:
If close > Upper_band it's a LONG signal
If close < Lower_band it's a SHORT signal
EXIT RULES :
If we are LONG and close < SMA_EXIT, position is closed
If we are SHORT and close > SMA_EXIT, the position is closed
Positions close automatically if they lose more than 6% to limit risk
RISK MANAGEMENT :
This strategy is subject to losses. We manage our risk using the exit SMA or using a SL sets to 6%. This SMA gives us exit signals when the price closes below or above, thus limiting losses. If the signal arrives too late, the position is closed after a loss of 6%.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the fixed ratio value, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
NOTE :
Please note that the strategy is backtested from 2017-01-01. As the timeframe is 8h, this strategy is a medium/long-term strategy. That's why only 51 trades were closed. Be careful, as the test sample is small and performance may not necessarily reflect what may happen in the future.
Enjoy the strategy and don't forget to take the trade :)
Rate of Change StrategyRate of Change Strategy :
INTRODUCTION :
This strategy is based on the Rate of Change indicator. It compares the current price with that of a user-defined period of time ago. This makes it easy to spot trends and even speculative bubbles. The strategy is long term and very risky, which is why we've added a Stop Loss. There's also a money management method that allows you to reinvest part of your profits or reduce the size of your orders in the event of substantial losses.
RATE OF CHANGE (ROC) :
As explained above, the ROC is used to situate the current price compared to that of a certain period of time ago. The formula for calculating ROC in relation to the previous year is as follows :
ROC (365) = (close/close (365) - 1) * 100
With this formula we can find out how many percent the change in the current price is compared with 365 days ago, and thus assess the trend.
PARAMETERS :
ROC Length : Length of the ROC to be calculated. The current price is compared with that of the selected length ago.
ROC Bubble Signal : ROC value indicating that we are in a bubble. This value varies enormously depending on the financial product. For example, in the equity market, a bubble exists when ROC = 40, whereas in cryptocurrencies, a bubble exists when ROC = 150.
Stop Loss (in %) : Stop Loss value in percentage. This is the maximum trade value percentage that can be lost in a single trade.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, which means that for each $400 gain or loss, the order size is increased or decreased by an amount chosen by the user.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:BTCUSD in 1D timeframe with the following parameters :
ROC Length = 365
ROC Bubble Signal = 180
Stop Loss (in %) = 6
LONG CONDITION :
We are in a LONG position if ROC (365) > 0 for at least two days. This allows us to limit noise and irrelevant signals to ensure that the ROC remains positive.
SHORT CONDITION :
We are in a SHORT position if ROC (365) < 0 for at least two days. We also open a SHORT position when the speculative bubble is about to burst. If ROC (365) > 180, we're in a bubble. If the bubble has been in existence for at least a week and the ROC falls back below this threshold, we can expect the asset to return to reasonable prices, and thus a downward trend. So we're opening a SHORT position to take advantage of this upcoming decline.
EXIT RULES FOR WINNING TRADE :
The strategy is self-regulating. We don't exit a LONG trade until a SHORT signal has arrived, and vice versa. So, to exit a winning position, you have to wait for the entry signal of the opposite position.
RISK MANAGEMENT :
This strategy is very risky, and we can easily end up on the wrong side of the trade. That's why we're going to manage our risk with a Stop Loss, limiting our losses as a percentage of the trade's value. By default, this percentage is set at 6%. Each trade will therefore take a maximum loss of 6%.
If the SL has been triggered, it probably means we were on the wrong side. This is why we change the direction of the trade when a SL is triggered. For example, if we were SHORT and lost 6% of the trade value, the strategy will close this losing trade and open a long position without taking into account the ROC value. This allows us to be in position all the time and not miss the best opportunities.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
NOTE :
Please note that the strategy is backtested from 2017-01-01. As the timeframe is 1D, this strategy is a medium/long-term strategy. That's why only 34 trades were closed. Be careful, as the test sample is small and performance may not necessarily reflect what may happen in the future.
Enjoy the strategy and don't forget to take the trade :)
RSI & Backed-Weighted MA StrategyRSI & MA Strategy :
INTRODUCTION :
This strategy is based on two well-known indicators that work best together: the Relative Strength Index (RSI) and the Moving Average (MA). We're going to use the RSI as a trend-follower indicator, rather than a reversal indicator as most are used to. To the signals sent by the RSI, we'll add a condition on the chart's MA, filtering out irrelevant signals and considerably increasing our winning rate. This is a medium/long-term strategy. There's also a money management method enabling us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
RSI :
The RSI is one of the best-known and most widely used indicators in trading. Its purpose is to warn traders when an asset is overbought or oversold. It was designed to send reversal signals, but we're going to use it as a trend indicator by increasing its length to 20. The RSI formula is as follows :
RSI (n) = 100 - (100 / (1 + (H (n)/L (n))))
With n the length of the RSI, H(n) the average of days closing above the open and L(n) the average of days closing below the open.
MA :
The Moving Average is also widely used in technical analysis, to smooth out variations in an asset. The SMA formula is as follows :
SMA (n) = (P1 + P2 + ... + Pn) / n
where n is the length of the MA.
However, an SMA does not weight any of its terms, which means that the price 10 days ago has the same importance as the price 2 days ago or today's price... That's why in this strategy we use a RWMA, i.e. a back-weighted moving average. It weights old prices more heavily than new ones. This will enable us to limit the impact of short-term variations and focus on the trend that was dominating. The RWMA used weights :
The 4 most recent terms by : 100 / (4+(n-4)*1.30)
The other oldest terms by : weight_4_first_term*1.30
So the older terms are weighted 1.30 more than the more recent ones. The moving average thus traces a trend that accentuates past values and limits the noise of short-term variations.
PARAMETERS :
RSI Length : Lenght of RSI. Default is 20.
MA Type : Choice between a SMA or a RWMA which permits to minimize the impact of short term reversal. Default is RWMA.
MA Length : Length of the selected MA. Default is 19.
RSI Long Signal : Minimum value of RSI to send a LONG signal. Default is 60.
RSI Short signal : Maximum value of RSI to send a SHORT signal. Default is 40.
ROC MA Long Signal : Maximum value of Rate of Change MA to send a LONG signal. Default is 0.
ROC MA Short signal : Minimum value of Rate of Change MA to send a SHORT signal. Default is 0.
TP activation in multiple of ATR : Threshold value to trigger trailing stop Take Profit. This threshold is calculated as multiple of the ATR (Average True Range). Default value is 5 meaning that to trigger the trailing TP the price need to move 5*ATR in the right direction.
Trailing TP in percentage : Percentage value of trailing Take Profit. This Trailing TP follows the profit if it increases, remaining selected percentage below it, but stops if the profit decreases. Default is 3%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. Default is 400, which means that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:ETHUSD with a timeframe set to 6h. Parameters are set as follows :
MA type: RWMA
MA Length: 19
RSI Long Signal: >60
RSI Short Signal : <40
ROC MA Long Signal : <0
ROC MA Short Signal : >0
TP Activation in multiple ATR : 5
Trailing TP in percentage : 3
ENTER RULES :
The principle is very simple:
If the asset is overbought after a bear market, we are LONG.
If the asset is oversold after a bull market, we are SHORT.
We have defined a bear market as follows : Rate of Change (20) RWMA < 0
We have defined a bull market as follows : Rate of Change (20) RWMA > 0
The Rate of Change is calculated using this formula : (RWMA/RWMA(20) - 1)*100
Overbought is defined as follows : RSI > 60
Oversold is defined as follows : RSI < 40
LONG CONDITION :
RSI > 60 and (RWMA/RWMA(20) - 1)*100 < -1
SHORT CONDITION :
RSI < 40 and (RWMA/RWMA(20) - 1)*100 > 1
EXIT RULES FOR WINNING TRADE :
We have a trailing TP allowing us to exit once the price has reached the "TP Activation in multiple ATR" parameter, i.e. 5*ATR by default in the profit direction. TP trailing is triggered at this point, not limiting our gains, and securing our profits at 3% below this trigger threshold.
Remember that the True Range is : maximum(H-L, H-C(1), C-L(1))
with C : Close, H : High, L : Low
The Average True Range is therefore the average of these TRs over a length defined by default in the strategy, i.e. 20.
RISK MANAGEMENT :
This strategy may incur losses. The method for limiting losses is to set a Stop Loss equal to 3*ATR. This means that if the price moves against our position and reaches three times the ATR, we exit with a loss.
Sometimes the ATR can result in a SL set below 10% of the trade value, which is not acceptable. In this case, we set the SL at 10%, limiting losses to a maximum of 10%.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
Enjoy the strategy and don't forget to take the trade :)
Narrow Range StrategyNarrow Range Strategy :
INTRODUCTION :
This strategy is based on the Narrow Range Day concept, implying that low volatility will generate higher volatility in the days ahead. The strategy sends us buy and sell signals with well-defined profit targets. It's a medium/long-term strategy. There's also a money management method that allows us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
NARROW RANGE (NR) DAY :
A Narrow Range Day is a day in which price variations are included in those of a specific day some time before. The high and low of this specific day form the "reference range". In general, we compare these variations with those of 4 or 7 days ago. The mathematical formula for finding an NR4 is :
If low > low(4) and high < high(4) :
nr = true
This implies that the current low is greater than the low of 4 days ago, and the current high is smaller than the high of 4 days ago. So today's volatility is lower than that of 4 days ago, and may be a sign of high volatility to come.
PARAMETERS :
Narrow Range Length : Corresponds to the number of candles back to compare current volatility. The default is 4, allowing comparison of current volatility with that of 4 candles ago.
Stop Loss : Percentage of the reference range on which to set an exit order to limit losses. The minimum value is 0.001, while the maximum is 1. The default value is 0.35.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, which means that for each $400 gain or loss, the order size is increased or decreased by an amount chosen by the user.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot was used to test NR4 and NR7 with all possible Stop Losses in order to find out which combination generates the highest return on BITSTAMP:ETHUSD while limiting the drawdown. This strategy is the most optimal with an NR4 and a SL of 35% of the reference range size in 5D timeframe.
BUY AND SHORT SIGNALS :
When an NR is spotted, we create two stop orders on the high and low of the reference range. As soon as there's a breakout from this reference range (shown in blue on the chart), we open a position. We're LONG if there's a breakout on the high and SHORT if there's a breakout on the low. Executing a stop order cancels the second stop order.
RISK MANAGEMENT :
This strategy is subject to losses. We manage our risk with Stop Losses. The user is free to enter a SL as a percentage of the reference range. The maximum amount risked per trade therefore depends on the size of the range. The larger the range, the greater the risk. That's why we have set a maximum Stop Loss to 10% to limiting risks per trade.
The special feature of this strategy is that it targets a precise profit objective. This corresponds to the size of the reference range at the top of the high if you're LONG, or at the bottom of the low if you're short. In the same way, the larger the reference range, the greater the potential profits.
The risk reward remains the same for all trades and amounts to : 100/35 = 2.86. If the reference range is too high, we have set a SL to 10% of the trade value to limit losses. In that case, the risk reward is less than 2.86.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
NOTE :
Please note that the strategy is backtested from 2017-01-01. As the timeframe is 5D, this strategy is a medium/long-term strategy. That's why only 37 trades were closed. Be careful, as the test sample is small and performance may not necessarily reflect what may happen in the future.
Enjoy the strategy and don't forget to take the trade :)
Indian NIFTY Correlation Daytrade/Swing StrategyINTRODUCTION :
This is a daytrading/swing strategy designed mainly for indian market where internally has been adapted to NIFTY market and as well using for internal calculations the values of the candles from NIFTY asset.
With it we search to use with the most correlated asset from the indian market.
For this example I choosed BANKNIFTY
STRATEGY:
The strategy initially uses as candle values the data from the NIFTY asset.
With them I am dividing the work into two calculation parts such as :
-For first part logic, I am doing calculations regarding the volatility of NIFTY, where I initially take into consideration INDIAVIX to have an idea of the expected implied volatility of NIFTY asset and then I compare it with different tools such as ATR, BB and Percentile location of the volatility.
Based on all these factors I take into account the location of the volatility which is atm and if there is a possibility of a strong movement(trend) or sidemarket situation.
-Once I am done with the values of the volatility, the next process in the script logic is to start looking into the trend.
For it I am using different tools such as volume checker, support and resistence key points, pivot points, price actions patterns and different moving averages.
-Risk management part : once we are done with calculation for the entry, the next part is to have an idea where to exit. In this case I am making use of a dynamic risk management which is compressed from multiple ideas such as : we can exit if there were a big gap on the next day in our initial direction, we can also exit based of an internal daily ATR calculation value(we use initially 15min timeframe chart) and lastly if we are around some key points like support/resistence or other different chart patterns like double top, double bot and so on.
CASE EXAMPLE:
As I said before we are initially using for calculation the NIFTY chart with 15min timeframe. With it we can apply to any indian etf,stocks,future. All the assets are going to have the same time of entry and the same time of exit(we get this from NIFTY) and we plot it on the chart we are using, so its key point to look for assets which have a min 75-80% correlation with NIFTY. For this example I used BANKNIFTY chart.
So a type of entry would be this way
Lets assume NIFTY50 is on 19.000 level
INDIAVIX level is currently at 11 which can be translated : 11 / sqrt(250)
So 11 means that on a yearly base we expect the asset to move 11% upwards or downwards
and in a year we have aprox 250 days. So we divide the 11 by sqrt of 250 to get an idea of a daily expected move from the implied volatility of india VIX
11/15.87 = +-0.69%
So INDIAVIX tells us that the values for today nifty is 19000+0,69% and 19000-0.69%
After that I am looking into the daily ATR, and I see that the expected is around 0.8% and is ascending over the last 2 weeks.
Lastly I am looking at the percentile which is currently the volatility on both ATR and INDIAVIX, and I get a value of 90th percentile.
With this my biased is that we are going to expect a short trend, but i cant confirm on the volatility alone so next step is start looking into technical analysis.
I look at volume and is increasing, I look at different price actions paterns and pivots and I see a lower low and a lower high (a descending pattern).
I also see the price is below the key MA like SMA50/100/200, VWAP and so on.
With all of this I get more confirmation that the asset is in a short trend.
Internally once a certain specific % of confirmation from all the logics is achieved, it will trigger a long/short entry, so in this case lets assume we have 80% of our indicators pointing to the short, is going to enter a short.
Now for a long scenario the scene would be , indiavix is around 9,5, ATR is descending. We are around 40th percentile of the volatility.
Our asset is above multiple moving averages, vwap , etc
We have an increasing volume towards bullish side.
And so on( overall 75% of our indicators are pointing towards the long side)
Now for the exit, since we are dealing with a daytrade/swing mentality, short on average we keep the trade open for a less period of time than long ( 19 bars of 15min candles, compared to 57 bars of 15min for long) , so most of the times for short we are going to exit next day and if the trend is still in our favour we re enter the trade.
For long we can stay much more time, sometimes even weeks and we exit mainly when the % of confirmation of indicators point out a reversal/short confirmation fo a big pice action pattern.
STRATEGY RESULTS
For strategy analysis I have used BANKNIFTY NSE with deep history to get access to data from 2011 until present( giving more than 2500 trades) .
For inputs I am using 0.02% comission total ( the comission applied from ZERODHA indian exchange is close to 0.0175% total) so I used it a bit higher in order to take into account some slippages.
For capital THE REASON I USED 100% of the capital allocation is to make a proper comparison with the buy an hold from the same period
Lets assume we had an account of 1M ruppes initially in 2011, we start using 100% of it and then the new values automatically compounded with the new profits and losses so directly compare with 1M of rupees in shares on BANKNIFTY ETFs bought in 2011(buy n hold) until present day.
STRATEGY ACCESS
Strategy is free to be tested for everyone, just let me know in private that you wish to get access to it.
Renko StrategyRENKO STRATEGY
CAUTION : This strategy must be applied to a candlestick chart (not a Renko chart).
INTRODUCTION :
The Traditional Renko chart has been reproduced and is plotted according to the evolution of the price. It will enable us to receive buy or sell signals and follow major trends. This is a medium/long term strategy and depends a lot on the box size chosen in the parameters. There's also a money management method allowing us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
RENKO CHART :
Renko chart construction methodology :
The user must first choose the box size. The minimum is 0.00001 and there is no maximum. The default is 10. The user must then choose the source that will define the data on which the calculations will be based (high, low, open, close). By default, close is selected. The first candle on the chart is used to draw the first box with its high and low.
Each time the price changes by the amount of the box size relative to the high or low of the last box, a new box is added above or below the previous one. If price variations are less than the box size, the same box is added next to the previous one. If price variations are N (integer number) times greater than box size, N boxes are added above or below the previous one. Each box added above the previous one is a green box, while each box added below the previous one is a red box.
Conditions for drawing a green box above the previous one :
(source - high_of_the_last_box) / box_size > 1
Condition for drawing a red box below the previous one :
(low_of_the_last_box - source) / box_size > 1
If neither condition is triggered, the same box is drawn next to the previous one.
Example :
The last candle has drawn a box with low 12 and high 14. The box size is therefore 2. The strategy will look at the value of the close each time a candle ends. The current candle closes with a close equal to 15.5. As the variation from the previous high is only 1.5 (which is less than the box size), the same box is added next to the previous one. The next candle closes at 16.2. The price variation is therefore 2.2 compared with the previous high. We can now add a new green box just above the previous one, with a low of 14 and a high of 16. The same process applies if the candle's close is at least one box size below the low of the last box. In this case, a new red box is placed below the previous one.
PARAMETERS :
Source : Allows you to specify which data will be taken into account by the strategy when performing calculations. The default is close.
Box size : Size of Renko graph boxes. This is a very important parameter to choose carefully, as it has a strong impact on the strategy's performance. Defaults to 10.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, meaning that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test all possible box sizes to find out which one generates the highest return on BITSTAMP:LTCUSD while limiting the drawdown. This strategy is the most optimal with a box size equal to 5.08 in 8h timeframe.
BUY AND SHORT SIGNALS :
As the aim of this strategy is to follow major trends based on price movements, we need to be on the right side of price fluctuation. We trade every box reversal, i.e. we are LONG when the boxes are green indicating an uptrend and SHORT when they are red indicating a downtrend.
RISK MANAGEMENT :
This strategy can incur losses. The size of the box is decisive, as it is used to plot the RENKO chart and thus trigger buy or sell signals. It's also what allows us to manage risk. For every trade, we risk a maximum amount equal to 2 times the size of the box, i.e. :(5.08*2*nb_contract)/trade_value.
MONEY MANAGEMENT :
The fixed ratio method has been used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy not only increases our performance, but also our drawdown.
Enjoy the strategy and don't forget to take the trade :)
SpiceIn the chart photo is a description for each shape and letter, saying what each one is.
BB, Reversals are off by default.
BB + Reversals + Next bar confirmation - The way this should be used is by waiting for a 1 or 2 bar confirmation closed above/below the high/low of the Reversal candle. So if its a Top R, a yellow box will print as a confirmed 1 bar if it closed below the top R's low, then you can wait for the second bar to close also below the Top R's low. Vice versa with the Bot R.
RSI arrows - Essentially showing you when the multi time frame RSIs are coming back up above 30, or below 70. Respective to what time frames you have selected.
Three Line Strike - A trend continuation candlestick pattern consisting of four candles
Leledc Exhaustion suggest the trend may be reversing. Combined with the moving average as a trend filter, the indicator can signal the end of a pull back and the continuation of the trend.
EMAs - Help measuring the trend direction over a period of time.
Credit to all these amazing creators -
Multi Timeframe RSI (LTF) by @millerrh
3 Line Strike by @Lij_MC 'MarketVision A'
Leledc Exhaustion by @glaz, used updated version by @Joy_Bangla
If anyone uses the BB reversals source code to put into their own indicator/strategy, you are free to do so. Just send me a message I'd love to see your work with it! :)
Thanks to Lij_MC's MarketVision A indicator for inspiring me to add more features. At first it was just the RSI Arrows and the BB reversals candles + Condition but then I found MarketVision A and loved the extra Leledc and 3 Line Strike features.
Hope you enjoy this Spice!
No Signal is 100% correct at what it's trying to do. Use caution when trading!
Practice Risk Management.
TTP Pair CipherPair Cipher can run your hedge pair trading strategy.
Pair cipher can use a spread chart (two assets ratio or difference) to manage a hedge position consisting of two assets: one long and one short position.
Event though the spread chart is used to determine the entries and exits each coin price action is used to calculate floating PNL.
It supports different bot platforms. It's backtestable and can run live.
Features:
- Internal and external entry signal
- In-chart realised PNL plot
- Hedge position floating PNL chart
- Individual floating PNL for each long and short ("show coins" toggle)
- Retracement exit strategy: determine at which retracement factor to exit your position while in profit
- PNL RSI exit strategy: determine at which RSI level crossunder you'd like to exit. RSI is applied to the floating PNL
- Static TP/SL levels
- ATR TP/SL levels with individual factors. When ATR is selected the TP or SL acts as a multiplier of ATR instead.
- On-chart debug labels for alerts
- Intra candle alert: signals can trigger intra candle in this mode, but this mode will cause repainting. Example: if the position goes below SL intra candle, the alert will be sent, but later if it goes in profit before closing the candle, the backtest will continue with the position open. The backtest does NOT have access to the intra candle data. Alert intra candle reduces the risk of not applying SL.
Example of setup:
1) Load an empty 1 hour timeframe chart with the spread BYBIT:REQUSDT.P / BYBIT:REEFUSDT.P
2) Select an investment amount
3) Select TP 1.2 and enable ATR
4) Select SL 1.1 and enable ATR
5) Select RSI profits of crossunder 70
6) Don't enable external signal (you can try with TTP PNR)
7) Select BYBIT:REQUSDT.P as symbol 1
8) Select BYBIT:REEFUSDT.P as symbol 2
The Master Pattern Indicator***READ THIS FIRST****
THE MASTER PATTERN Indicator
USER AGREEMENT
*** The personal/private use of this indicator is allowed, commercial use is FORBIDDEN.
***Commercial use will be interpreted as taking advantage of the free indicator in order to profit from it, for example: as part of any courses or mentorships offering training of the indicator or the concept its based. You don't need to pay for any training for this, the strategy is a simple trend following approach, even a caveman would understand.
**********************************************************************************************************************
Now please enjoy the BEST Master Pattern indicator you will ever find for Tradingvew, and for the best price: FREE.
Please do not give money to people trying to charge you for any inferior version of this indicator.
DESCRIPTION
The Master Pattern indicator or The Forex Master Pattern is an alternative form of technical analysis that provides a framework which will help you to find and follow the hidden price pattern that reveals the true intentions of financial markets. This algorithm I came up with does a very good job detecting the Phase 1 of the Forex Master Pattern cycle, which is the contraction point (or Value), and then proceeds to differentiate between major or minor lines and prints the liquidity lines the correct manner in relation to the swings expanding from the contraction.
On Phase 2 we get higher timeframe activation (also called Expansion), which is where price oscillates above and below the average price defined on Phase 1.
On Phase 3 is where we get a sustained deviation from value (the Trend).
In a very short time you will start noticing this pattern, even on naked charts. It is all a matter of training your eyes - the more time you invest studying the charts with this indicator (both historically and replaying the market on strategy tester), the faster you will become familiar with this method.
This indicator DOES NOT REPAINT. You can safely study the chart historically because what is printed historically is what prints real time.
Why do traditional based indicator systems fail over time? Because the markets move in cycles that constantly change structure. Those traditional indicator systems must be constantly optimized and settings tinkered with because of the changing market environment. There are an infinite number of variables that affect price so no exact technical system can work the same forever, which is also the reason why most bots/EA fail.
If you learn to spot the Forex Master Pattern and understand the sequence of the real cycles that drive the markets, you can more accurately forecast market behavior. By using traditional indicators you end up masking this pattern.
Use the insights provided by the Forex Master Pattern indicator to elevate your trading to the next level.
This method of analysis works in any liquid market and timeframe.
VERY IMPORTANT:
The default setting of historical bars is set to 500. This is more than enough for day trading and ensures fast drawings loading time and stable performance. Bear in mind that, the more bars you choose to load historically, the longer it will take to draw everything. The max setting of this input for now is 800. If it is possible to increase it, I will update the code. So if you want to make historical analysis far in the past, just use the chart replay feature.
Indicator Parameters:
They are all self-explanatory, except Type. You can choose between 1 and 2.
1 is better suited for LTF (M1 to M30)
2 is better suited for HTF (H1 and upwards)
However, this is my personal preference. You can of course experiment and choose what looks best for you.
Instructions to use the alert function:
1st step - Choose symbol and timeframe for the alert
2nd step - Go to indicator settings and tick/untick the boxes for the alerts you want
3rd step - Click on the ... (three dots) next to the indicator name (chart upper left corner) and click to add indicator alert
Then it's gonna add the alert with the conditions that you've ticked/unticked inside indicator settings.
Then repeat the process for different symbols, timeframes and different alert conditions.
Bonsai BX (Backtester)In today's trading landscape, traders need precision and deep analytical tools to navigate the sea of strategies. The Bonsai Backtester is one such tool, meticulously designed to evaluate multiple trading strategies in an integrated manner.
═════════════════════════════════════════════════════════════════════════
🌳 Bonsai BX 🌳 Universal Strategy Testing
📘 Overview
A product of collaboration with the Bonsai community, this backtester is both a reflection of collective insights and a means to provide traders with data-driven insights on TradingView.
📌 Current Backtest
• Dataset: BTCUSD daily candles from Coinbase, starting from March 2015.
• Source Signals: The Bonsai indicator signals are employed for both long and short entries. These are directly visible on the publication chart.
• Trading Assumptions:
• Initial Capital: $1,000
• Maximum Position Size: 10% of equity per trade
• Stop Loss: 10% per position
• Commission: 0.1%
• Slippage: 100 ticks (1.00)
🛠 Key Features
The Bonsai BX is equipped with a range of features aimed at providing traders with a more comprehensive analysis environment:
Features on Chart
• External Indicator Adaptability: Easily incorporate signals from both built-in and custom TradingView indicators.
• Snapshot Table: Delivers on-the-spot insights into crucial strategy performance metrics, including equity, open profit, position size, and entry price. While these details are available in TradingView's 'Performance Summary' panel, we've integrated them directly onto the chart for a more streamlined and accessible viewing experience.
• Trade Labels: Visualize profit metrics for individual trades directly on the chart, allowing for a more immediate grasp of trade outcomes.
• Long & Short Behaviors: Modify long behaviors to either open new long positions while closing short ones, or simply to close short positions. Conversely, for short behaviors, opt to either initiate new short positions while closing any active long ones or simply close long positions.
• Multiple Signals Integration: The tool can currently handle up to three different external signals for long and short trades.
• Condition-based Initiation: Define whether longs and shorts are triggered when 'All Conditions Met' or just 'Any Single Condition Met'. This flexibility allows for a more nuanced trading approach. For example, if you're using a trade signal alongside the RSI, you can specify that a long position should only open when the trade signal is active and the RSI is below 30 at the same time. This lets you combine multiple signals or conditions for more precise trade initiation.
• TP & SL Customization:
• Single TP: Set a specific Take Profit percentage.
• SL: Define a Stop Loss percentage and choose between a standard or trailing stop.
• Trail From: Specify the starting point of the trailing stop, be it the breakeven point or a certain percentage.
• Interface Theme: Users can select between light and dark themes for their interface.
Performance and Trailing
🎛 Using Bonsai BX
1. Add it to your TradingView chart.
2. Adjust script parameters and settings. Integrate external indicator signals as needed.
3. Activate the backtester to refine trading strategies.
Backtester Settings Menu
🪝 Webhook (Beta)
The Webhook functionality, now in beta, augments the Bonsai BX utility. This feature offers a more intuitive method for users to direct webhooks to trading bots, exchanges, and brokers. It simplifies the process by eliminating the need to adjust JSON structures or other payload formats, making alert automation more accessible.
📜 Feedback & Community
The feedback from the Bonsai community has been instrumental in the tool's development and will continue to shape its evolution. As part of our commitment to adaptive, smart trading, this script will continually be updated to meet the ever-changing requirements of traders.
❗️ Disclaimer
Backtesting tools, including the Bonsai BX , simulate trading strategies based on historical data. The following key points should be kept in mind:
1. Past Performance is Not Predictive: While backtesting can offer insights, it's essential to understand that past performance does not guarantee or predict future results. Historical data might not account for future market changes or unforeseen events.
2. External Influences: Market outcomes can be significantly influenced by various external factors like geopolitical events, economic announcements, and sudden shifts in market sentiment. Such factors are often not considered in backtesting simulations.
3. Market Dynamics: Elements like market volatility, liquidity constraints, and slippage can drastically alter expected outcomes. These dynamics might not always be accurately represented in backtest simulations.
4. Limitations of Simulated Trades: Backtesting operates under the assumption that historical trends and patterns will replicate. However, market conditions evolve, and what worked in the past might not necessarily be viable in the future.
5. Informed Decisions: Always base your trading decisions on a mix of comprehensive research, current market analysis, and risk assessment. Relying solely on backtested results can lead to misconstrued perceptions and potential pitfalls.
Trading involves risks, and it's crucial to be fully informed and cautious before making any investment decisions. Always consider seeking advice from financial experts or professionals when in doubt.
BE - Strategy Builder ToolkitIndicator vs Toolkit:
This is definitely not an indicator, hence this doesn't do any kind of analysis nor provide meaningful outputs where you can take trading decisions out of it.
This is a Strategy Builder Toolkit which works like any other broker/3P applications, which helps traders to build their own custom/ predefined strategies, save / deploy them at their wish.
Idea Behind Developing this Toolkit: I am sure many of traders have overcome scenarios where, on break of x level he wants to initiate straddle else he wants to initiate Iron Condor. Some of them wants to deploy custom strategies only at certain time or at certian price levels.
It becomes pretty difficult to track markets when you are away from desk and if you dont adjust the strategy legs, you are incurring big drawdowns. There are many if's and buts to deploy strategies.
To overcome such challenges, i have built this toolkit.
Note: As this is just a toolkit, you should conduct your analysis to gauge the market direction outside the perview of this. Once you know the view / direction of the script. you can use this toolkit in action to
1. Deploy Strategy at (Desired levels| Desired time|Confired Levels|Confirmed Volumes)
2. Strategy can be Prebuilt / Custom Built
3.1 Set SL, Target for Directional view (Trail SL aswell)
3.2 Set Upside or Downside Target for Non Directional view (Trail SL aswell)
3.3 let the strategy play with out SL|Targets for consolidation view.
4. Adjust Legs by closing existing position and opening fresh position or place fresh adjustments
5. Book partial Profits with in the zone.
How the Toolkit is buit: Script uses text related functions to understand the custom input given in the indicator and coverts into a strategy and deployes them as a algo trading (Next Level Bot) with the additional parameter set for SL|Target|Entry levels.
Understanding the settings:
1. Strike Difference: is basically a value between each strike. eg: Banknifty : 100, Nifty & Finnifty: 50
2. 1 Lot Qty: Qty per Lot accepted by exchange|Broker. eg: BNF: 15, Nifty: 50, Finnifty: 40
3. Lot Multiplier: If you build strategy with 1 lot and if you set the Lot multiplier as 2 then strategy gets deployed with 2 lots. for eg. If i have saved strategy to buy BNF 1 ITM with 1Lot and have set lot multipier to 3 then at the time of deploying the trade it pushes as 3 lots (3 * 15Qty per lot = 45Qty) of 1 ITM strike.
4. Symbol Name: Select the Symbol Name here.
5. Current & Next Week Expiry Date: Specify the expiry Dates in the format as supported by your broker.
6. Broker Name, Exchange & Product Type: hope it is self explanatory.
IMPORTANT settings to understand:
7. Triggere Entry Post (optional): You have to specify when you want to deploy the strategy. For instance, if i want to deploy my strategy at 30 min after market open which is 9:45 am, then i have specify as 0945. Another instance where i want to close my strategy at 3 PM then you have to specify as 1500. Uncheck this option if you are not worried about the time of entry.
My personal Used Case: On the Expiry -1 Day at 0916 (9:16AM) i will buy 6 lots of 8OTM PE & CE and Sell 2 lots 7OTM, 2 lots of 6OTM and 2 lots of 5OTM and close the trade by 1100 (11AM).
8. Price Levels (Confirmed vs UnConfirmed) (Optional): Confirmed is basically price is sustained at|around the specified price level, where in UnConfirmed is basically the touch of the specified level.
for instance if i want to deploy straddle only if price is sustained at 100. then, i would specify GE with 100 in price input settings, and check thee Confirmed price box. Assuming if LTP is running at 98 and with the above settings it will only deploy the trade upon price is sustained at 100 level for 3 to 5 candles not at the touch of 100.
Uncheck this option if you are not worried about the Entry Price.
9. Confirmed Volume (Optional) (Long or Short): Basis your view|direction of the strategy. you can get additional confirmation. At the time of entry you want volume to be present towards the direction of the strategy. Uncheck this option if you are not worried about the volume or Volume doesn't exist for the chart loaded.
10. Alert Types: It consists of 3 Long & 3 Short directional (prebuilt) strategy along with Close Strategy, Close Specified Symbols Only & Design Custom Strategy Option.
10.1 : Slow Upmove - If you are having bullish view and predict that prices shall go slow and steady. This strategy can be deployed where you get the benifit of time decay as well while the delta play in favor of you. (viseversa for Slow DownMove)
10.2 : Fast Upmove - If you are having bullish view and predict that prices shall go fast. This strategy can be deployed where you get the smaller benifit of time decay as well while the delta play in favor of you. (viseversa for Fast DownMove)
10.3 : Vol Upmove (Volatality)- If you are having bullish view and predict market is tend to be volatile. This strategy can be deployed where you get the benifit of volatility as well while the delta play in favor of you. (viseversa for VolDownMove)
10.4 : Close Trade - You can use this option close the deployed strategy completely.
10.5 : Close Symbols - You can use this option close few of the symbols for the strategy deployed.
10.6 : Custom: Use this option to design you own custom strayegy with the syntax below:
Sample 1:
N|B|C2|3
N refers to Nextweek Expiry (if C is used then Current week expiry)
B refers to Buy (if S is used then Sell)
C refers to Call | CE (if P is used then PE or Put)
2 refers to 2OTM (for CE any Postitive number refers to as OTM and for PE it will be treated as ITM strikes & 0 refers to as ATM - viseversa for Negative Numbers)
3 refers to as 3 Lot
With the syntax of N|B|C2|3 - strategy will be deployed as "Buy 3 lots of 2 OTM Call of Next expiry"
Sample 2:
C|S|P-3|3|10|30
Above syntax means: SELL Current Expiry 3 Lots of 3 OTM Put Strike with 10 SL and 30 TGT
Sample 3:
C|S|C10|3|Default
Above syntax means: SELL Current Expiry 3 Lots of 10 OTM CALL Strike with 50% SL and 95% TGT
Sample 4:
C|B|C-2|3|40%|50%
Above syntax means: BUY Current Expiry 3 Lots of 2 ITM CALL Strike with 40% SL and 50% TGT
Sample 5: Long Straddle
C|B|C0|3
C|B|P0|3
Above syntax means: BUY Current Expiry 3 Lots of ATM CALL & PUT Strike
Sample 6: Iron Butterfly
C|B|C1|1
C|S|C0|1
C|S|P0|1
C|B|P-1|1
Above syntax means: Sell Current Expiry 1 Lots of ATM CALL & PUT Strike and BUY 1OTM Call & Put Strike
Sample 7: Diagonal Spread
C|S|C2|1
C|S|P-2|1
N|B|C3|1
N|B|P-3|1
Above syntax means: Sell Current Expiry 1 Lots of 2OTM CALL & PUT Strike and BUY 3OTM Call & Put Strike of Next Expiry.
To Understand how to deploy Strategy with defined Adjustments. For instance i want to deploy Iron Condor with Adjustments for BNF when the price is currently running at 45000.
C|B-|C3|1
C|S*|C2|1
C|B--|P-3|1
C|S**|P-2|1
At:2|C|S|C2|1
At:2|C|B|C3|1
At:-2|C|S|P-2|1
At:-2|C|B|P-3|1
On:2|*
On:-2|**
On:2|-
On:-2|--
With the above syntax: Intial trades are placed with
BUY BANKNIFTY45300CALL(Current Expiry) 1 Lot
BUY BANKNIFTY44700PUT(Current Expiry) 1 Lot
SELL BANKNIFTY45200CALL(Current Expiry) 1 Lot
SELL BANKNIFTY44800PUT(Current Expiry) 1 Lot
Toolkit tracks the price and holds the adjustments.
We may start to bleed on the sold leg (45200CALL) once the price crosses 45200. Hence if the price crosses 2 strike upside as specified with syntax " On:2|* " where * is a character tagged to Sold Call Leg. it closes the 45200 Call.
Similarly, " On:2|- " where - is character tagged to Brought Call Leg. it closes the 45300 Call, as soon as prices reaches 2 strike upside.
At:2|C|S|C2|1
At:2|C|B|C3|1
With the At Statements you can place the fresh adjustments legs. Above syntax refers to Once the price reaches 45200 it places below adjustment legs.
BUY BANKNIFTY45500CALL(Current Expiry) 1 Lot
SELL BANKNIFTY45400CALL(Current Expiry) 1 Lot
Note: Similarly If prices reaches downside with the On and At Sytax it places the necessary adjustment legs accordingly.
11. SL & TGT - You can specify SL, TGT or Upside & Dowside TGT during the entry conditions and Stratey shall be closed upon hitting either the SL or TGT accordingly.
12. On % Tgt & Lock % SL: This option is used for Prebuilt strategy where you can lock the Profit | Set Revised SL upon hitting specified TGT percentage.
13. Close Symbols: This option is used if you select Alert type as Close Symbols (Ref - 10.5 : Close Symbols) for specified list of symbols Alert shall be pushed to close the open positions of those symbols.
DISCLAIMER: No sharing, copying, reselling, modifying, or any other forms of use are authorized for our documents, script / strategy, and the information published with them. This informational planning script / strategy is strictly for individual use and educational purposes only. This is not financial or investment advice. Investments are always made at your own risk and are based on your personal judgement. I am not responsible for any losses you may incur. Please invest wisely.
Happy to receive suggestions and feedback in order to improve the performance of the indicator better.
[OKX Signal Bot] Indicator Script Set Up TemplateDiscover the power of the Turtle Trade Channels Indicator (TUTCI), an innovative tool that integrates the time-tested principles of the legendary Turtle Trade system. This groundbreaking system shattered the belief that successful traders are born, not made, by transforming ordinary individuals into profitable traders.
The Turtle Trade Experiment, which achieved a remarkable 80% annual return over four years and amassed a staggering $150 million, showcased the immense potential of this trend-following strategy. Unlike the conventional "buy low and sell high" approach, the Turtle Trade system embraces a different philosophy—one of capturing substantial profits by following prevailing trends.
At the heart of the Turtle Trade Channels Indicator lies the concept of Donchian Channels, a powerful technical indicator developed by Richard Donchian. Building upon this foundation, the main rule of TUTCI is to identify 20-day breakouts and capitalize on them, while simultaneously utilizing a profit-taking strategy based on breaching 10-day highs or lows.
For long trades, the indicator signals a buying opportunity when the price breaks above the 20-day high. Conversely, for short trades, a selling opportunity arises when the price falls below the 20-day low. This systematic approach allows traders to align themselves with the prevailing momentum, capturing significant price movements.
To further enhance trading precision, TUTCI incorporates two key lines. The red line represents the trading line, indicating the direction of the trend. Price bars above the trend line suggest an uptrend, while those below indicate a downtrend. The dotted blue line serves as the exit line, guiding traders to close their positions when price action breaches the 10-day high or low. This rule safeguards profits and helps traders avoid potential trend reversals.
The Turtle Trade Channels Indicator (TUTCI) is a versatile tool applicable to various financial markets, including stocks, commodities, and forex. By harnessing the power of breakouts and integrating profit-taking rules, this indicator empowers traders to capitalize on favorable trading opportunities while managing risk effectively.
As with any trading strategy, it is crucial to conduct thorough backtesting and evaluation of the TUTCI system before implementing it in live trading. Traders can customize the indicator's parameters to align with their trading preferences and adapt to changing market conditions. Employing sound risk management techniques, such as position sizing and stop-loss orders, is paramount to protect capital and minimize potential losses.
Experience the transformational potential of the Turtle Trade Channels Indicator (TUTCI) and embark on a journey of trend following, capturing significant profits, and achieving trading success.
These scripts are only functioning as sample script templates to support okx alert standards. It is not intended to provide any investment, tax, or legal advice, nor should it be considered an offer to purchase, sell, hold or offer any services relating to digital assets. Digital assets, including stablecoins, involve a high degree of risk, can fluctuate greatly, and can even become worthless. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition and risk tolerance. OKX does not provide investment or asset recommendations. You are solely responsible for your investment decisions, and OKX is not responsible for any potential losses. Past performance is not indicative of future results. Please consult your legal/tax/investment professional for questions about your specific circumstances.
Broadview Algorithmic StudioWelcome! This is the writeup for the Broadview Algorithmic Studio.
There are many unique features in this script.
- Broadview Underpriced & Overpriced
- Broadview Blackout Bollinger Bands
- Trailing Take Profit Suite
- Algorithmic Weights
- VSA Score
- Pip Change Log
- Activation Panel
- Weight Scanner
There are 116 primary inputs that allow users to algorithmically output unique DCA signal-sets. There are 85 inputs that allow users to control individual lengths, levels, thresholds, and multiplicative weights of the script. You will not find any other script with this many inputs, properly strung together for you to produce unlimited strategies for any market. The entire premise for the Broadview Algorithmic Studio is for users to be able to have extensive-cutting-edge features that allow them to produce more strategies, having control over every element that outputs a signal set. The number of unique strategies you can output with this script is VAST, and each continues to follow a safe DCA methodology.
This script is ready for use with 3Commas, interactive brokers, and other means of automation. It provides detailed information on Base Orders and Safety Orders, giving the number, cumulative spending, position average, and remaining balance for each SO in the series. Using this script we will explore the depths of strategic volume scaling, and the algorithms we use to determine spending.
Let me first start by saying the number of safe DCA-friendly signal-sets this script can output is absolutely staggering.
Let's limit the scope just to the Broadview Underpriced & Overpriced and Broadview Dominance indicators.
Each band of the Dominance Suite can be controlled individually with unique lengths, levels, and weights. This means the Dominance Suite can establish Bearish or Bullish dominance, in any market condition, and give it a unique overloading weight. The Broadview Underpriced & Overpriced indicator finally gives us the ability to establish these "market conditions" first with cycles. Of all the cycles this indicator establishes, the two primary are Underpriced & Overpriced. We determine this using a composite Overbought & Oversold with an Exponential Moving Average. So the script can now know, what cycle it is in, who is dominant during that cycle, and exactly how much weight in volume scaling the order should have.
Brand new is the ability for indicators of this level to be able to talk together in a single script. The Broadview Underpriced & Overpriced indicator and the Broadview Dominance indicator can inform one another across multiple vectors, create a unique market snapshot, and give that snapshot a unique weight every bar. The unique weight is compiled in the volume scaling math, thus giving us an automated-strategic-safe and quite efficient volume scaling for every order. In our coming updates we will explore this synergy to its very deepest layers. These indicators can be laced together in many ways, called vectors.
Only in the Algorithmic Studio do we explore these depths and yield those findings, features, and inputs to the user.
Let me take a quick break to explain another area-of-opportunity for our research and development.
The VSA Score is something we've tried before, but until the creation of the Broadview Blackout Bollinger Bands Auto Indicator it was not possible. The concept we want to explore is "Positional Honing". Over time we want users and the script itself to be able to understand the difference between a script-config that produces a high number of Hits, from a configuration that produces a high number of "Misses". The Volume Scaling Accuracy Score uses the BBB Auto Indicator as a heavily reliable, non-repainting, method of determining what the very-best signals for increased volume-scaling are.
Increased volume scaling is denoted by the near-white highlighter line running vertically. This line will either fall inside the BBB Auto Indicator bands (which are hidden), or, they will fall below and outside the BBB Auto bands. If increased spending happens inside the bands it's a "Miss". If increased spending happens below and outside the bands, it's a Hit. Oftentimes misses are actually pretty good spots for extra spending, which helps lower your position average, but Hits are always better. The Hits that the BBB Auto Indicator provides are extremely good.
Let's talk about the Trailing Take Profit Suite. This suite allows us to set a trailing take profit which is a feature that lets one maximize their profits. If the trailing take profit is engaged, then when the regular take profit is hit, it will trigger, denoted in red vertical lines, and the trailing take profit will look for a specified rate of change before it actually takes profit. This usually helps traders in those times when their regular take profit was set too low, allowing them to maximize their profits with a Trailing Take Profit.
For the moment, let's think about our scores. In the dashboard you'll notice a score beginning the Pip Change Log, the VSA Score, and the Activation Panel.
These scores use a new kind of logistic correlation formula where 4 digits are given to activation, rather than 1. This is to allow room for a future concept in AI we call "Deadzones" or you can think of it as impedance. This is not a bias in logistic regression. It's an entirely different concept. A neuron, which a perceptron attempts to mimic, has a bias.. but it also has a sort of electrical resistance. This is because a neuron is individually-alive entity. So a perceptron, as it were, would need to have both a bias and a natural resistance, or deadzone.
It is a lot of fun to watch the scores and how they react during playback. They tend to smooth trends but are also quite quick to correct to accuracy. In the future we will add the deadzones and biases to the scores. This should help both users and the script produce better signal sets. The Pip Change Log is an indicator that measures Rate of Change in Pips. This is one that I am particularly excited to study, as I am a huge fan of ROC. The Activation Panel shows these scores for 4 primary indicators: On Balance Volume, Relative Strength Index, Average Directional Index, and Average True Range.
Having the Pip Change Log, VSA Score, and Activation Panel up on the dashboard with their logistic correlation scores allows traders to study markets and setups quite intimately. The weight scanner at the bottom allows users to track the cumulative applied multiplicative weights during playback. The massive number of inputs, connected vectors of indicators, input-weights, lengths, levels, and thresholds sets up all the algorithmic infrastructure for powerusers to explore every idea and strategy output they could imagine. Also with the connected vector infrastructure we can deepen our indicators in a way where, "How they talk to each other.", comes first in every development conversation.
The Algorithmic Studio is for the Power-user.
These are not basic equations coming together to determine spending. This is a massive multi-layered-perceptron with everything from Trailing-Take-Profits to strategic-automatic algorithmic downscaling. The Broadview Algorithmic Studio gives a home to the poweruser who wants access to everything in a trading and investing AI, right up until the backpropagation. The Broadview Algorithmic Studio, gives users the ability to sit in the chair of the would-be AI.
Thank you.
Trade Manager & Position Size Tool & PnL Tracker [AlgoScopes] V1Position size tool, leverage calculator, trade tracker, money management, trade presentation, risk reward management, margin position, live profit and loss, that's all in this one Trade Manager indicator.
The idea for this indicator comes from two years ago when I was helping a friend who, at the request of 15-20 members from our telegram group, wanted to create a paid group and share our ideas for trade with them (it started as an experiment for just a month or two and ended with 15 months with over 500 trading ideas and signals, with a complete TA chart). If I had time to create this indicator back then for members, it would have been much easier for them to be able to understand and follow the trade idea that was presented through a classic chart, with all the things that a TA must have:
Entry (as well as the reason for entry),
Stop (where the idea for the trade is no longer valid),
Target (with the reason why it is the target for that trade),
Take profits (taking part of the profit on the way to the target).
The majority of members still did not understand how much position to trade, what is the possible profit or loss, if the margin trade is how much leverage to use, in one word “money management”. The most important rule that every trader must follow is "Plan your trade and trade your plan". Learn money management and you are halfway there to becoming a successful trader. It is only after all that, you learn to use some of the "holy grail" indicators. When you have mastered those first two rules, find and master your favorite indicator or trading style (the most important thing is to stick to those two rules). The margin | leverage is also included in the script, for which there are so many dilemmas, arguments and discussions. (that many who still do not understand margin, would trade that it is not passionate if it is controlled). Too much for an introduction, especially since this indicator has so much to explain.
Most importantly, this is an invite-only indicator, and there are so many free indicators on tradingview that can also serve you very well. As far as I know, all exchanges have a calculator tool to calculate the possible profit and loss for each trade you plan to take.
*This indicator is not recommended for scalping on a 1min chart because the script, as you will see, is very complex, so the loading time is longer than with simpler indicators.
💠 ABOUT THE SCRIPT
This script is made to help manage trade. In this one indicator you have the possibility to do technical analysis, calculation for trade (four types: account size risk, trade investment, maximum to lose or position size), monitor 'PnL' (profit and loss in real time) do the calculation in the second, maybe local currency, and set an alert (from entry to any other change in trade). As the script is made for general use, some slight differences are possible for real time 'PnL' or 'ROI'. Always do a test before you start trading with larger amounts. The script is recommended for intra day trading and above. The script is not recommended for scalping on the 1min chart
💎 PROCESS TO ADD SCRIPT TO CHART
Possible trade on break example trade
As this script is invite-only, to add it to the chart you need to click on Indicators and find it under the 'Invite-Only' section. When you add the script to the chart (as it is interactive), you will be asked to do 4 steps.
🔸 'SET TRADE TIME'
Click on the chart where the last vertical bar is.
If you are already in the trade, then find the bar|time where the trade started
(you want to follow trade or trade presentation)
🔸 1) 'SET ENTRY'
Click on the horizontal level where you want to place the Entry
🔸 2) 'SET STOP'
Click on the horizontal level where you want to set the Stop
🔸 3) 'SET TARGET
Click on the horizontal level where you want to place the Target
💎 CONFIRM INPUTS
After you have done those 4 steps, a popup will appear with the relevant inputs for the trade.
You will see that some inputs are already filled (done in those 4 steps before, Entry, Stop and Target). You can correct them if you want (you will sometimes notice a longer 'space decimal' for the trade ticker, but this will not affect the calculator or other parts of the script). You can do the rest of the inputs for trade or finish it later when the script is loaded on the chart (it is recommended to fill in 'Trade Type' and 'Amount'. Don't forget to click on the "Apply" button to load the script on the chart.
💎 INDICATOR LOADED ON CHART
• When the indicator is loaded on the chart (regardless of whether it is a new trade or a trade that has already started), the following items are displayed by default:
🔸 ' Trade Table ' shows all relevant information for the trade
🔸 ' Trade Box ' with lines for Entry, Stop and Target (Take Profits if enabled)
🔸 ' Trade Box Labels ' with relevant data
• The Entry label is also the trade status label, and if the trade is not active, by default it is the Entry color
If the trade is active or when a new trade reached Entry, several new things are noticeable:
• Entry|Status label as well as status row in table will change color as well as 'Entry Reached' text
• Several extra columns relative to trade will be added to the Entry|Status label
• 3 new columns will also appear on the Trade Table (Live PnL, Live min PnL and Live ROI)
• If Trail Stop is enabled, the label will change the text to T.Stop and change color depending on whether it is in loss or profit.
• If Trail Stop is enabled, inside Trade Box trail line it will follow price action inside the box, while the label will always be fixed at the initial level
• A vertical colored line will appear on the right side of the Trade Box (depending on whether the trade is in profit or loss) which shows as in the Trade Table like Live PnL
⚪ SETTINGS
💎 Trade Account Setup
🔸 ‘Trade Type’
• 'Account Capital' or portfolio (with combination '% Capital Risk')
• 'Investment' (how much you want to invest in the trade)
• 'Risk To Lose' (how much you want to risk losing)
• 'Position Size' (exact position size, units|share for trade)
🔸 ‘Account Type’
• If the account is in another currency or you want to see possible profit | loss in local currency
• Around 150 world and local currencies supported by ICE exchange
🔸 ‘Amount’
• Amount for ‘Trade Type’
🔸 ‘% Capital Risk’
• Only for ‘Account Capital’ trade type
(i.e. 10.000 account capital with ‘% Capital Risk’ 4 is 10.000 x 4% = maximum loss 400)
🔸 ‘Leverage’
• Enable|Disable for margin trade i size of leverage (maximum 125x)
(be sure to study how and when to use margin trade through the tutorial, because margin trade can be very dangerous. If you have not perfected margin trade, there is a great possibility of losing most or even all of your account capital).
💎 TRADE ENTRY & TARGET & STOP & T.STOP & DATE | TIME
🔸 ‘Trade Date & Time’
🔸 ‘Entry’
🔸 ‘Stop’
🔸 ‘Target’
• (all was set in the previous step but can be correct/adjusted if needed)
🔸 ‘Market Entry’
• Enabled will move Entry on that bar close
🔸 ‘Liquidation’ (enabled by default)
• Show ‘Warning’ if trade Stop is close or invalid (trade will hit liquidation before reached Stop level)
🔸 ‘Trailing Type’ (4 trailing stop type)
• ‘Disabled’ (Stop will stay the entire time at the initial stop level)
• ‘Continuous’ (I.Stop follow price by distance or percent when price reached Trail start level)
• ‘Stepped’ (I.Stop moves to previous level when price reached Trail start level)
• ‘Breakeven’ (I.Stop moves to Entry when price reached Trail start level)*
* (least one Take Profit enabled)
🔸 ‘Trailing Active’ (Entry, TP1, TP2 and TP3)
• Trailing stop starts level if ‘Trailing Type’ is enabled
🔸 ‘Trailing by’ (distance or percent)
• ‘Distance’ (T.Stop will follow price action by distance)
• ‘Percent’ (T.Stop will follow price action by percent)
(this is a good example to see the difference between trailing by initial distance and initial percentage)
🔸 ‘T.Stop Distance & Percent’ (initial distance and percent for table trade only)
• Useful for bot or exchange
🔸 ‘Stop, T.Stop, Target and TP’s in PIP’s’
• Distance in PIP’s
💎 TAKE PROFIT
🔸 ‘Split Target’ (enabled by default to three take profits (TP) with auto split)
🔸 ‘Number of Take Profits’ (up to three take profits)
🔸 ‘Type’ (auto or manual)
• For manual type fill all prices to preferred level. TP percent (TP1%, TP2% and TP3% ) and Target% is how much profit you want to take on a specific level.
• PLEASE NOTE sum of all enabled ‘TP’ and targets = 100 (e.g. two TP and sets TP1% to 25 and TP2% to 35, then Target% should be 40% i.e. 25 + 35 + 40 = 100)
💎 TRADE BOX & LINES
🔸 ‘Target Line’ (color for target line and trade table ‘direction’)
🔸 ‘Stop Line’ (color for initial line and trail line)
🔸 ‘Entry Line’ (color for entry line and label & table status)
🔸 ‘To Trade Time’ (‘trade box’ left vertical line)
• By default is set to trade date and time
• Unchecked will be moved to the last bar (live time)
🔸 ‘Extended Left’ (extend Entry, Stop, Target and TP’s lines to left)
• To check for possible support|resistance
🔸 ‘Size’ (Entry, Stop, Target and TP’s lines size)
🔸 ‘PnL Box Size’ (line size for vertical box lines)
🔸 ‘Offset’ (right vertical line offset from last bar)
🔸 ‘PnL Box Color’ (right vertical line and trail fill color)
• Color changes for profit & loss
🔸 ‘Box Line Color’ (box base color)
💎 LABELS
🔸 ‘Stop & Target Labels’ (enable|disable stop and target labels)
• By default is set to small (tiny, small, normal, large, huge and auto option)
• Disabled will move all information on Entry|Status label
🔸 ‘Offset’ (label offset from trade box)
🔸 ‘Target Label’ (label color for target and all enabled tp’s)
🔸 ‘Stop Label’ (label color for initial stop and enabled trailing stop)
🔸 ‘Label Text’ (color for label text)
🔸 ‘Status Label Color’ (label table entry|status color when trade is not active)
🔸 ‘PnL’ (entry|status color for profit and loss)
🔸 ‘Size’ (by default set to normal, option tiny, small, normal, large, huge and auto)
🔸 ‘Risk to Reward’ (show risk to reward on labels)
🔸 ‘Extra Info’ (by default disabled, show extra related info for trade on labels)
• Useful if Trade Table disabled
🔸 ‘Close Trade Stats’ (by default disabled, show all info when trade is closed)
• By default is white text color for close trade stats label
💎 ALERTS
🔸 ‘Failed Trade’ (alert if price reached Stop before is active, reached Entry)
• Useful if trade need adjustment but it can also be left as it is
and alert is just warning
🔸 ‘New & Update Alert’ (alert when price reached Entry or change status to enabled Take Profits)
🔸 ‘Trade Closure Alert’ (alert when trade closed, reached Stop, Target or enabled Trail Stop)
• Alert can be in modified or default preset jSon format as well as in plain text format
• Place holders for creating alerts are :
{type}, {symbol}, {exchange}, {ticker}, {base}, {quote}, {timeframe}, {price}, {direction}, {entry}, {stop}, {tstop}, {tp1}, {tp2}, {tp3}, {target}, {tstopstatus}, {status}, {result}
* {type} placeholder is set to ‘Trade Active’, ‘Trade Update’ and ‘Trade Closed’
💎 TABLE DISPLAY
🔸 ‘Trade Table’ (enable|disable trade table)
🔸 ‘Position’ (by default set to bottom right with option bottom, middle and top with left, center and right)
🔸 ‘Size’ (by default set to normal, option tiny, small, normal, large, huge and auto)
🔸 ‘Full Table’ (by default enabled, disabled show small table without some info*)
* check picture for reference
🔸 ‘Presentation’ (by default disabled, hide all info related to PnL in trade currency)
• Useful if trade shared for presentation, hidden trade fiat|currency info)
🔸 ‘Header’ (color for trade table first row)
🔸 ‘Stats’ (color for trade table statistics row)
🔸 ‘Text’ (color for trade table text)
🔸 ‘Error’ (color for all errors if is made when trade is setup)
• Color for errors is for trade table and trade labels
🔸 ‘Fiat Price’ (by default enabled, show info for second fiat*
* if trade is in crypto and ‘quoted’ currency is not stable coin, like ETHBTC, or ‘Account Type’ is set to different currency
🔸 ‘Live Fiat Price’ (if ‘quoted’ currency enabled will show live exchange conversion)
🔸 ‘All Errors’ (enabled by default, show all error if trade setup is wrong)
• When error shows on trade, disabled this to see what|where is error
• Check below for more details
🔸 ‘Tool Tip (chart)’ (enabled show all tooltip on chart)
• Check below for more details
• When you are familiar with indicator, disable popup tooltip
💎 TOOLTIP
All possible tooltips have been added for easier understanding, especially for traders who are just learning how to place a trade. (when you perfect this indicator, you can turn off the tooltip in settings, and you can also normally use the lite version of this indicator, which does not contain all these futures)
🔸 ' Settings Tooltips’
🔸 ‘Chart Tooltips’
🔸 ‘Table Tooltips’
🔴 ERRORS
When you setup trade, not only a novice in trading, but also experienced traders can make a mistake and for this reason all possible errors are included in the indicator which will be shown on the chart by changing the color of the labels as well as on the trade table and in most of the cases and error text.
If the tooltip is enabled in the settings, you can see the reason for the error as well as the solution.
Here are some examples of possible errors.
Stay safe
PLAN YOUR TRADE AND TRADE YOUR PLAN