OPEN-SOURCE SCRIPT

DCA, Support and Resistance with RSI and Trend Filter

מעודכן
This script is based on
tradingview.com/v/8avMvSbe/ script from Kieranj with added pyramiding and DCA

The buy condition (buyCondition) is triggered when the RSI crosses above the oversold threshold (ta.crossover(rsi, oversoldThreshold)), the trend filter confirms an uptrend (isUptrend is true), and the close price is greater than or equal to the support level (close >= supportLevel).

The partial sell condition (sellCondition) is triggered when the RSI crosses below the overbought threshold (ta.crossunder(rsi, overboughtThreshold)) and profit goal is reached, the trend filter confirms a downtrend (isUptrend is false), and the close price is less than or equal to the resistance level (close <= resistanceLevel).
Full sell will be triggered if trend is broken and profit goal is reached

With this implementation, the signals will only be generated in the direction of the trend on the 4-hour timeframe. The trend is considered up when the 50-period SMA is below the 200-period SMA (ta.sma(trendFilterSource, 50) < ta.sma(trendFilterSource, 200)).

Pyramiding should be activated, values like 100, so every DCA step should be around 1%
i have best results on 5 min charts
הערות שחרור
-Added Wavetrend as additional indicator for buying/selling
-Set all default parameters same as i doing backtests.
-other small fixes
הערות שחרור
Added new option:
Using g trend as trend filter module:
tradingview.com/v/utIrJYJS/
thanks LUIS_GANDARA_G_TREND
הערות שחרור
- Added MCAD as trend indicator

- Reworked multi time frames :
The strategy working now on 3 time frames
1. Time frame where buy/sell signals on base of Wavetrend(default is on) and RSI are triggered. I'm using 5 min.
2-3. Slow and fast trend time frames. Signals from time frame 1 are ignored if on this time frames RSI or Trend (MCAD or G trend) conditions are not meet. I'm using 15 min and 4 hours.
הערות שחרור
- in previous post index was of course MACD, cant edit anymore
- Added new option for cooldown between orders
- fixed several bugs, specially on short side trading
הערות שחרור
- added new option: based on ATR partial sells can be deactivated
- updated default values
הערות שחרור
- Fixed repainting, needed to remove all indicators except MACD for it for now, but MACD has the best performance anyway
הערות שחרור
-- other repainting fix
הערות שחרור
- fix, negative numbers in % profit goals working now, maybe good in some situations.
הערות שחרור
- new options on fast and slow filters for full sells if wrong direction, it was hard coded till now
- new options for threshold entries on slow trend filter, filter is not activated till threshold amount of entries is reached
הערות שחרור
--Added new parameter for slow trend:
"Threshold profit %", slow trend filter will be disabled if current profit bigger then this value, default -2.
הערות שחרור
-- fixed bug: profit and profit outside trend made exactly opposite
-- added new parameter: profit on high ATR (was the same as profit outside trend before)
-- added new parameter: source, was hard coded to close before, default close
-- added better comments to chart
הערות שחרור
-- Added ichimoku cloud as trend filter (default will stay MACD)
-- Changed default MACD source from SMA to EMA
-- Bugfix: heikinashi and MACD
הערות שחרור
-- added Volatility Gaussian Bands [BigBeluga]
Volatility Gaussian Bands [BigBeluga]
as trend filter, default is disabled, the strategy should work as before.

הערות שחרור
-- bugfix: fixed wrong executed part. sells in today release
הערות שחרור
--Added additional full sell signals on fast and slow trends
Stochastic RSI (STOCH RSI)Wave Analysis

סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?

כתב ויתור