INVITE-ONLY SCRIPT

Pullback_Power [JackTz]

Aktualisiert
Welcome to Pullback_Power
Pullback_Power is a scalping strategy designed to capitalize on market retracements while incorporating unique dynamic features to enhance profitability.

Calculation
Pullback_Power purely uses moving averages to calculate both entry and exits. Exits can also be set to fixed percentages for both take profit and stop loss.

How the Strategy Works
Statistics show that markets normally do a recovery after each drop. Crypto markets can easily drop up to 20% within a few hours and then do a complete or partial recovery. Pullback_Power utilizes this known pattern alongside pyramiding. The strategy aims to catch one or more entries when the price drops, hoping to make profits when the market recovers from the drop. The fixed take profit and stop loss can be used to define your risk management, while the dynamic exit opportunity is riskier but provides the ability to stay in the trade longer while it recovers. Pullback_Power can make up to four entries. This means it utilizes pyramiding to spread out the entry points, but every exit is a full exit. It is not possible to partially exit.

Utility
Pullback_Power is a scalping strategy suitable for traders who operate with small trades and don't want to stay in the market for too long. Pullback_Power offers precise signals with no repainting. The strategy thrives in volatility, so crypto pairs might yield the best results, although this strategy can be adapted to work on all pairs and markets.

How to Automate It
Pullback_Power utilizes the standard placeholders of strategies on TradingView. This enables the trader to add every data point into a webhook, making it fully flexible to suit every trader's needs. To automate, create an alert, set the webhook URL, and add the JSON body needed for the webhook. An example of a simple JSON webhook with some of the standard strategy placeholders:



Read about all the standard placeholders that you can use here: TradingView - Standard strategy placeholders

Originality
Pullback_Power is unique in its ability to create precise signals without repainting while maintaining a solid approach to the pullback strategy. Its simplicity not only makes the strategy easy to use and understand but also highly effective. The simplicity reduces inputs, eliminating overfitting and limits each input to avoid incorrect usage. Many times, default settings are enough to achieve good backtesting results on almost all pairs available. Pullback_Power also differs from many other strategies by its solid code, which enhances performance and provides more reliable backtesting. The clean code increases the resilience and precision of the entries, making it less prone to errors.
Many pullback/scalping strategies normally only works on specific scopes of timeframes or pairs. Pullback_Power can easily be adapted to work on almost every scenario. The biggest change needed is the length of the moving average. The lower the timeframe, the higher a length is needed for proper results. I.e. on a 2H timeframe a length of 3 can yield good results. On a 5min timeframe the length might need to be as high as 70.

How to Use
To use Pullback_Power, add the script to your trading chart. By default, Pullback_Power opens four orders to optimize trade opportunities with a default fee value set at 0.1%. You can change these default settings in the Settings window under the Properties tab. To tailor Pullback_Power to your individual trading style, navigate to the Settings under the Input tab. Here you can configure various inputs to fit your trading style.

- Backtest settings, Start Date:
Defines the date of when the calculation starts. Use this to set the date of when the first trade could potentially emit.

- Backtest settings, End Date:
Defines the date of when the calculation ends. If there are any open trades after this date the close calculations are still live. It only makes sure that new orders cannot be opened after this date.

- Backtest settings, Only trade on weekdays:
This is a toggle you can enable or disable. If enabled it only allows new entries to happen during the normal week days, meaning Monday, Tuesday, Wednesday, Thursday and Friday.
Disable this to enable the script to open trades on all 7 days of the week.

- Open settings, Use dynamic long positions:
This toggle allows you to enable or disable the pullback level calculations after first trade.
If enabled, the calculations of level 2, 3 and 4 continues to happen after each bar, making the levels follow the price with the moving averages calculations.
If disabled, the calculations of the levels stop after the first trade. This means that the levels calculation at the point of the first trade stay fixed until all trades are closed.
You can see the difference of the green lines on the chart when you toggle this flag.

- Open settings, Data type:
This is the bar data used for the moving average calculation when opening trades. The possible data types are Open, High, Low, Close, HL2, HLC3, OHLC4, OC2 and HC2.

- Open settings, Source type:
This is the source used to calculate the moving average. The types available are: SMA, PCMA, EMA, WMA, DEMA, ZLEMA and HMA.

- Open settings, Length:
This is the length used for the moving average calculations. 3 means it takes the last 3 bars of historical data for the calculation.

- Open settings, Offset:
This defines if the calculation should use an offset for the historical data. This does not use a look-forward feature, but a look-backward feature. To prevent any possible repaints the offset can only be positive, not negative.
For instance, if the length is 3 and the offset is 0 the calculation is made from the last 3 bars, making it bar1, bar2 and bar3. If the length is 3 and the offset is 1 the calculation is made from bar2, bar3, and bar4 – offsetting the calculation by 1 bar.

- Leverage settings, Leverage liquidation (1-125):
The script itself does not handle any custom leverage calculation – this must be done in the Properties tabs and increasing the order size.
This setting is made to test a possible liquidation event if using leverage.
By setting this to higher than 1, a red line is visible after the first trade on the chart. This indicates the liquidation price.
If this setting is set to 25, the script will calculate the liquidation price from a x25 leverage. If this price is hit, the scripts stops emitting any orders and the background turns red.
You can use this to test if your settings could handle a certain level of leverage.

- Pullback settings, Pullback 1, 2, 3 and 4:
Each of these settings defines the entry price of each pullback level. If Pullback 1 is set to -6 it means that the moving average calculation should be 6% lower than the actual price.
The same logic applies to Pullback 2, 3 and 4.
Setting any level to 0 will disable the level – eliminating any orders to emit on that level.
This can be used to change the level of pyramiding down from 4 if needed.
If you do this, remember to also change the order size and the pyramiding value in the Properties tab accordingly.

- Close settings, Use dynamic TP and SL:
If enabled, script will exit all orders using the same but separate algorithm for moving averages. This enables the user to define if you want the orders to be closed if the price level of this moving average is hit. The price level for this calculation is visible on the chart by the blue line.
Although you can change the length and offset, as described underneath, this calculation uses the same data and source type defined in the Open settings area.

- Close settings, Length, Close:
This is the length used for the closing moving average calculations. 3 means it takes the last 3 bars of historical data for the calculation.

- Close settings, Offset, Close:
This defines if the calculation for the closing moving average should use an offset for the historical data. Just as the offset used for opening order, this does not use a look-forward feature, but a look-backward feature. To prevent any possible repaints the offset can only be positive, not negative.
For instance, if the length is 3 and the offset is 0 the calculation is made from the last 3 bars, making it bar1, bar2 and bar3. If the length is 3 and the offset is 1 the calculation is made from bar2, bar3, and bar4 – offsetting the calculation by 1 bar.

- Close settings, Use TakeProfit:
This toggle enables/disables a fixed take profit percentage.

- Close settings, TP %:
This sets the wanted % to reach on a take profit. This setting is ignored if the toggle above is disabled.

- Close settings, Use StopLoss:
This toggle enables/disables a fixed stop loss percentage.

- Close settings, SL %:
This sets the wanted % to reach on a stop loss. This setting is ignored if the toggle above is disabled.

Exit on Same Bar as Entry
By default, the script doesn't emit any exit orders on the same bar as the first entry order. Enable "Recalculation: After order is filled" to change this behavior.

Troubleshooting
While Pullback_Power is designed to provide reliable trading signals, you may encounter rare issues. One such issue could be receiving an error message stating "can't open orders with 0 or negative qty." If you encounter this error, it is likely due to specific conditions on the selected timeframe. To resolve this issue, change the timeframe on your trading chart.

Underlying Principles and Value Proposition
Pullback_Power leverages moving averages and volatility behavior to identify market retracements and capitalize on them. The strategy is rooted in the understanding that markets often experience temporary reversals or "pullbacks" before resuming their primary trend. By identifying these pullbacks and entering trades at opportune moments, Pullback_Power aims to capture quick profits from short-term market movements.

The dynamic and fixed calculations of Take Profit (TP) and Stop Loss (SL) levels enhances risk management, ensuring that potential losses are controlled while allowing room for profits to grow. The adaptive approach using the moving averages considers current market conditions, making the strategy flexible and responsive to changing volatility.

Moreover, Pullback_Power's non-repainting nature ensures the reliability of its signals, eliminating hindsight bias and providing traders with actionable insights based on real-time market data.

The strategy's simplicity and effectiveness make it accessible for traders of all experience levels. Whether you're a beginner looking to start scalping or an experienced trader seeking to diversify your trading approach, Pullback_Power offers a balanced blend of simplicity and sophistication to help you navigate the markets with confidence.

By focusing on clear, transparent principles and offering practical tools for risk management, Pullback_Power aims to provide tangible value to traders, empowering them to make informed decisions and optimize their trading outcomes.


Thank you for choosing Pullback_Power. I wish you successful trading!
Versionshinweise
Minor changes in naming and a few fixes for non-responding input fields.
Versionshinweise
Dear traders
To elaborate on how I got the basic ideas of my strategy, I used two influential scripts as inspiration: "Hatiko Envelopes" and "Trend Pullback Toolkit Expo". Drawing from their essence, I've crafted this simplified, reliable and original script, now compatible with Pine Script v5.

Why Choose Pullback_Power?
Here are just some of the considerations you should take into account:

1) Enhanced Accuracy: Built on the strengths of its predecessors, Pullback_Power offers improved accuracy and reliability in identifying trading opportunities.

2) Non-Repainting: Say goodbye to false signals. Pullback_Power provides trustworthy indications without repainting, ensuring confidence in trading decisions and backtest results - even while using flags such as "calculate on order fills".

3) Real-Time Validation: Tested against live market conditions, it consistently delivers signals that correspond to the backtesting results.

4) Simplicity: Stripped of unnecessary complexities, my script offers a streamlined user experience.
Versionshinweise
Bug fix.
I've sorted out a bug where the script would sometimes break and not show results when using dynamic order sizes like USDT or %. I've fixed it in all the places I know about. Give me a shout if it's still giving you grief!
Versionshinweise
Feature Update: Integration of Bollinger Bands Calculation

I am pleased to announce the integration of Bollinger Bands calculation into the scripts pullback levels functionality. With this enhancement, you can now opt to include Bollinger Bands within their analyses. When activated, a Bollinger Band with a multiplier of 2 is appended to the selected source and length specified in the Open Settings.
Versionshinweise
Chart and Backtest Results Illustration:

The versatility of Pullback_Power is exemplified through various scenarios, one of which involves the HBAR/USDT pair on the Binance exchange, although at a higher risk level.
Note that no leverage or additional settings have been applied in the "Recalculate" and "Fill orders" sections.

The configuration parameters in this example are as follows:

"Only trade on weekdays?": false
"Use dynamic long positions?": true
"Data type": "4.Close"
"Source type": "3. EMA"
"Use BB calculation?": false
"Length": 4
"Offset": 1
"Leverage liquidation (1-125)": 1
"Pullback 1":-3.5
"Pullback 2":-6.5
"Pullback 3":-12.5
"Pullback 4":-19
"Use dynamic TP and SL?": true
"Length, Close": 3
"Offset, Close": 1
"Use TakeProfit?": true
"TP %": 1
"Use StopLoss?": false
"SL %": 2

The results, displayed in the image below, are particularly noteworthy, with a staggering profit margin of 6800% achieved, all without any leverage. It's important to highlight that while the profitability is high, the drawdown in this example surpasses levels for leveraging strategies.

Despite the high drawdown, it's important to acknowledge that the "Average bars in trades" remains really low. This indicates that the trades have brief durations within the market, suggesting a strategy characterized by swift turnover.

Snapshot

Feel free to explore and experiment with these settings yourself.
Versionshinweise
Here's another example, this time incorporating the newly introduced Bollinger Bands calculation feature.

Backtesting period extends back to 2017, coinciding with the launch of BNB.
Settings:
"Only trade on weekdays?": false
"Use dynamic long positions?": false
"Data type": "4.Close"
"Source type": "3. EMA"
"Use BB calculation?": true
"Length": 2
"Offset": 0
"Leverage liquidation (1-125)": 1
"Pullback 1": -4
"Pullback 2": -7
"Pullback 3": -15
"Pullback 4": -20
"Use dynamic TP and SL?": true
"Length, Close": 2
"Offset, Close": 0
"Use TakeProfit?": false
"TP %": 1
"Use StopLoss?": false
"SL %": 2

Snapshot

Feel free to delve into the details and explore the outcomes.
Versionshinweise
Feature Update:
I am pleased to announce the addition of a simple data table, located in the upper right corner of the chart. This table displays information regarding maximum consecutive wins and losses. While these values are not included in the standard "Performance Summary," they serve as valuable indicators to assess the viability of certain strategies, such as the martingale method. It is important to note, however, that while these insights are provided, the use of the martingale strategy is strongly discouraged.
Versionshinweise
Bug Fix and New Feature:

This update addresses a potential issue where the newly added data table displaying consecutive wins and losses could disrupt the loading of the chart. Additionally, a minor spelling error has been corrected.

To ensure smooth operation and prevent unexpected results, the script restricts any entries until the bar index exceeds the defined length in the "Open Settings". This restriction is visually indicated by an orange background, accompanied by explanatory text, aiding users in understanding why potential entries may not occur at the beginning of the chart.

Snapshot
Versionshinweise
### Feature Update

**Average Quantity Calculation Based on Price and Enabled Pullback Levels**

A new feature has been added to calculate the average quantities based on the price and the number of enabled pullback levels. If enabled, this calculation considers the number of pullback levels with a non-zero value, divides this number by the available trading equity, and determines the average quantity for each pullback level. Unlike the default calculation, this method ensures that each pullback level has the same quantity.

If the average quantity calculation is disabled, the default calculation remains active. As a result, each pullback level will have different quantities for entries.

#### Case 1: Default Calculation

A trader has $100 in equity, with all 4 pullback levels active.

- **Pullback Level 1** is hit at a price of $0.9:
- Quantity = $100 / 4 / $0.9 = 27.78
- **Pullback Level 2** is hit at a price of $0.8:
- Quantity = $100 / 4 / $0.8 = 31.25

#### Case 2: Average Quantity Calculation Enabled

A trader has $100 in equity, with all 4 pullback levels active. The levels are set as follows:
- Level 1 = -10%
- Level 2 = -20%
- Level 3 = -30%
- Level 4 = -40%

Assuming the MA price is $1, the quantities for each level are calculated like so:

- **Level 1**: $100 / 4 / ($1 * -10%) = 27.78
- **Level 2**: $100 / 4 / ($1 * -20%) = 31.25
- **Level 3**: $100 / 4 / ($1 * -30%) = 35.72
- **Level 4**: $100 / 4 / ($1 * -40%) = 41.67

The total possible quantities are 139.42. Dividing by the number of active pullback levels gives an average quantity of 34.85 for each level.

#### Comparison of Case 1 and Case 2

The primary difference between these cases is evident in the quantity:
- **Case 1, level 1**: Quantity = 27.78
- **Case 1, level 2**: Quantity = 31.25
- **Case 1, level 3**: Quantity = 35.72
- **Case 1, level 4**: Quantity = 41.67
- **Case 2, level 1**: Quantity = 34.85
- **Case 2, level 2**: Quantity = 34.85
- **Case 2, level 3**: Quantity = 34.85
- **Case 2, level 4**: Quantity = 34.85

For strategies where level 1 is frequently hit and closes with a profit before hitting lower levels, enabling the average quantity calculation would be more advantageous.

**Note**: If any pullback levels are disabled by setting their value to 0, this average quantity calculation will automatically activate and override the default calculation.
Versionshinweise
Bug Fix:

I identified and resolved issues where the quantity was being calculated incorrectly in certain scenarios. Occasionally, at the introduction of new coins, the equity calculated by the default quantity calculation would become negative, disrupting the rendering of strategy backtest results. Additionally, there was a limit on the number of contracts, which could also cause rendering issues if the quantity exceeded this limit. Both of these issues have been addressed and fixed in the latest version.
Versionshinweise
This update introduces enhancements to the Bollinger Bands feature. Users can now adjust the Bollinger Bands factor, allowing for greater customization. A higher factor increases volatility, potentially leading to more trades, while a lower factor results in flatter Bollinger Bands and a more conservative trading approach.

Additionally, I’ve added the option to modify the type and source of the dynamic close feature. This enables it to operate independently from the moving average (MA) entry, providing more flexibility for users to tailor the settings to their specific needs.
Versionshinweise
Display Update: I’ve added an orange line to indicate the moving average (MA) used for calculating pullback levels. Additionally, the table in the upper right corner has been expanded to include descriptions for each of the colored lines.
Versionshinweise
Bug Fix:
The dynamic calculation of pullback levels was disrupted following the display update but has now been resolved. Additionally, a truncation feature has been added to the quantity amount, allowing users to specify the number of decimal places for quantity calculations.
Versionshinweise
Minor update:
Simply removed upper capital letters on table names.
Moving AveragesVolatility

Skript nur auf Einladung

Der Zugriff auf dieses Skript ist auf vom Autor autorisierte User beschränkt und normalerweise kostenpflichtig. Sie können es zu Ihren Favoriten hinzufügen, aber Sie können es nur verwenden, nachdem Sie die Erlaubnis angefordert und vom Autor erhalten haben. Kontaktieren Sie JackTz für weitere Informationen oder folgen Sie den Anweisungen des Autors unten.

TradingView empfiehlt nicht, ein Script zu kaufen, wenn Sie den Autor nicht zu 100 % als vertrauenswürdig halten, oder nicht verstehen, wie das Script funktioniert. In vielen Fällen können Sie auch eine gute und kostenlose Open-Source-Alternative in unseren Community-Scripts entdecken.

Hinweise des Autors

Please contact me privately by clicking on the "Message" button on my TradingView profile. Please refrain from requesting access through the comments section of this script. Note: Responses over the weekend may be delayed.

Möchten Sie dieses Skript auf einem Chart verwenden?

Warnung: Bitte lesen Sie dies, bevor Sie Zugriff anfordern.

Best regards
JackT

Haftungsausschluss