Trailing Stop SnippetThis is an example snippet that should allow for adding a trailing stop and trailing stop activation to almost any script.
You can use it by setting a trailing stop alone. This will provide you standard trailing stop functionality allowing you to lock in profits and increase your stop-loss as the price moves in your direction.
You can also set the trailing stop activation to trigger the original trailing stop at a certain level. "Once price rises 5%, set a trailing stop at break even". This would be set as 5 and 5 in the settings.
Indicateurs et stratégies
[D] Dudu 95 Strategy Template ver.1.1.Hello Guys! Nice to meet you all!
This is my Second script after changing My Profile Name!
I updated my strategy template before - I added some filter conditions (EMA, ADX, DMI).
If there's something to update, I will update this script!
Thank you!
-----
I made this based on the open source strategies by jason5480, kevinmck100, myncrypto.
Thank you All!
### Filter
1. Can Choose whether to use filter.
2. Filters Based on ATR, EMA, ADX, and DMI are ready to use.
### StopLoss
1. Can Choose Stop Loss Type: Percent, ATR, Previous Low / High.
2. Can Chosse inputs of each Stop Loss Type.
### Take Profit
1. Can set Risk Reward Ratio for Take Profit.
- To simplify backtest, I erased all other options except RR Ratio.
- You can add Take Profit Logic by adding options in the code.
2. Can set Take Profit Quantity.
### Risk Manangement
1. Can choose whether to use Risk Manangement Logic.
- This controls the Quantity of the Entry.
- e.g. If you want to take 3% risk per trade and stop loss price is 6% below the long entry price,
then 50% of your equity will be used for trade.
2. Can choose How much risk you would take per trade.
### Plot
1. Added Labels to check the data of entry / exit positions.
2. Changed and Added color different from the original one. (green: #02732A, red: #D92332, yellow: #F2E313)
Altered OBV On MACDHere is another strategy along with an indicator that is already published for everyone to use wisely in the tradingview platform. The strategy is not very planned to highlight where to enter and when to exit as it is just a system. So, it is always good practice to follow the signal of simple moving averages and that is the reason you could find those color lines in this strategy as well.
As the indicator signals the entry point, it is wise to decide what the SMA (21, 50, 90, 200) signals us. When the price oscillated around the higher timeframe of moving averages, then it is wise to wait before entering.
OBV:
The OBV is perfect indicator to understand the strength of the particular stock. As the strength increase, the trend of the stock goes high along with price. But, the OBV is considered only with close of previous close which is to make sure the double confirmation on the price to accumulate the volume .
Altered OBV:
So, here is the altered OBV, which basically consider the close of previous close and also buying interested of the day when close is higher than open.
MACD:
I always admire the magic of MACD with pre-defined timeframe. Now, this MACD applied on top of altered OBV to signal us the moving of the ticker strength.
Long:
The long entry occurs when the MACD on Altered OBV signal bullish and the same time the MACD on close already bullish.
Short
The short denotes when the MACD on Altered OBV signal bearish and at the same time the MACD on close already bearish.
I hope this would help on your swing trading strategy.
Happy Investing.
Volume Weighted Average Price STHello everyone.
I am using vwap standard deviation to find trades.
Above standard deviation 1 is buy
Below standard deviation -1 is sell
Price crossunder of vwap after Buy signal is exit for long trade
Price crossover of vwap after Sell signal is exit for short trade
You can set target points(optional)
You can limit number of trades every day.
Background color changes to gray when today range matches to ATR(14) or you can enable label to see the value at last bar
Contact me for more details if you have any queries.
BlackSwan strategyWild fluctuation of price is detected automatically, you will be informed of the black swan immediately.
Period: 1-3minutes
APIBridge Nifty Options Algo StrategyUsing Pinescript, we will use charts of Cash/Future to trade in Options. Note this strategy works well with even the free version of TradingView.
The Relative Strength Index ( RSI ). Is a momentum oscillator that measures the speed and change of price movements. The RSI oscillates between zero and 100. Increasing RSI shows increasing bullish momentum. Decreasing RSI shows increasing bearish momentum. We take RSI upper bound as 80 to indicate bullish momentum and RSI lower bound as 20 to indicate bearish momentum.
We use the above premise to create options buy-only strategy which trades in ATM strikes by default. This strategy requires very less margin (Minimum Rs . 15000).
Since this strategy uses underlying data (cash/future) to place trades in Options, please ignore the backtest of this strategy given by TradingView. TradingView does not provide options data but this strategy bypasses it.
Strategy Premise
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. The RSI oscillates between zero and 100. Increasing RSI shows increasing bullish momentum. Decreasing RSI shows increasing bearish momentum. We take RSI upper bound as 80 to indicate bullish momentum and RSI lower bound as 20 to indicate bearish momentum.
We use the above premise to create options buy-only strategy which trades in ATM strikes by default. This strategy requires very less margin (Rs. 15000 should be sufficient).
NSE Options Algo Strategy Logic
Long Entry: When RSI goes above 80, send LE in an auto-calculated option strike Call. When RSI goes below 20, send LE in auto-calculated option strike Put.
Long Exit: When we hit Stop loss or Target. In case SL/TGT does not hit and reverse RSI goes above 80 send Long Exit in auto-calculated option. Put as per last trade; RSI goes below 20, send LX in auto-calculated option call as per last trade.
For Long and Short entry the order is fired in the option buying side with auto strike price selection.
Option Strategy Parameters for TraingView Charts
RSI Length(Mandatory): Number of bars used to calculated RSI.
Upper Band(Mandatory): To specify upper band of RSI.
Lower Band(Mandatory): For specifying lower band of RSI.
Use reversal from Upper Band (Optional): This will enable short entry when RSI is falling below 80 from upper band. Recommended to keep unchecked initially.
Use reversal from Lower Band (Optional): This will enable long entry when RSI is raising above 20 from lower band. Recommended to keep unchecked initially.
Quantity: We use this specify the trade quantity (for Nifty min 75)
Custom Stop Loss in Points: Movement in chart price against the momentum which will trigger exit in options positions
Custom Target in Points: Movement in chart price against the momentum which will trigger exit in options positions
Base symbol: This is the base instrument symbol like NIFTY or BANK NIFTY.
Strike distance from ATM: Our default strike selection is considered as first ATM option (with nearest distance, only 100s are considered ). This strike distance allows to calculate ATM options which are at fixed distance.
Expiry: Expiry of option. Weekly and monthly both expiry are allowed.
Instrument: For index instrument will be OPTIDX, for stock instrument will be OPTSTK
Strategy Tag: The Strategy of Nifty options configured in Api bridge.
Setting Up Alert
Before setting up the alert make sure that you have selected desired script, time frame, strategy settings, and APIbridge configuration. Click in settings add alert and paste {{strategy.order.comment}} in message box.
Important: Do not change any settings during live trading. It may break the sequence of exit for the correct call/put.
[DuDu95] SSL 4C MACD Laugerre RSI StrategyHello Guys! Nice to meet you all!
Before I start, my nickname has changed to 'DuDu95'!!
This is the Strategy introduced by youtube channel.
I made this based on the open source indicator by kevinmck100, vkno422, KivancOzbilgic. Thank you All!
### Entry Logic
1. Long Entry Logic
- close > SSL Hybrid baseline upper k (keltner channel)
- macd signal > 0 and current MACD value > previous MACD value
- Laguerre RSI < overbought Line.
2. short Entry Logic
- close < SSL Hybrid baseline lower k (keltner channel)
- macd signal < 0 and current MACD value < previous MACD value
- Laguerre RSI > overbought Line.
### Exit Logic
1. Long Exit Logic
- close < SSL Hybrid baseline lower k (keltner channel)
- macd signal < 0
2. short Entry Logic
- close > SSL Hybrid baseline upper k (keltner channel)
- macd signal > 0
### StopLoss
1. Can Choose Stop Loss Type: Percent, ATR, Previous Low / High.
2. Can Chosse inputs of each Stop Loss Type.
### Take Profit
1. Can set Risk Reward Ratio for Take Profit.
- To simplify backtest, I erased all other options except RR Ratio.
- You can add Take Profit Logic by adding options in the code.
2. Can set Take Profit Quantity.
### Risk Manangement
1. Can choose whether to use Risk Manangement Logic.
- This controls the Quantity of the Entry.
- e.g. If you want to take 3% risk per trade and stop loss price is 6% below the long entry price,
then 50% of your equity will be used for trade.
2. Can choose How much risk you would take per trade.
### Plot
1. Added Labels to check the data of entry / exit positions.
2. Changed and Added color different from the original one. (green: #02732A, red: #D92332, yellow: #F2E313)
RSI Buy & Sell Trading ScriptThis is my first attempt at a trading script using the RSI indicator for Buy & Sell signals (so please be nice but would appreciate any constructive comments).
Starting with $100 initial capital and using 10% per trade
You can select which month the backtesting starts
There is also a monthly table (sorry can’t remember who I got this from) that shows the total monthly profits, but you’ll need to turn it on by going into settings, Properties and in the Recalculate section tick the “On every tick” box
It should do the following:
Open Buy order if the RSI > 68 and the current Moving Average is greater than the previous Moving average
• TP1 = 50% of Order at 0.4%
• TP2 = 50% of order at 0.8%
• SL = 2% below entry
• Close Buy order if the RSI < 30
Open Sell order if the RSI < 28 and the current Moving Average is less than the previous Moving average
• TP1 = 50% of Order at 0.4%
• TP2 = 50% of order at 0.8%
• SL = 2% above entry
• Close Buy order if the RSI < 60
I would like to build on this if you have any ideas/ code that could help like the following:
• Move the SL to break even when it hits TP1
• Move the SL to TP1 when TP2 hits
• Moving take profit code so I can let the some of the trade stay in play (activate if it hits 1% profit and close trade if price retracts 0.5%)
EMA + Williams Fractal Pullback [Trading Nerd]EMA Pullback Strategy with Williams Fractal Indicator
Backtesting script that searches for trends (long and short) and a following pullback into the EMAs. It enters on the first Williams Fractal in the desired direction. I found the Strategy on YouTube as a "M1 Scalping Strategy for Bitcoin".
Including fees the strategy is not profitalbe in lower timeframes (at least if not optimized). But it seems to work on higher timeframes as a swing traiding strategy.
Strategy Conditions
Longs:
EMA 1 > EMA 2 and EMA 2 > EMA 3
Number of need to be above the EMA 1
Then a Pullback into the EMAs is required
Enter on the first bullish Williams Fractal
Signal is canceled if the price closes below the EMA 3
Shorts:
EMA 1 < EMA 2 and EMA 2 < EMA 3
Number of need to be below the EMA 1
Then a Pullback into the EMAs is required
Enter on the first bearish Williams Fractal
Singal is canceled if the price closes above the EMA 3
Take Profit
A Risk Reward Take Profit is possible. If you want to use only a trailing Stop Loss, you can set the Take Profit to 'None'
Stop Loss
The default Stop Loss is EMA. If the Pullback has not reached the EMA 2, the Stop Loss is set to the EMA 2. If the Pullback has reached the EMA 2, the Stop Loss is set to the EMA 3.
Other Stop Loss types are available: ATR, HH/LL
Trailing Stop Loss
Available trailing Stop Loss types: ATR, HH/LL. Best practice is to also set the Stop Loss type to the same value.
The Stop Loss is updated if the value from the latest closed candle is greater/less than the previous value for a long/short trade.
Additional
Time Filter: Only opens trade in the defined Session. Open trades are still being closed outside of the Session.
Start Date/End Date: Limits the backtest for the defined Date Range
Trading Days: Only open Trades on the checked Days
Risk % per Trade: If enabled the Strategy uses X% of the capital (defined in Settings -> Properties -> Initial Capital)
Use Compound Interest: If enabled Capital is recalculated for every trade (initial capital + net Profit)
IMPORTANT: For low Timeframes and Markets with tight SL (like Forex) it requires a lower Margin Percent than default. Go to Settings->Properties and lower the required Long/Short Margin. Otherwise Trades might not be considered because of too less capital/marign. Margins can e.g. set to: 2% (Forex), 10% (Stocks), 20% (Crypto).
[fpemehd] Strategy TemplateHello Guys! Nice to meet you all!
This is my fourth script!
This is the Strategy Template for traders who wants to make their own strategy.
I made this based on the open source strategies by jason5480, kevinmck100, myncrypto. Thank you All!
### StopLoss
1. Can Choose Stop Loss Type: Percent, ATR, Previous Low / High.
2. Can Chosse inputs of each Stop Loss Type.
### Take Profit
1. Can set Risk Reward Ratio for Take Profit.
- To simplify backtest, I erased all other options except RR Ratio.
- You can add Take Profit Logic by adding options in the code.
2. Can set Take Profit Quantity.
### Risk Manangement
1. Can choose whether to use Risk Manangement Logic.
- This controls the Quantity of the Entry.
- e.g. If you want to take 3% risk per trade and stop loss price is 6% below the long entry price,
then 50% of your equity will be used for trade.
2. Can choose How much risk you would take per trade.
### Plot
1. Added Labels to check the data of entry / exit positions.
2. Changed and Added color different from the original one. (green: #02732A, red: #D92332, yellow: #F2E313)
[2022] MACD Cross Strategy (version 1)Early workings of a macd crossover. User inputs, strategy parameters, use on forex, crypto, stocks, etc,..
Wunder DCA BotThe bot is based on the DCA system.
1. DCA is the investment method in which you buy a certain portion of the asset after the determined price deviation.
2. For entry, we evaluate the maximum and minimum levels for a given period that you can adjust in the script. The bot enters when price rebound from the specified levels.
3. For the exit, the bot will use the take profit percentage that you will specify in settings.
It is also possible to choose how the take profit is calculated either from the average entry price or from the entry order (first order).
4. DCA uses the following settings:
- Base order Volume: Volume of your first order on entry signal
- Subsequent orders volume: The volume of all subsequent orders except the first
- DCA orders count: This parameter will determine how many entries your overall strategy will have. For example: If you will put 3, that will mean that including your initial position you will have 2 additional orders.
- DCA order price deviation:
This is the value in % which determines the deviation of the additional entries from the entry price. Example: If you go long and the price of the asset is 100$ and you put an order price deviation of 1% that will mean that the first additional entry will occur when the price will drop by 1%, and the second entry will be triggered when the overall price will drop by 2% (as the interval between the first and the second additional entry will be 1%).
- DCA Order Volume Multiplier:
This parameter will determine the amount that you put into each additional position. If this parameter is equal to 1 that means that each additional entry will be equal to the initial amount. The extra volume will be added to your position from the second DCA entry. Example: Your initial position was 10$ and your Volume Multiplier is set to 2. When you reach your 1st DCA target your additional order will have the same volume of 10$. When you reach your 2nd DCA target your additional order will be 20$ (previous position volume * multiplier). Your 3rd DCA target will place the order of 40$.
- DCA order price Deviation Multiplier:
This value will increase the price deviation between each additional entry. It is calculated as the price deviation multiplied by the deviation multiplier. For example: if you enter long at the price 100$ and have a price deviation of 1% with the price deviation multiplier of 2 that will mean that the first additional entry will occur when the price will drop to 99$ however the second will occur when the price will go to 97$. The third additional position will be entered at 94$
5. For full automation of the bot, you should set your comments to the input in the bot settings in the "LONG" and "SHORT" fields. You also need to create an alert signal and set a Webhook to send signals.
IMPORTANT!!!
1. Position calculation should take into account several factors: your deposit, leverage, the number of DCA orders, the distance to the last DCA order;
2. When choosing leverage, it is important to correctly calculate the possible drawdown. If you set a high leverage value, then liquidation awaits and the bot will not be able to take profits and will exit the position ahead of time;
3. The size of the position must be determined in accordance with all risks and take into account the size of your deposit;
4. This DCA Bot is able to earn consistently with the correct calculated money management.
volume rsi strategy by pro trader123this strategy includes volume and rsi and plots a buy signal when rsi is below 30 with high average volume and takes profit when the rsi 14 ema crosses rsi
Hull+VO+Boom StrategyThis strategy uses:
-Boom Hunter Pro with adjustments
-Hull Suite with adjustments
-Volatility Oscillator with adjustments
This is to be used with the Karbon Money Management System.
Elder Ray (Bull Power) TP and SL Developed by Dr Alexander Elder, the Elder-ray indicator measures buying
and selling pressure in the market. The Elder-ray is often used as part
of the Triple Screen trading system but may also be used on its own.
Dr Elder uses a 13-day exponential moving average (EMA) to indicate the
market consensus of value. Bull Power measures the ability of buyers to
drive prices above the consensus of value. Bear Power reflects the ability
of sellers to drive prices below the average consensus of value.
Bull Power is calculated by subtracting the 13-day EMA from the day's High.
Bear power subtracts the 13-day EMA from the day's Low.
WARNING:
- For purpose educate only
- This script to change bars colors.
Zybot STEEM/BTC - Backtest and Profit ResultsMy Strategy to Multiply Bitcoin Equity Using ZYBOT STEEM Indicator.
Pair: STEEM/BTC (this script created only for this pair)
Timeframe: 1 H
Strategy: Buy Low Sell High... that's it!
My Strategy to Multiply Bitcoin 99x Using ZYBOT STEEM IndicatorMy Strategy to Multiply Bitcoin 99x Using ZYBOT STEEM Indicator
EMA Slope AyEWe create our own indicator to calculate the slope of a 20 period EMA over the last candle.
EMA Slope AyEWe create our own indicator to calculate the slope of a 50 period EMA over the last 3 candles.
Strategy Myth-Busting #10 - InsideBar+EMA - [MYN]This is part of a new series we are calling "Strategy Myth-Busting" where we take open public manual trading strategies and automate them. The goal is to not only validate the authenticity of the claims but to provide an automated version for traders who wish to trade autonomously.
Our 10th one we are automating is the " 75% Win Rate High Profit Inside Bar Trading Strategy - What If You ... " strategy from " Trade Pro " who claims to have backtested this manually and achieved 11,063% profit with a 75% winrate over 100 trades. I was unable to emulate these results consistently accommodating for slippage and commission but even so, the results look promising. I was only able to achieve this win-rate with some multiple take profit staggering. Even so the markdown is above where I would normally consider comfortable (>20%).
If you know of or have a strategy you want to see myth-busted or just have an idea for one, please feel free to message me.
This strategy uses a combination of 2 open-source public indicators:
Inside Bar Ind/Alert by CMA
EMA (built-in)
Trading Rules
4 hour candles
Stop Loss at EMA Line with TP Target 1.5x the risk
Long Entry when these conditions are true
inside bar and bullish
Bar close's above 50 ema
Price action rises above high of inside bar .
Short Entry when these conditions are true
inside bar and bearish
Bar close below 50 ema
Price action falls below low of inside bar
[XRP][1h] Chanu Delta inspired — Breakeven StrategyHello, this is my first TV contribution. I usually don't publish anything but the script is a quick review of an other contributor (Chanu Delta V3 script )
I reverse engineered this indicator today as I wanted to test it on other contracts. The original version (which aims to be traded on BTC) has been ported to XRP (as btc and xrp prices are narrowly correlated) then modified with a couple of what I believe are improvements:
- No backtest bias even with `security` function.
- Extra backtest bias validation, always trading on next bar as Crossover/under bias is confirmed
- Backtest with 2 ajustable TP, ajustable equity and breakeven option
- The current version is not design to use pyramiding as it would require extra logic to monitor the lifecycle of the position in the context of a study.
- Commented alerts examples with variables available in script scope so you can use them in alerts (just replace strategy with indicator and remove backtest related code block).
- Trade filling assumption set to 10, fees to 0.02 as the are default bybit maker fees and I advice to enter with trailing orders using a max of 2 ticks as offset to lower fees rather than a market order!
- Backtest and Alerts happen on barclose.
- No repaint guaranteed.
There are a thousand ways to improve it (adx/bb based dynamic TP/SL, order lifecycle, pyramiding...) but it seems to be a cool starting point.
Don't forget to have fun!