TradingView
PresentTrading
16 juil. 2023 12:30

SuperTrend Enhanced Pivot Reversal - Strategy [PresentTrading] 

Ethereum / BitcoinBinance

Description


- Introduction and How it is Different
The SuperTrend Enhanced Pivot Reversal is a unique approach to trading that combines the best of two worlds: the precision of pivot reversal points and the trend-following power of the SuperTrend indicator. This strategy is designed to provide traders with clear entry and exit points, while also filtering out potentially false signals using the SuperTrend indicator.

BTCUSDT 6hr


ETHBTC 6hr


Unlike traditional pivot reversal strategies, this approach uses the SuperTrend indicator as a filter. This means that it only takes trades that align with the overall trend, as determined by the SuperTrend indicator. This can help to reduce the number of false signals and improve the overall profitability of the strategy.

The Pivot Reversal Strategy with SuperTrend Filter is particularly well-suited to the cryptocurrency market for the reason of High Volatility. This means that prices can change rapidly in a very short time, making it possible to make a profit quickly. The strategy's use of pivot points allows traders to take advantage of these rapid price changes by identifying potential reversal points


- Strategy: How it Works
The strategy works by identifying pivot reversal points, which are points in the price chart where the price is likely to reverse. These points are identified using a combination of the ta.pivothigh and ta.pivotlow functions, which find the highest and lowest points in the price chart over a certain period.

Once a pivot reversal point is identified, the strategy checks the direction of the SuperTrend indicator. If the SuperTrend is positive (indicating an uptrend), the strategy will only take long trades. If the SuperTrend is negative (indicating a downtrend), the strategy will only take short trades.

The strategy also includes a stop loss level, which is set as a percentage of the entry price. This helps to limit potential losses if the price moves in the opposite direction to the trade.

- Trade Direction
The trade direction can be set to "Long", "Short", or "Both". This allows the trader to choose whether they want to take only long trades (buying low and selling high), only short trades (selling high and buying low), or both. This can be useful depending on the trader's view of the market and their risk tolerance.

- Usage
To use the Pivot Reversal Strategy with SuperTrend Filter, simply input the desired parameters into the script and apply it to the price chart of the asset you wish to trade. The strategy will then identify potential trade entry and exit points, which will be displayed on the price chart.

- Default Settings
The default settings for the strategy are as follows:

ATR Length: 5
Factor: 2.618
Trade Direction: Both
Stop Loss Level: 20%
Commission: 0.1%
Slippage: 1
Currency: USD
Each trade: 10% of account equity
Initial capital: $10,000

These settings can be adjusted to suit the trader's preferences and risk tolerance. Always remember to test any changes to the settings using historical data before applying them to live trades.

Notes de version

Correct a mistake in the entry condition. Thanks for the report from @oldjan.
Commentaires
sentello88
In summary:

SuperTrend: This is a trending indicator that's built using the ATR (Average True Range). It gives signals about the prevailing trend.
Pivot Reversal: This is the notion that certain bars, in comparison to the bars before and after them, represent potential reversal points.
In your strategy:

When there's a pivot high (swh_cond is true) and the SuperTrend indicates a downward direction (meaning the price is below the SuperTrend line), a long entry signal is generated if the high of the current bar surpasses the pivot high.

When there's a pivot low (swl_cond is true) and the SuperTrend indicates an upward direction (meaning the price is above the SuperTrend line), a short entry signal is generated if the low of the current bar goes below the pivot low.

Stop-loss orders are set for each position to manage risk.

Regarding the recalculating (historical marker shifting) question:

In Pine Script v5, strategies by default do not recalculate. They only calculate once per bar, which means it's not repainting. However, be careful with functions like pivothigh and pivotlow since they might give an illusion of repainting as they are designed to detect highs and lows based on surrounding bars. This could make it look like a pivot was "confirmed" a few bars after the actual pivot.

Another potential point of concern is the syminfo.mintick. This gets the minimum price movement for the current symbol, which is useful for some stocks and instruments. However, if used improperly, it can cause an execution delay.
ks1267
@sentello88, You are right. There are some delays in the position. What else can be use as an alternative to prevent this delay?
PresentTrading
@sentello88, Thanks for the reply. The pivot method has an inherent delay problem. The only way to reduce the effect is by using a confirmed period.
oldjan
In fact, the SuperTrend is positive indicating an downtrend and the SuperTrend is negative indicating a uptrend.
PresentTrading
@oldjan, thanks for the report and the sharing! I have edited it and posted the correct version.
Plus