I11L - Risk Adjusted LeveragingThis trading system, called "I11L - Risk Adjusted Leveraging", is designed to manage trades based on the current market volatility relative to its historical average. The system calculates the target number of open trades based on the ATR (Average True Range) indicator and adjusts the leverage accordingly. The system opens and closes trades using a pyramiding approach, allowing multiple positions to be opened at the same time.
Here's a step-by-step explanation of the system:
1. Calculate the ATR with a 14-day period and normalize it by dividing it by the current closing price.
2. Calculate the 100-day simple moving average (SMA) of the normalized ATR.
3. Calculate the ratio of the normalized ATR to its 100-day SMA.
4. Determine the target leverage based on the inverse of the ratio (2 / ratio).
5. Calculate the target number of open trades by multiplying the target leverage by 5.
6. Plot the target number of open trades and the current number of open trades on the chart.
7. Check if there's an opportunity to buy (if the current number of open trades is less than the target) or close a trade (if the current number of open trades is more than the target plus 1).
8. If there's an opportunity to buy, open a long trade and add the trade's name to the openTrades array.
9. If there's an opportunity to close a trade and there are trades in the openTrades array, close the most recent trade by referencing the array and remove it from the array.
This system aims to capture trends in the market by dynamically adjusting the number of open trades and leverage based on the market's volatility. It uses an array to keep track of open trades, allowing for better control over the opening and closing of individual trades.
Indicadores e estratégias
Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt]Someone sent me this strategy found on YouTube. It is Soheil PKO's "The Best and Most Profitable Scalping Strategy" Best way to find out is to code it =)
This strategy uses Moving Average Ribbon, Laguerre RSI, and ADX. This script only displays the MA ribbon, you will need to add Laguerre RSI and ADX separately.
Long Entry Criteria:
- 16 EMA > 48 EMA > 200 SMA
- Laguerre RSI > 80
- ADX > 20
Long Exit Criterion:
- 16 EMA < 48 EMA
Short Entry Criteria:
- 16 EMA < 48 EMA < 200 SMA
- Laguerre RSI < 20
- ADX > 20
Short Exit Criterion:
- 16 EMA > 48 EMA
As mentioned in the video, risk management is very important, especially for scalping strategies. Therefore, I've added option for setting Stop Loss and Price Target in the options for you guys to play with.
All parameters are configurable.
Enjoy~~
BankNifty 5min Supertrend Based StrategyBankNifty 5min Supertrend Based Strategy, Intraday.
Work Best at 5mint chart on BankNifty.
The strategy is designed to trade using the Supertrend indicator with session-based rules, and risk management. It allows for customization through input variables and aims to provide a clear visual representation of the Supertrend by changing the color .
The script also includes input variables for the trading session and date range, which allows the trader to specify the time period in which they want the strategy to run. The session variable specifies the start and end times of the trading session, which in this case is set to the Indian trading session from 9:15 am to 3:10 pm.
The strategy starts by defining input variables such as the session time, start and end date for the backtesting, the length of the ATR, and the Supertrend factor. It also includes options for delay at session start and stop loss points and trail percentage .
The code then checks if the current time is within the specified session and date range . If it is, the Supertrend and its direction are calculated using the defined input variables. The strategy then waits for N numbers of candles (defined by the User) to form at the start of every session i.e. 09:15 AM before entering a trade.
The entry and exit conditions for long and short trades are defined based on the change in the Supertrend direction and the number of candles formed at the session start i.e. 09:15 AM . After that, it takes entry and exit for long and short trades on the change in the Supertrend direction . Stop-loss and trailing stop-loss are also defined based on the input variables.
Stop-loss (Defined by the user) is fixed points either below or above the Entry Price for Long and Short entries.
The Supertrend plot is displayed with changing colors depending on the direction. Finally, the strategy closes all trades at the end of the session if there are any open trades.
Overall, this strategy aims to trade with the Supertrend indicator using session-based rules and risk management.
However, as with any trading strategy, it is important to thoroughly test it before using it in live trading .
SPY 1 Minute Day TraderWhen scalping options, users are looking for where breakouts are going to occur instead of sitting thru areas choppy price action that drain delta and cause them to lose value even if price is up trending. This script tries to identify when a trend reversal is expected based on one minute price action on the SPY. It alerts users to prepare for potential breakout when 5 out of the 6 key optimized parameters are discovered by showing a white L or S. Once all six trigger, it informs the user at the close of that candle with a golden triangle with Pivot Up or Pivot Down. As scalping options is something that is expected to be short in duration, a take profit and stop loss of 30 cents of price actions is established. If five or more parameters occur after the pivot is initiated, then stop losses and take profits are adhered to; however, if there are less, then it waits to take profit or stop the trade, as likely it is just noise and it will finish trend with an additional breakout.
This script has been created to take into account how the following variables impact trend for SPY 1 Minute:
ema vs 13 ema : A cross establishes start of trend
MACD (Line, Signal & Slope) : If you have momentum
ADX : if you are trending
RSI : If the trend has strength
The above has been optimized to determine pivot points in the trend using key values for these 6 indicators
bounce up = ema5 > ema13 and macdLine < .5 and adx > 20 and macdSlope > 0 and signalLine > -.1 and rsiSignal > 40
bounce down = ema5 < ema13 and macdLine > -.5 and adx > 20 and signalLine < 0 and macdSlope < 0 and rsiSignal < 60
White L's indicate that 5 of 6 conditions are met due to impending uptrend w/ missing one in green below it
Yellow L's indicate that 6 of 6 conditions still are met
White S's indicate that 5 of 6 conditions are met due to impending downtrend w/ missing condition in red above it
Yellow S's indicate that 6 of 6 conditions still are met
After a downtrend or uptrend is established, once it closes it can't repeat for 10 minutes
Won't open any trades on last two minutes of any hours to avoid volatility
Will close any open trades going into last minute of hour to avoid large overnight random swings.
Shorting when Bollinger Band Above Price with RSI (by Coinrule)The Bollinger Bands are among the most famous and widely used indicators. A Bollinger Band is a technical analysis tool defined by a set of trendlines plotted two standard deviations (positively and negatively) away from a simple moving average ( SMA ) of a security's price, but which can be adjusted to user preferences. They can suggest when an asset is oversold or overbought in the short term, thus providing the best time for buying and selling it.
The relative strength index ( RSI ) is a momentum indicator used in technical analysis. RSI measures the speed and magnitude of a security's recent price changes to evaluate overvalued or undervalued conditions in the price of that security. The RSI can do more than point to overbought and oversold securities. It can also indicate securities primed for a trend reversal or corrective pullback in price. It can signal when to buy and sell. Traditionally, an RSI reading of 70 or above indicates an overbought situation. A reading of 30 or below indicates an oversold condition.
The short order is placed on assets that present strong momentum when it's more likely that it is about to reverse. The rule strategy places and closes the order when the following conditions are met:
ENTRY
The closing price is greater than the upper standard deviation of the Bollinger Bands
The RSI is less than 70.
EXIT
The trade is closed when the RSI is less than 70
The lower standard deviation of the Bollinger Band is less than the closing price.
This strategy was backtested from the beginning of 2022 to capture how this strategy would perform in a bear market.
The strategy assumes each order to trade 70% of the available capital to make the results more realistic. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange by volume.
Simple_RSI+PA+DCA StrategyThis strategy is a result of a study to understand better the workings of functions, for loops and the use of lines to visualize price levels. The strategy is a complete rewrite of the older RSI+PA+DCA Strategy with the goal to make it dynamic and to simplify the strategy settings to the bare minimum.
In case you are not familiar with the older RSI+PA+DCA Strategy, here is a short explanation of the idea behind the strategy:
The idea behind the strategy based on an RSI strategy of buying low. A position is entered when the RSI and moving average conditions are met. The position is closed when it reaches a specified take profit percentage. As soon as the first the position is opened multiple PA (price average) layers are setup based on a specified percentage of price drop. When the price hits the layer another position with the same position size is is opened. This causes the average cost price (the white line) to decrease. If the price drops more, another position is opened with another price average decrease as result. When the price starts rising again the different positions are separately closed when each reaches the specified take profit. The positions can be re-opened when the price drops again. And so on. When the price rises more and crosses over the average price and reached the specified Stop level (the red line) on top of it, it closes all the positions at once and cancels all orders. From that moment on it waits for another price dip before it opens a new position.
This is the old RSI+PA+DCA Strategy:
The reason to completely rewrite the code for this strategy is to create a more automated, adaptable and dynamic system. The old version is static and because of the linear use of code the amount of DCA levels were fixed to max 6 layers. If you want to add more DCA layers you manually need to change the script and add extra code. The big difference in the new version is that you can specify the amount of DCA layers in the strategy settings. The use of 'for loops' in the code gives the possibility to make this very dynamic and adaptable.
The RSI code is adapted, just like the old version, from the RSI Strategy - Buy The Dips by Coinrule and is used for study purpose. Any other low/dip finding indicator can be used as well
The distance between the DCA layers are calculated exponentially in a function. In the settings you can define the exponential scale to create the distance between the layers. The bigger the scale the bigger the distance. This calculation is not working perfectly yet and needs way more experimentation. Feel free to leave a comment if you have a better idea about this.
The idea behind generating DCA layers with a 'for loop' is inspired by the Backtesting 3commas DCA Bot v2 by rouxam .
The ideas for creating a dynamic position count and for opening and closing different positions separately based on a specified take profit are taken from the Simple_Pyramiding strategy I wrote previously.
This code is a result of a study and not intended for use as a full functioning strategy. To make the code understandable for users that are not so much introduced into pine script (like myself), every step in the code is commented to explain what it does. Hopefully it helps.
Enjoy!
8 Day Run - Momentum StrategyInspired by Linda Bradford Raschke.
Entry criteria:
This strategy is used to capture momentum effects on the daily periodicities. Once prices have had a run of 8 or more consecutive closes above or below the 5-period simple moving average the strategy is primed to trade.
It will then enter a short on the first close above the 5sma after a run of 8 or more closes below the 5sma (it will enter a long when the price closes below the 5sma after a run of 8 or more closes above the 5sma).
Exit criteria:
All trades are exited on the first close back above/ below the 5sma.
Negroni MA & RSI Strategy, plus trade entry and SL/TP optionsI will start with the context, and some things to think about when using a strategy tool to back-test ideas.
CONTEXT
FIRST: This is derived from other people's work, but I honestly hadn't found a mixed indicator MA strategy tool that does what this now does. If it is out there, apologies!!
This tool can help back-test various MA trends (SMA, EMA, HMA, VWMA); as well as factoring in RSI levels (or not); and can factor in a fixed HTF MA (or not). You can apply a 'retest entry' or a 'breakout entry', and you can also apply various risk mgt for SL/TP orders: 1) No SL/TP; or 2) a fixed %, or 3) dynamic ATR multipliers.
Find below, some details explaining what this tool is attempting to do.
Thank you, tack, salute!
THINGS TO REVIEW (it is not just about 'profitability'!!)
Whilst discretion is always highly encouraged as a trader, and a 100% indicator-driven strategy is VERY unlikely to yield sustainable results going forward, at the very least back-testing your strategies can help provide some guidance, not just on win rate Vs profit factor, but other things including:
a) Trade frequency: if a strategy has an 75% win rate and profit factor of 4, with all your parameters and confluence checks, but only triggers 3 trades every 5 years, is that realistically implementable to your trading situation if you have a $10,000 account?
b) Trade entry type: is it consistently better to wait for a retest of an 'MA zone', or is it better to market buy/sell on breakout of the 'MA zone'?
c) Risk management (SL/TP): is it consistently better to have a fixed static % for SL/TP ("I always place my stops 2% away, whether it is EURUSD or BTCUSDT"), or would you be better placed to try using an ATR multiplier of the respective assets?
d) Moving average type: is your old faithful 100 EMA really serving you well, or is the classic SMA more reliable, or how about the HMA, or the VWMA? Is the 100/200 cross holding up, or do you need something more sensitive? Is there any significant difference between a 10 EMA/20 EMA trend zone compared to a 13 EMA /25 EMA zone?
e) Confluence: Do added confluence checks (RSI, higher timeframe MA) actually improve profitability? But even if they do, is at the cost of cutting too many trades?
INPUTS AND PARAMETERS
Choice 1) Entry Strategy: Retest or Breakout - You can select both!
[ ]:
a) RETEST entry strat: price crosses UNDER FastMA INTO the 'MA trend zone'.
b) BREAKOUT entry strat: price crosses OVER FastMA OUT the 'MA trend zone'.
Choice 2) Risk Management (SL and TP) - You can select more than 1 strategy!
a) No SL/TP: Long trades are closed when the LOW crosses back UNDER the fastMA again, and shorts are closed when the HIGH crosses back OVER the fastMA again.
b) Static % SL/TP: Your SL/TP will be a fixed % away from avg. position price... WARNING: You should change this for various asset classes; FX vol is not the same as crypto altcoin vol!
c) Dynamic ATR SL/TP: Your SL/TP is a multiple of your selected ATR range (default is 50, see 'info' when you select ATR range). ATR accounts for the change in vol of different asset classes somewhat, HOWEVER... you should probably still not have the same multiplier trading S&P500 as you would trading crypto altcoins!
Then select your preferred parameters: EMA, SMA, HMA, VWMA, etc. You can mix and match, and most options have a info/tooltip guide.
RSI note: If you don't care for RSI levels, then set buy signal at 1... i.e always buys! Similarly set sell signal at 99.
ATR note: standard ATR length is usually 14, however... your SL/TP will move POST entry, and can tighten or widen your initial SL/TP... for better AND usually for worse! Go find a trade (strat 3) on the chart, look at the SL/TP lines, now change the number to 5, you'll see.
Fixed HTF MA note: If you don't care for HTF MA confluence, just change the timeframe/options to match the 'Slow MA' options you've chosen.
Donchian Trend V1The Donchian Trend strategy is a trend-following approach that uses the Donchian Channels indicator to identify potential entry and exit points in a security. The Donchian Channels are formed by taking the highest high and the lowest low prices over a specified period and plotting them as upper and lower channels around the current price. The width of the channels indicates the level of volatility in the market.
In this strategy, the Donchian Channels are used as a trend filter to determine the direction of the market. When the price is above the upper channel, it suggests an uptrend, and when the price is below the lower channel, it indicates a downtrend. The length of the Donchian Channels is a key parameter in the strategy, as it determines the look-back period for identifying the high and low prices.
Additional Logic: To further refine the entry and exit signals, The script uses two moving averages, a fast one (MA5) and a slow one (MA45), to identify trends and generate trading signals. When the fast moving average crosses above the slow moving average, a buy signal is generated, indicating that the market is trending upwards. Conversely, when the fast moving average crosses below the slow moving average, a sell signal is generated, indicating that the market is trending downwards.
Evaluation: The script was backtested on historical price data for the pair. The backtest results showed that the script was able to generate a net profit of , with a profit factor of and a Sharpe ratio of . The script also includes metrics such as the number of winning and losing trades, the average trade, and the largest winning and losing trades.
The strategy is evaluated based on its net profit, gross profit, gross loss, max run-up, max drawdown, buy & hold return, Sharpe ratio, Sortino ratio, and profit factor. The parameters used in the backtest include a Donchian Channel length of 42, which corresponds to a weekly time with divide of 4h time frame, and a short-term MA of 5 and a long-term MA of 45 for more accurate entry and exit signals.
Disclaimer: This script is for educational and research purposes only and should not be used for trading with real money without further testing and validation. Past performance is not indicative of future results.
ARCHENS SHARESThis script marks the high and low of 9.45 to 10.15 price. When the price breaks high, then gives Buy signal. When the price breaks low, then it gives Sell Signal. These buy and sell signals are given with labels "ARCHENS BUY" or "ARCHENS SELL". With my observation in stock market, I have made this strategy.
This strategy works in normal candle pattern but i observed that it works well in heikenashi candle. For this strategy to work well, we have to select 5 mins heikenashi candles.
If this strategy gives "ARCHENS buy", then buy it. Target should be as per individuals mind. But Stop loss should be hitted when there are two continue opposite {red} heikenashi candle.
If this strategy gives "ARCHENS sell", then sell it. Target should be as per individuals mind. But Stop loss should be hitted when there are two continue opposite {green} heikenashi candle.
Divergence for Many [Dimkud - v5]Strategy is based on "Divergence for Many Indicators v4 ST" strategy by CannyTolany01
which is based on "Divergence for Many Indicator" indicator by LonesomeTheBlue
This strategy is searching for divergences on 18 indicators which you can select and optimise one by one.
Additionally you can connect any other External Indicator value. (just add this indicator the the chart and select option in settings)
To the original indicator/strategy I have added 9 additional indicators:
( Money Flow Index, Williams_Vix, Stochastic RSI , SMI Ergodic Oscillator, Volume Weighted MACD , Bull Bear Power, Balance of Power , Relative Volatility Index , Logistic Settings).
Converted strategy to v5 of Pine Script.
Added Static SL/TP in percents (%).
Added filters to filter enters:
1. Volume Weighted MACD - Multi-TimeFrame Filter
(It checks for histogram to falling or rising for a set periods of bars)
2. Money Flow Index - Multi-TimeFrame Filter
(It checks if MFI Oscillator is in the set diapason.
Also It checks if MFI is falling or rising for a set periods of bars )
3. ATR filter
(check changes in fast ATR to slow ATR )
Strategy shows good backtest results on many crypto tokens on 45m - 1h periods. (with parameters optimisation for every indicator)
To find best parameters - you can enable indicators one-by one, and optimise best parameters for each of them.
Then enable all indicators with successful results.
Optimise SL/TP.
Then try to enable and optimise filters (channels etc.)
The better is to optimise parameters separately for Short and Long trading. And run two separate bots (in settings enable only Long or only Short.)
Updates:
- Added visualisation for open trades (SL/TP)
- Added Volatility filter by ATR with many options for tests.
- Fixed some small bugs.
- Added second RSI filter (you can use two RSIs with different TF or settings)
- Updated ATR volatility and MFI filter. Removed non-effective options
- Added CCI filter
- Added option to Enable/Disable visualisation of TP/SL on chart
- Fixed one small quick bug. ("ATR filter short" was not working)
- Added Super Trend filter
- Added Momentum filter
- Added Volume Filter
- All "request.security" MultiTimeFrame calls changed to 100% non-repait function "f_security()"
Rsi strategy for BTC with (Rsi SPX)
I hope this strategy is just an idea and a starting point, I use the correlation of the Sp500 with the Btc, this does not mean that this correlation will exist forever!. I love Trading view and I'm learning to program, I find correlations very interesting and here is a simple strategy.
This is a trading strategy script written in Pine Script language for use in TradingView. Here is a brief overview of the strategy:
The script uses the RSI (Relative Strength Index) technical indicator with a period of 14 on two securities: the S&P 500 (SPX) and the symbol corresponding to the current chart (presumably Bitcoin, based on the variable name "Btc_1h_fixed"). The RSI is plotted on the chart for both securities.
The script then sets up two trading conditions using the RSI values:
A long entry condition: when the RSI for the current symbol crosses above the RSI for the S&P 500, a long trade is opened using the "strategy.entry" function.
A short entry condition: when the RSI for the current symbol crosses below the RSI for the S&P 500, a short trade is opened using the "strategy.entry" function.
The script also includes a take profit input parameter that allows the user to set a percentage profit target for closing the trade. The take profit is set using the "strategy.exit" function.
Overall, the strategy aims to take advantage of divergences in RSI values between the current symbol and the S&P 500 by opening long or short trades accordingly. The take profit parameter allows the user to set a specific profit target for each trade. However, the script does not include any stop loss or risk management features, which should be considered when implementing the strategy in a real trading scenario.
MVRV Z Score and MVRV Free Float Z-ScoreIMPORTANT: This script needs as much historic data as possible. Please run it on INDEX:BTCUSD , BNC:BLX or another chart of sufficient length.
MVRV
The MVRV (Market Value to Realised Value Ratio) simply divides bitcoins market cap by bitcoins realized market cap. This was previously impossible on Tradingview but has now been made possible thanks to Coinmetrics providing us with the realized market cap data.
In the free float version, the free float market cap is used instead of the regular market cap.
Z-Score
The MVRV Z-score divides the difference between Market cap and realized market cap by the historic standard deviation of the market cap.
Historically, this has been insanely accurate at detecting bitcoin tops and bottoms:
A Z-Score above 7 means bitcoin is vastly overpriced and at a local top.
A Z-Score below 0.1 means bitcoin is underpriced and at a local bottom.
In the free float version, the free float market cap is used instead of the regular market cap.
The Z-Score, also known as the standard score is hugely popular in a wide range of mathematical and statistical fields and is usually used to measure the number of standard deviations by which the value of a raw score is above or below the mean value of what is being observed or measured.
Credits
MVRV Z Score initially created by aweandwonder
MVRV initially created by Murad Mahmudov and David Puell
Fibonacci Moving Averages Input(FibMAI) Fibonacci Moving Averages Input is a strategy based on moving averages cross-over or cross-under signals. The bullish golden cross appears on a chart when a stock's short-term moving average crosses above its long-term moving average. The bearish death cross appears on a chart when a stock’s short-term moving average, crosses below its long-term moving average. The general market consensus values used are the 50-day moving average and the 200-day moving average.
With the (FibMAI) Fibonacci Moving Averages Input strategy you can use any value you choose for your bullish or bearish cross. For visual display purposes I have a lot of the Fib Moving Averages 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 shown while hiding the chart candlesticks. But to use this indicator I click on only a couple of MA's to see if there's a notable cross-over or cross-under pattern signal. Then, most importantly, I back test those values into the FibMAI strategy Long or Short settings input.
For example, this NQ1! day chart has it's Long or Short settings input as follows:
Bullish =
FibEMA34
cross-over
FibEMA144
Bearish =
FibEMA55
cross-under
FibSMA144
As you can see you can mix or match 4 different MA's values either Exponential or Simple.
Default color settings:
Rising value = green color
Falling value = red color
Default Visual FibMA settings:
FibEMA's 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181
Default Visual MA settings:
SMA's 50, 100, 150, 200
Default Long or Short settings:
Bullish =
FibEMA34
cross-over
FibEMA144
Bearish =
FibEMA55
cross-under
FibSMA144
Strategy for UT Bot Alerts indicator Using the UT Bot alerts indicator by @QuantNomad, this strategy was designed for showing an example of how this indicator could be used, also, it has the goal to help some people from a group that use to use this indicator for their trading. Under any circumstance I recommend to use it without testing it before in real time.
Backtesting context: 2020-02-05 to 2023-02-25 of BTCUSD 4H by Tvc. Commissions: 0.03% for each entry, 0.03% for each exit. Risk per trade: 2.5% of the total account
For this strategy, 3 indicators are used:
UT Bot Alerts indicator by Quantnomad
One Ema of 200 periods for indicate the trend
Atr stop loss from Gatherio
Trade conditions:
For longs:
Close price is higher than Atr from UT Bot
Ema from UT Bot cross over Atr from UT Bot.
This gives us our long signal. Stop loss will be determined by atr stop loss (white point), break even(blue point) by a risk/reward ratio of 0.75:1 and take profit of 3:1 where half position will be closed. This will be showed as buy (open long position)
The other half will be closed when close price is lower than Atr and Ema from UT Bot cross under Atr. This will be showed as cl buy (close long position)
For shorts:
Close price is lower than Atr from UT Bot
Ema from UT Bot cross over Atr from UT Bot.
This gives us our short signal. Stop loss will be determined by atr stop loss (white point), break even(blue point) by a risk/reward ratio of 0.75:1 and take profit of 3:1 where half position will be closed. This will be showed as sell (open short position)
The other half will be closed when close price is higher than Atr and Ema from UT Bot cross over Atr. This will be showed as cl sell (close short position)
Risk management
For calculate the amount of the position you will use just a small percent of your initial capital for the strategy and you will use the atr stop loss for this.
Example: You have 1000 usd and you just want to risk 2,5% of your account, there is a long signal at price of 20,000 usd. The stop loss price from atr stop loss is 19,000. You calculate the distance in percent between 20,000 and 19,000. In this case, that distance would be of 5,0%. Then, you calculate your position by this way: (initial or current capital * risk per trade of your account) / (stop loss distance).
Using these values on the formula: (1000*2,5%)/(5,0%) = 500usd. It means, you have to use 500 usd for risking 2.5% of your account.
We will use this risk management for apply compound interest.
In settings, with position amount calculator, you can enter the amount in usd of your account and the amount in percentage for risking per trade of the account. You will see this value in green color in the upper left corner that shows the amount in usd to use for risking the specific percentage of your account.
Script functions
Inside of settings, you will find some utilities for display atr stop loss, break evens, positions, signals, indicators, etc.
You will find the settings for risk management at the end of the script if you want to change something. But rebember, do not change values from indicators, the idea is to not over optimize the strategy.
If you want to change the initial capital for backtest the strategy, go to properties, and also enter the commisions of your exchange and slippage for more realistic results.
In risk managment you can find an option called "Use leverage ?", activate this if you want to backtest using leverage, which means that in case of not having enough money for risking the % determined by you of your account using your initial capital, you will use leverage for using the enough amount for risking that % of your acount in a buy position. Otherwise, the amount will be limited by your initial/current capital
---> Do not forget to deactivate Trades on chart option in style settings for a cleaner look of the chart <---
Some things to consider
USE UNDER YOUR OWN RISK. PAST RESULTS DO NOT REPRESENT THE FUTURE.
DEPENDING OF % ACCOUNT RISK PER TRADE, YOU COULD REQUIRE LEVERAGE FOR OPEN SOME POSITIONS, SO PLEASE, BE CAREFULL AND USE CORRECTLY THE RISK MANAGEMENT
Do not forget to change commissions and other parameters related with back testing results!
Strategies for trending markets use to have more looses than wins and it takes a long time to get profits, so do not forget to be patient and consistent !
---> The strategy can still be improved, you can change some parameters depending of the asset and timeframe like risk/reward for taking profits, for break even, also the main parameters of the UT Bot Alerts <----
NIFTY 50 5mint StrategyThis is an intraday strategy for NIFTY50 Based First candle High and Low breakout.
The strategy takes user inputs for the start and end dates, start and end months, and start and end years, which define the time range to trade. The user can also specify the maximum number of trades to take during the time range and the length of the Exponential Moving Average ( EMA ) used in the strategy
In this strategy, the First candle's high and low are calculated and used as entry and exit points for trades. If the close price breaks above the First candle's high, a buy signal is generated. Conversely, if the close price breaks below the First candle's low, a sell signal is generated.
The strategy uses the Exponential Moving Average ( EMA ) as a filter to close entered positions either long or short, EMA also acts Target. If the close price falls below the EMA, a long position is closed, and if the close price rises above the EMA, a short position is closed or the PreviousCandleClose is above the First candle's high a short position is closed, When the PreviousCandleClose is below the First candle's low a long position is closed, First candle's high act as Stoploss
The strategy limits the number of trades taken within the specified time range, and if the time range is exceeded, all positions are closed.
Finally, the strategy plots the First candle's high and low, EMAs on the chart for visual reference.
Default settings work best with the 5mint candle, you may tweak settings according to your needs.
backtesting helps in interpreting how the trading strategy would have behaved in the past, and forward testing (paper trading) informs the traders how it would perform now.
Bollinger Band BreakoutThis strategy buys when price crosses above an upper Bollinger Band and sells when the lower band is breached. What makes this strategy different than others:
Long only with filtering for only showing strong tickers
Filter out trades below a moving average on both the current timeframe and a longer period timeframe to keep you out of bear markets
Optional ability to set a tighter initial stop level to increase exposure and decrease downside risk on freshly opened trades while you wait for the lower Bollinger Band trailing stop to catch up
Take entries/exits on wicks/stops or wait for candle closes before entry
Select which dates to backtest
Customize Bollinger Band parameters including the ability to have different values for the upper and lower band standard deviation
Baseline Cross Qualifier Volatility Strategy with HMA Trend BiasFor trading ES on 30min Chart
Trading Rules
Post Baseline Cross Qualifier (PBCQ): If price crosses the baseline but the trade is invalid due to additional qualifiers, then the strategy doesn't enter a trade on that candle. This setting allows you override this disqualification in the following manner: If price crosses XX bars ago and is now qualified by other qualifiers, then the strategy enters a trade.
Volatility: If price crosses the baseline, we check to see how far it has moved in terms of multiples of volatility denoted in price (ATR x multiple). If price has moved by at least "Qualifier multiplier" and less than "Range Multiplier", then the strategy enters a trade. This range is shown on the chart with yellow area that tracks price above/blow the baseline. Also, see the dots at the top of the chart. If the dots are green, then price passes the volatility test for a long. If the dots are red, then price passes the volatility test for a short.
Take Profit/Stoploss Quantity Removed
1 Take Profit: 100% of the trade is closed when the profit target or stoploss is reached.
2 Take Profits: Quantity is split 50/50 between Take Profit 1 and Take Profit 2
3 Take Profits: Quantify is split 50/25/25.
Stratgey Inputs
Baseline Length
37
Post Baseline Cross Qualifier Enabled
On
Post Baseline Cross Qualifier Bars Ago
9
ATR Length
9
Volatility Multiplier
0
Volatility Range Multiplier
10
Volatility Qualifier Multiplier
2
Take Profit Type
1 Take Profit
HMA Length
11
Combined Strategy Trading Bot (RSI ADX 20SMA)Trading Bot V1, This code implements a combined trading strategy that uses several indicators and strategies to make buy and sell decisions in the market. The code is written in Pine Script™, which is a programming language used in the TradingView platform. By BraelonWhitfield.Eth
The strategy uses the Average Directional Movement Index (ADX) and the Pine SuperTrend indicator to identify trends and price movements in the market. The SuperTrend indicator is a popular technical analysis tool that helps to identify the direction of the current trend and provides entry and exit points for trades.
The strategy also uses the Relative Strength Index (RSI) to identify overbought and oversold conditions in the market. The RSI is a momentum indicator that measures the speed and change of price movements in the market.
The first part of the code defines the inputs for the ADX and DI Length, which are used to calculate the ADX and DI values. The dirmov() function is used to calculate the positive and negative directional indicators (plusDM and minusDM) based on the high and low prices. The truerange variable is then calculated using the True Range (TR) formula. Finally, the plus and minus variables are calculated using the smoothed moving average of the plusDM and minusDM values.
The adx() function is then used to calculate the ADX values based on the plus and minus variables. The Pine SuperTrend indicator is defined using the pine_supertrend() function. This function uses the high-low average (hl2) and the Average True Range (ATR) to calculate the upper and lower bands for the indicator. The direction of the current trend is then determined based on whether the current price is above or below the upper or lower bands.
The RSI values are then calculated using the ta.rsi() function, with the inputs for the close price and the RSI period. The overbought and oversold conditions are defined using the OB and OS inputs, which specify the threshold values for the RSI. The upTrend and downTrend variables are defined based on the direction of the Pine SuperTrend indicator.
The next part of the code defines the 20-period Simple Moving Average (SMA) using the ta.sma() function. The os and ob variables are then calculated based on the RSI values and the OB and OS inputs. The strategy.entry() function is used to define the buy and sell orders based on the upTrend and downTrend variables, as well as the Pine SuperTrend indicator, the 20-period SMA, and the os variable.
The final part of the code defines the Channel Breakout Strategy using the ta.highest() and ta.lowest() functions to calculate the upper and lower bounds of the channel. The strategy.entry() function is then used to define the buy and sell orders based on whether the current price is above or below the upper or lower bounds.
In summary, this code implements a combined trading strategy that uses several indicators and strategies to make buy and sell decisions in the market. The strategy is designed to identify trends and price movements in the market, as well as overbought and oversold conditions, to provide entry and exit points for trades. The strategy uses the Pine SuperTrend indicator, the ADX and DI indicators, the RSI, and the 20-period SMA, as well as the Channel Breakout Strategy to make informed trading decisions.
Ema ScalpThis is another simple strategy based on ema
Entry Buy - 1) when close crossover ema then buy and only open one trade till it not close
2) if previous buy trade is profitable open another trade and check again trade is profitable or not
3)if trade is not profitable reset and wait for sell condition...
Entry Sell -1) when close crossunder ema then sell and only open one trade till it not close
2) if previous sell trade is profitable open another trade and check again trade is profitable or not
3) if trade is not profitable reset and wait for buy condition.....
stop loss and take profit is percentage based ...
Investments/swing trading strategy for different assetsStop worrying about catching the lowest price, it's almost impossible!: with this trend-following strategy and protection from bearish phases, you will know how to enter the market properly to obtain benefits in the long term.
Backtesting context: 1899-11-01 to 2023-02-16 of SPX by Tvc. Commissions: 0.05% for each entry, 0.05% for each exit. Risk per trade: 2.5% of the total account
For this strategy, 5 indicators are used:
One Ema of 200 periods
Atr Stop loss indicator from Gatherio
Squeeze momentum indicator from LazyBear
Moving average convergence/divergence or Macd
Relative strength index or Rsi
Trade conditions:
There are three type of entries, one of them depends if we want to trade against a bearish trend or not.
---If we keep Against trend option deactivated, the rules for two type of entries are:---
First type of entry:
With the next rules, we will be able to entry in a pull back situation:
Squeeze momentum is under 0 line (red)
Close is above 200 Ema and close is higher than the past close
Histogram from macd is under 0 line and is higher than the past one
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
For closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
Second type of entry:
With the next rules, we will not lose a possible bullish movement:
Close is above 200 Ema
Squeeze momentum crosses under 0 line
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
Like in the past type of entry, for closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
---If we keep Against trend option activated, the rules are the same as the ones above, but with one more type of entry. This is more useful in weekly timeframes, but could also be used in daily time frame:---
Third type of entry:
Close is under 200 Ema
Squeeze momentum crosses under 0 line
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
Like in the past type of entries, for closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
Risk management
For calculating the amount of the position you will use just a small percent of your initial capital for the strategy and you will use the atr stop loss for this.
Example: You have 1000 usd and you just want to risk 2,5% of your account, there is a buy signal at price of 4,000 usd. The stop loss price from atr stop loss is 3,900. You calculate the distance in percent between 4,000 and 3,900. In this case, that distance would be of 2.50%. Then, you calculate your position by this way: (initial or current capital * risk per trade of your account) / (stop loss distance).
Using these values on the formula: (1000*2,5%)/(2,5%) = 1000usd. It means, you have to use 1000 usd for risking 2.5% of your account.
We will use this risk management for applying compound interest.
In settings, with position amount calculator, you can enter the amount in usd of your account and the amount in percentage for risking per trade of the account. You will see this value in green color in the upper left corner that shows the amount in usd to use for risking the specific percentage of your account.
Script functions
Inside of settings, you will find some utilities for display atr stop loss, break evens, positions, signals, indicators, etc.
You will find the settings for risk management at the end of the script if you want to change something. But rebember, do not change values from indicators, the idea is to not over optimize the strategy.
If you want to change the initial capital for backtest the strategy, go to properties, and also enter the commisions of your exchange and slippage for more realistic results.
If you activate break even using rsi, when rsi crosses under overbought zone break even will be activated. This can work in some assets.
---Important: In risk managment you can find an option called "Use leverage ?", activate this if you want to backtest using leverage, which means that in case of not having enough money for risking the % determined by you of your account using your initial capital, you will use leverage for using the enough amount for risking that % of your acount in a buy position. Otherwise, the amount will be limited by your initial/current capital---
Some things to consider
USE UNDER YOUR OWN RISK. PAST RESULTS DO NOT REPRESENT THE FUTURE.
DEPENDING OF % ACCOUNT RISK PER TRADE, YOU COULD REQUIRE LEVERAGE FOR OPEN SOME POSITIONS, SO PLEASE, BE CAREFULL AND USE CORRECTLY THE RISK MANAGEMENT
Do not forget to change commissions and other parameters related with back testing results!
Some assets and timeframes where the strategy has also worked:
BTCUSD : 4H, 1D, W
SPX (US500) : 4H, 1D, W
GOLD : 1D, W
SILVER : 1D, W
ETHUSD : 4H, 1D
DXY : 1D
AAPL : 4H, 1D, W
AMZN : 4H, 1D, W
META : 4H, 1D, W
(and others stocks)
BANKNIFTY : 4H, 1D, W
DAX : 1D, W
RUT : 1D, W
HSI : 1D, W
NI225 : 1D, W
USDCOP : 1D, W
Kimchi Premium StrategyThis strategy is based on the Korea Premium, also known as the “Kimchi Premium,” which indicates how expensive or cheap the price of Bitcoin in Korean Won on a Bitcoin exchange in South Korea is relative to the price of Bitcoin being traded in USD or Tether. Inverse Kimchi Premium RSI was newly defined to create a strategy with Kimchi Premium. Assuming that the larger the kimchi premium, the greater the individual's purchasing power. In this case, if the Inverse Kimchi Premium RSI falls and closes the candle below the bear level, a short is triggered. Long is the opposite.
This strategy defaults to a combination of the traditional RSI and the Inverse Kimchi Premium RSI. If the user wishes to unlock the Inverse Kimchi Premium RSI combination and only use it as a traditional RSI strategy, the following settings can be used.
Use Combination of Inverse Kimchi Premium RSI: Uncheck
Resolution: Chart (4hr Candle)
Source: Close
Length of RSI: 14
Bull Level: 74
Bear Level: 25
__________________________________________________________________________________
김치프리미엄(김프) 전략은 달러 혹은 테더로 거래되고 있는 비트코인 가격 대비 한국에 있는 비트코인 거래소의 비트코인 원화 가격이 얼마나 비싸고 싼 지를 나타내는 코리아 프리미엄, 일명 "김치 프리미엄" 지표를 기반으로 만들어졌습니다. 김치 프리미엄을 가지고 전략을 만들기위해 Inverse Kimchi Premium RSI를 새롭게 정의하였습니다. 김치 프리미엄이 커질수록 개인의 매수세가 커진다고 가정하고, 이 경우 Inverse Kimchi Premium RSI이 하락하여 Bear Level 아래에서 캔들 마감을 하면 Short을 트리거 합니다. Long은 그 반대입니다.
이 전략은 전통적인 RSI와 Inverse Kimchi Premium RSI을 조합하여 기본값을 설정하였습니다. 유저가 원한다면 Inverse Kimchi Premium RSI의 조합을 해제하고 전통적인 RSI 전략으로만 사용하려면 아래 다음의 설정값을 사용할 수 있습니다.
Use Combination of Inverse Kimchi Premium RSI: 체크 해제
Resolution: Chart (4hr Candle)
Source: Close
Length of RSI: 14
Bull Level: 74
Bear Level: 25
Athena Momentum Squeeze - Short, Lean, and Mean This is a very profitable strategy focusing on 15 minute intervals on the Micro Nasdaq Futures contracts. CME_MINI:MNQH2023
As this contract only keeps positions for on average about an hour risk is managed. At a profit factor of 3.382 with a max drawdown of $123 from January 1st to February 15. Looking back to Dec 2019 still maintains a profit factor of 1.3.
See backtesting: www.screencast.com
2019 backtesting: www.screencast.com
Based on the classic Lazy Bear Oscillator Squeeze with a number of modifications from ADX, MAs and adding fibonacci levels.
We like keeping strategies simple yet powerful, no completely where you can't understand your own trades.
Our team is always modifying and improving the strategy. Always open to collaborating on improving as there is no perfect strategy. www.screencast.com