Backtests Are BrokenThis script demonstrates a fatal flaw with Trading View backtests involving trailing stops. Trading View assumes the most optimistic case for trailing stops, always giving you the best case high/low of a bar instead of the worst or average case. Within a bar, the price could reverse against your position after the open and trigger your trailing stop for a loss before the price goes in your favor, but Trading View backtests do not consider this and instead always give you the best case returns. This allows a trivial strategy to appear as though it would perform miracles.
This strategy enters on a random bar and sets a trailing stop triggered one tick better than the current price with 0 trailing distance. Trading View then generously gives this strategy the difference between the open price and best possible wick as a profit. The only way this strategy can lose money in simulation is if the price goes straight down after entry and never retraces. It works on all symbols on all timeframes due to this systematic problem with the Trading View backtester.
Chỉ báo và chiến lược
Volatility SystemDespite its crude name, the volatility system strategy, described by Richard Bookstaber in 1984, follows the simple premise that once there is a big volatile movement, the market tends to follow it. Thus, it uses the ATR to measure the volatility, and issues orders when the current change of the closing price exceeds the threshold, calculated by the ATR times a configurable constant.
It yields good results for some very specific charts, as you can see. However, I doubt it would work in the current market conditions, since it has no stop loss and no take profit , and the current noise levels obliterate this strategy, especially in small time frames. Maybe their integration to the strategy would yield better results, so feel free to add your own modifications.
Double Inside Bar & Trend Strategy - KaspricciDouble Inside Bar & Trend Strategy - Kaspricci
This strategy combines the Double Inside Bar candlestick pattern with a trend filter. Once the second inside bar closes and price is above trend moving average, a buy stop order is placed at high of the candle. If price is below trend moving average, a sell stop order is placed at the low of the candle.
This strategy is for educational purposes only! It is not meant to be a financial advice.
Settings
Trend source, type of moving average and length for calculating trend
Stop Loss Type - default: ATR. You can switch between stop loss calculation based on Average True Range value or fixed value.
ATR Length / Factor / TP Ratio - default: 14 / 2.0 / 2.0. Used to calculate the Stop Loss as ATR * Factor and Take Profit as Stop Loss * TP Ratio.
FIX Stop Loss / Take Profit - default: 10 pips / 20 pips. In case you select Stop Loss Type = FIX, these value swill be used.
Risk in % - default: 1%, option to adjust the quantity of a trade based on a defined risk percentage. If enabled, it will overwrite the quantity parameter of the strategy settings.
On top you can filter trades by start and end date as well as time of the day.
Click Draw TrendLine [UhoKang] v2
This is an indicator that directly draws a trend line by clicking on the candle.
Click to Create Trend lines !!
Create a trend line by connecting A, B, and C with three vertices.
1. Draw Bear Trend line
Click pivot high : First pivothigh of the downtrend line
Click pivot low : pivotlow of the downtrend line
Click pivot high : Second pivothigh of the downtrend line
2. Draw Bull Trend line
Click pivot low : First pivotlow of the uptrend line
Click pivot high : pivothigh of the uptrend line
Click pivot low : Second pivotlow of the uptrend line
Modefiy Trendlines
1. Edit Bear Trend line
Drag Red , ,
2. Edit Bull Trend line
Drag Green , ,
EMA RSI Strategy
Simple strategy
=============
If the last two closes are in ascending order, the rsi is below 50 and ascending, and the current candle is above 200 ema, then LONG. If the last two closes are in descending order, the rsi is above 50 and descending, and the current candle is below 200 ema, then SHORT.
LONG Exit strategy:
ATR: Last 14 day
Lowest: The lowest value of the last 14 candles
Limit points = (Trade Price - Lowest + ATR) * 100000
trail_points : Limit/2
trail_offset = Limit/2
SHORT Exit strategy:
ATR: Last 14 day
Highest: The higher value of the last 14 candles
Limit points = (Trade Price - Highest + ATR) * 100000
trail_points : Limit/2
trail_offset = Limit/2
Backtest results for the AUDUSD pair gave positive results over the last three months.
I am testing this strategy using a python bot in a real environment this week and will update the results at the end of the week.
Disclaimer
This is not financial advice. You should seek independent advice to check how the strategy information relates to your unique circumstances.
We are not liable for any loss caused, whether due to negligence or otherwise arising from the use of, or reliance on, the information provided directly or indirectly by this strategy.
Linear EDCA v1.2Strategy Description:
Linear EDCA (Linear Enhanced Dollar Cost Averaging) is an enhanced version of the DCA fixed investment strategy. It has the following features:
1. Take the 1100-day SMA as a reference indicator, enter the buy range below the moving average, and enter the sell range above the moving average
2. The order to buy and sell is carried out at different "speed", which are set with two linear functions, and you can change the slope of the linear function to achieve different trading position control purposes
3. This fixed investment is a low-frequency strategy and only works on a daily level cycle
----------------
Strategy backtest performance:
BTCUSD (September 2014~September 2022): Net profit margin 26378%, maximum floating loss 47.12% (2015-01-14)
ETHUSD (August 2018~September 2022): Net profit margin 1669%, maximum floating loss 49.63% (2018-12-14)
----------------
How the strategy works:
Buying Conditions:
The closing price of the day is below the 1100 SMA, and the ratio of buying positions is determined by the deviation of the closing price from the moving average and the buySlope parameter
Selling Conditions:
The closing price of the day is above the 1100 SMA, and the ratio of the selling position is determined by the deviation of the closing price and the moving average and the sellSlope parameter
special case:
When the sellOffset parameter>0, it will maintain a small buy within a certain range above the 1100 SMA to avoid prematurely starting to sell
The maximum ratio of a single buy position does not exceed defInvestRatio * maxBuyRate
The maximum ratio of a single sell position does not exceed defInvestRatio * maxSellRate
----------------
Version Information:
Current version v1.2 (the first officially released version)
v1.2 version setting parameter description:
defInvestRatio: The default fixed investment ratio, the strategy will calculate the position ratio of a single fixed investment based on this ratio and a linear function. The default 0.025 represents 2.5% of the position
buySlope: the slope of the linear function of the order to buy, used to control the position ratio of a single buy
sellSlope: the slope of the linear function of the order to sell, used to control the position ratio of a single sell
sellOffset: The offset of the order to sell. If it is greater than 0, it will keep a small buy within a certain range to avoid starting to sell too early
maxSellRate: Controls the maximum sell multiple. The maximum ratio of a single sell position does not exceed defInvestRatio * maxSellRate
maxBuyRate: Controls the maximum buy multiple. The maximum ratio of a single buy position does not exceed defInvestRatio * maxBuyRate
maPeriod: the length of the moving average, 1100-day MA is used by default
smoothing: moving average smoothing algorithm, SMA is used by default
useDateFilter: Whether to specify a date range when backtesting
settleOnEnd: If useDateFilter==true, whether to close the position after the end date
startDate: If useDateFilter==true, specify the backtest start date
endDate: If useDateFilter==true, specify the end date of the backtest
investDayofweek: Invest on the day of the week, the default is to close on Monday
intervalDays: The minimum number of days between each invest. Since it is calculated on a weekly basis, this number must be 7 or a multiple of 7
The v1.2 version data window indicator description (only important indicators are listed):
MA: 1100-day SMA
RoR%: floating profit and loss of the current position
maxLoss%: The maximum floating loss of the position. Note that this floating loss represents the floating loss of the position, and does not represent the floating loss of the overall account. For example, the current position is 1%, the floating loss is 50%, the overall account floating loss is 0.5%, but the position floating loss is 50%
maxGain%: The maximum floating profit of the position. Note that this floating profit represents the floating profit of the position, and does not represent the floating profit of the overall account.
positionPercent%: position percentage
positionAvgPrice: position average holding cost
--------------------------------
策略说明:
Linear EDCA(Linear Enhanced Dollar Cost Averaging)是一个DCA定投策略的增强版本,它具有如下特性:
1. 以1100日SMA均线作为参考指标,在均线以下进入定买区间,在均线以上进入定卖区间
2. 定买和定卖以不同的“速率”进行,它们用两条线性函数设定,并且你可以通过改变线性函数的斜率,以达到不同的买卖仓位控制的目的
3. 本定投作为低频策略,只在日级别周期工作
----------------
策略回测表现:
BTCUSD(2014年09月~2022年09月):净利润率26378%,最大浮亏47.12%(2015-01-14)
ETHUSD(2018年08~2022年09月):净利润率1669%,最大浮亏49.63%(2018-12-14)
----------------
策略工作原理:
买入条件:
当日收盘价在 1100 SMA 之下,由收盘价和均线的偏离度,以及buySlope参数决定买入仓位比例
卖出条件:
当日收盘价在 1100 SMA之上,由收盘价和均线的偏离度,以及sellSlope参数决定卖出仓位比例
特例:
当sellOffset参数>0,则在 1100 SMA以上一定范围内还会保持小幅买入,避免过早开始卖出
单次买入仓位比例最大不超过 defInvestRatio * maxBuyRate
单次卖出仓位比例最大不超过 defInvestRatio * maxSellRate
----------------
版本信息:
当前版本v1.2(第一个正式发布的版本)
v1.2版本设置参数说明:
defInvestRatio: 默认定投比例,策略会根据此比例和线性函数计算得出单次定投的仓位比例。默认0.025代表2.5%仓位
buySlope: 定买的线性函数斜率,用来控制单次买入的仓位倍率
sellSlope: 定卖的线性函数斜率,用来控制单次卖出的仓位倍率
sellOffset: 定卖的偏移度,如果大于0,则在一定范围内还会保持小幅买入,避免过早开始卖出
maxSellRate: 控制最大卖出倍率。单次卖出仓位比例最大不超过 defInvestRatio * maxSellRate
maxBuyRate: 控制最大买入倍率。单次买入仓位比例最大不超过 defInvestRatio * maxBuyRate
maPeriod: 均线长度,默认使用1100日MA
smoothing: 均线平滑算法,默认使用SMA
useDateFilter: 回测时是否要指定日期范围
settleOnEnd: 如果useDateFilter==true,在结束日之后是否平仓所持有的仓位平仓
startDate: 如果useDateFilter==true,指定回测开始日期
endDate: 如果useDateFilter==true,指定回测结束日期
investDayofweek: 每次在周几定投,默认在每周一收盘
intervalDays: 每次定投之间的最小间隔天数,由于是按周计算,所以此数字必须是7或7的倍数
v1.2版本数据窗口指标说明(只列出重要指标):
MA:1100日SMA
RoR%: 当前仓位的浮动盈亏
maxLoss%: 仓位曾经的最大浮动亏损,注意此浮亏代表持仓仓位的浮亏情况,并不代表整体账户浮亏情况。例如当前仓位是1%,浮亏50%,整体账户浮亏是0.5%,但仓位浮亏是50%
maxGain%: 仓位曾经的最大浮动盈利,注意此浮盈代表持仓仓位的浮盈情况,并不代表整体账户浮盈情况。
positionPercent%: 仓位持仓占比
positionAvgPrice: 仓位平均持仓成本
The Only EURUSD Trading Strategy You Need - KaspricciThe Only EURUSD Trading Strategy You Need
I got the idea to this strategy from a youtube video uploaded by Trade Beta. It is designed to capture the early market move of major forex pair EURUSD at beginning of New York Stock Exchange (13:30 GMT). Trade Beta tested his strategy on the 5 minute chart. I have set all parameters to same values as shown in the video.
The strategy creates two pending orders at the recent swing high and low. Once the first pending order entered, the remaining one is cancelled. Latest at the end of market session all pending orders are cancelled and all open trade are closed as well.
In rare case that price at session opening is above swing high, only a pending sell stop order is created at swing high price. And in case price is below swing low, a pending buy stop order is created.
Settings
Trading Time - default: New York Stock Exchange opening hours. Pending orders are created at the close of the first candle within the session.
Swing High Source / Bars - default: High / 5 bars. Used to find the latest swing high within a range of 5 bars left and right. Price is used for buy stop order.
Swing Low Source / Bars - default: Low / 5 bars. Used to find the latest swing low within a range of 5 bars left and right. Price is used for sell stop order.
Stop Loss Type - default: ATR. You can switch between stop loss calculation based on Average True Range value or fixed value.
ATR Length / Factor / TP Ratio - default: 14 / 2.0 / 2.0. Used to calculate the Stop Loss as ATR * Factor and Take Profit as Stop Loss * TP Ratio.
FIX Stop Loss / Take Profit - default: 10 pips / 20 pips. In case you select Stop Loss Type = FIX, these value swill be used.
This strategy is for educational purposes only! It is not meant to be a financial advice.
Big Whale Purchases and SalesBig Whale Purchases and Sales - plots big whale transactions on your chart!
People that hold more than 1% of a crypto currencies circulating supply are considered whales and have a huge influence on price, not just because they can move the market with their huge transactions, but also because other traders often track their wallets and follow their example. Taking a look at whale holdings, one can see why whale worship is so common in crypto: While Bitcoin has a relatively low whale concentration, many of the Top 100 Cryptocurrencies have whales control 60% or more of their circulating supply.
Integrating IntoTheBlock data, this script plots the transactions of these whales and, in strategy mode, copy trades them.
Features:
Strategy Mode: Switches the script between an indicator and a strategy.
Standard Deviations: The number of Standard Deviations that a transaction needs to surpass to be considered worth plotting. Setting this to 0 will show all whale transactions, higher settings will only show the biggest transactions.
Blockchain: The Chain on which Whale activity is tracked.
Simple RSI and SMA Long and Short (by Coinrule)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 is displayed as an oscillator (a line graph) on a scale of zero to 100. The RSI can do more than point to overbought and oversold securities. It can also indicate securities that may be 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.
A simple moving average ( SMA ) calculates the average of a selected range of prices, usually closing prices, by the number of periods in that range.
The Strategy enters and closes the trade when the following conditions are met:
LONG
SMA100 is greater than SMA150
RSI is greater than 50
SHORT
SMA100 is less than SMA150
RSI is less than 50
When a long position is opened, it remains open until the conditions for a short are met at which point the long position is closed and the short position is opened. Then, when the conditions for the long position are met, the short will be closed and a long will be opened.
This strategy is back tested from 1 January 2022 to simulate how the strategy would work in a bear market. The strategy provides good returns.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
50 Pips A Day Strategy - Kaspricci50 Pips A Day Strategy
This strategy is designed to work on 1 hour timeframe. It is designed to capture the early market move of major forex pairs like EURUSD or GBPUSD. It takes the high and low of the first candle (7 a.m. GMT, London Stock Exchange opens) and places to pending orders at these prices levels.
High + additional gap in pips = buy stop pending order
Low + additional gap in pips = sell stop pending order
For both orders a stop loss of 15 pips and a take profit of 50 pips is used as a default. As soon as price triggers one pending order, the remaining pending order is cancelled. At the end of the configured session time all open and pending orders are closed / cancelled.
Settings
Trading Time - start and end time of session. It is configured for Monday to Friday only. At the beginning the first candle is used to define stop prices for pending orders.
Source for Buy Stop order - Default: high. Used to calculate buy stop order. You can add additional pips as a gap.
Source for Sell Stop order - Default: low. Used to calculate sell stop order. You can add additional pips as a gap.
Stop Loss in Pips - Default: 15. Used for both pending orders.
Take Profit in Pips - Default: 50. Used for both pending orders.
This strategy is for educational purposes only! It is not meant to be a financial recommendation.
Wunder Keltner botWunder Keltner bot
1. Wunder Keltner bot is based on the breakout of the Keltner channel. For calculation, 2 channels are used, one for long trades, and the other for short trades. The division into 2 channels is used for more accurate entry calculations depending on trend directions.
2. The ADX indicator is used to filter signals and determine the trend strength. ADX determines the strength of the trend and confirms the entry into the strategy if the value is greater than the level indicated in the settings.
3. There are 3 ways to calculate Stop Loss and Take Profit. You can choose one of them:
Classic Stop Loss and Take Profit in a fixed percentage
ATR Stop Loss
Keltner. Stop Loss, which is set on the opposite Keltner’s Channel Band from Keltner breakout.
4. ATR and Keltner use Risk Reward (R:R) to calculate Take Profit. The script calculates Risk Reward based on the determined Stop loss level and uses the ration to calculate Take Profit.
5. A function for calculating risk on the portfolio (your deposit) has been added to the script. When this option is enabled, you get a calculation of the entry amount in dollars relative to your Stop Loss. In the settings, you can select the risk percentage on your portfolio. The loss will be calculated from the amount that will be displayed on the chart.
For example. Deposit - $1000, you set the risk to 1%. SL 5%. Entry volume will be $200. The loss at SL will be $10.10$ this is your 1% risk or 1% of the deposit.
Important! The risk per trade must be less than the Stop Loss value. If the risk is greater than SL, then you should use leverage.
The amount of funds entering the trade is calculated in dollars. This option was created if you want to send the dollar amount from Tradingview to the exchange. However, putting your volume in dollars you get the incorrect net profit and drawdown indication in the backtest results, as TradingView calculates the backtest volume in contracts.
To display the correct net profit and drawdown values in Tradingview Backtest results, use the ”Volume in contract” option.
Strategy weekly results as numbers v1This script is based on an idea of monthly statistics that have been found across tradingview community scripts. This is an improved version with weekly results with the ability to define the size of every group (number of weeks within one group).
Initial setup of the strategy
1. Set the period to calculate the results between.
2. Set the statistic precision and group size.
3. Enable "Recalculate" → "On every tick" under the strategy "Properties" section.
The logic under the hood
1. Get the period between which to calculate the strategy.
2. Calculate the first day of the first week within the period.
3. Calculate the latest day of the latest week within the period.
4. Calculate the results of the selected period.
5. Group the values by the defined number of cells.
6. Calculate the summary of every group.
7. Render the table.
Please, be careful . To use this tool you will need to enable the "Recalculate" → "On every tick" option but it means that your strategy will be executed on every tick instead of bar close. It can cause unexpected results in your strategy behaviour.
Heikin Ashi SupertrendAbout this Strategy
This supertrend strategy uses the Heikin Ashi candles to generate the supertrend but enters and exits trades using normal candle close prices. If you use the standard built in Supertrend indicator on Heikin Ashi candles, it will produce very unrealistic backtesting results because it uses the Heikin Ashi prices instead of the real prices. However, by signaling the supertrend reversals using Heikin Ashi while using standard candle close prices for the entries and exits, it corrects the backtesting errors and gives you a more realistic equity curve. You should set the chart to use standard candles and then hide them (the strategy creates the candles).
This strategy includes:
Plotting of Heikin Ashi candles
Heikin Ashi Supertrend
Long and Short Entry Signals
Move stop loss after trade is X% in profit
Profit Target
Stop Loss
Built in Alertatron automation
Alertatron Trade Automation Integration
For Alertatron integration, be sure to configure the strategy settings and "Enable Webhook Messages" before creating an alert with {{strategy.order.alert_message}} in the body of your alert message. Be sure to enable webhooks and point it to your Incoming Alertatron webhook URL.
Notes
While this strategy does pretty well during trending markets, It's worth noting that the Buy and Hold ROI is much better during peak times of the bull market
Not financial advice. Do not risk more than you can afford to lose.
Sine Wave TheoryThere are some ideas out there that the market is like a collection of quantum events and that it could all be broken down into sine waves. I created this script to put that to the test.
The idea is simple, I tested 3 different factors that could be put into sine wave form.
1.) Bar Change
2.) Volume Average Change
3.) Coin Flip
For the bar change, I simply allow the sine wave to move upwards or downwards if the bars have changed color in their sequence. For example, if there were 3 red bars and 1 green bar, it would not move the sine wave up or down until the green bar appeared.
For the average volume change, it was the same idea, except that the sine wave could only move up or down if the volume had moved up or below the average value of the length given for calculating the average volume.
Finally, the coin flip simply simulates flipping a coin, and allows the sine wave to move one direction or the other once it has a side that is different from the previous chosen side. For example, heads, heads, heads, tails (once it flipped to tails, this would allow it to move a direction).
The sine wave trading theory that I watched claimed that if you know the correct sine wave # (which is how large the peak is, and/or the sine wave count which is how many peaks and valleys occur) that you can successfully predict future trades. Their claims that the reason it does not look like a perfect sine wave for these events is because there is different amounts of trading going on, thus the timing will be slightly off.
I am posting this to disagree with their ideas. For example, if you select to turn on trading for coin flip and turn off bar change, you will see the coin flip did better on the default settings!
It just so happens that any setting will eventually be good, making all the sine wave variations just completely random if you win or not.
I posted this to demonstrate how silly trading sine waves is. The real trick is using cosine and tangent waves... lol j/k
I hope this helps someone avoid this scam concept.
Miyagi BacktesterMiyagi: The attempt at mastering something for the best results.
Miyagi indicators combine multiple trigger conditions and place them in one toolbox for traders to easily use, produce alerts, backtest, reduce risk and increase profitability.
The Miyagi Backtester is a standalone backtester which is to be applied to the chart after the Miyagi indicator to be backtested.
The backtester can only backtest one script at a time, and is meant to backtest ONCE PER BAR CLOSE entries.
It is currently not possible to backtest ONCE PER BAR entries.
The backtester will allow users to all Miyagi Indicators using DCA strategies to show returns over a selectable time period.
The backtester allows leverage, and as such users should be aware of the Maximum Amount for Bot Usage and Leverage Required Calculations.
The DCA Selector switch will allow users to backtest with, or without DCA.
Static DCA is used within the backtester and allows users to see DCA Statistics on closed trades.
How to use the Miyagi Backtester
Step 1: Apply the Miyagi Indicator of Choice to backtest (4in1/10in1/Strend).
DATE AND TIME RANGE:
-Date and time range to backtest.
TRADE:
-Entry source to backtest. Please select the "Outbound Entry Signal Sender"
-Trade Direction to backtest. This can be helpful to backtest according to your strategy (long or short).
-Take Profit % to backtest. This is the percent take profit to backtest. Slippage can be accounted for on the "Properties" tab.
-Stoploss % to backtest. This is the percent stoploss to backtest.
DCA:
DCA Checkbox: Enable the DCA Checkbox to backtest with DCA. Disable it to backtest without DCA.
Leverage: Input the Leverage you will trade with.
Base Order Size (% Equity): This is the Base order (BO) size to backtest in % of equity.
Safety Order Size (% Equity): This is the Safety order (SO) size to backtest in % of equity.
Number of DCA Orders: This is the maximum amount of DCA orders to place, or total DCA orders.
Price Deviation (% from initial order): This is the percent at which the first safety is placed.
Safety Order Step Scale: This is the scale at which is applied to the deviation for the step calculation to determine next SO placement.
Safety Order Volume Scale: This is the scale at which is applied to the safety orders for the volume calculation to determine SO Volume.
Real world DCA Example:
The process is as follows.
Base Order: This is your initial order size, $100 used for Base Order
Safety Order: This is your first safety order size, which is placed at the deviation. $100 Safety Order, it is good to keep the same size as your BO for your scaling to be effective.
Price deviation: This is the deviation at which your first Safety order is placed. 0.3-0.75% used by most of our members.
Safety Order Volume Scale: This is the scale at which is applied to the safety orders for the volume calculation. Scale of 2 used, which means that SO2 = (SO1) * 2, or $200. This scaling is typical for all following orders and as such SO3 = (SO2) *2, or $400.
Safety Order Step Scale: This is the scale at which is applied to the deviation for the step calculation. This is similar to the volume scale however the last order percentage is added.
Scale of 2 used, which means that SO2 % = ((Deviation) * 2) + (SO1%). (0.5% *2) + (0.5) = 1.5%.
This scaling is typical for all following orders except that the prior deviation is used and as such SO3 = ((Prior%) * 2) + (Deviation). (1.5% * 2) +(0.5%) or 3.5%.
Total SO Number: The calculations will continue going until the last SO. It is helpful to understand the amount of SO’s and scaling determines how efficient your DCA is.
Backtester Outputs include:
Net Profit to display net profit
Daily Net Profit to estimate
Percent Profitable which shows ratio of winning trades to losing trades.
Total Trades
Winning Trades
Losing Trades (only applicable if stoploss is used)
Buy & Hold Return (of the backtested asset) to compare if the strategy used beats buy & hold return.
Avg Trade Time is very helpful to see average trade time.
Max Trade Time is very helpful to see the maximum trade time.
Total Backtested Time will return total backtested time.
Initial Capital which is taken from the Properties tab.
Max amount for Bot Usage which can be helpful to see bot usage.
Leverage Required will show you the leverage required to sustain the DCA configuration.
Total SO Deviation will allow users to see the drop coverage their DCA provides.
Max Spent which is a % of total account spent on one trade.
Max Drawdown which displays the maximum drawdown of any trade.
Max % distance from entry shows the maximum distance price went away from entry prior to the trade closing.
Max SO Used which shows the maximum number of SO's used on a single trade
Avg SO Used which shows the average number of SO's used in all closed trades.
Deals closing with BO Only calculation will show how many trades are closed without DCA.
Deals closing with 1-7 SOs calculation will show how many trades are closed with DCA, and allow for fine-tuning.
Happy Trading!
This script will be effective to backtest and produce the best settings for each timeframe and pair across all STP Scripts.
This will take a lot of the manual work out of backtesting for our users while improving profit potential.
Happy Trading!
Power Trend v1.0Background to the tool
The tool was built out of frustration. Having traded for many years with a reasonable level of success I was always frustrated that my trading never went up a level. The world of trading is filled with people having so much more success than me and this level of FOMO really bothered me and resulted in inconsistency and countless hours sitting in front of a screen, hoping for the best. I also became a little bit of an indicator junkie - was there a holy grail indicator out there for me? I always felt that as a retail trader I was behind the curve. I started to investigate how the major market participants trade and make money and I was astounded at the level of success that they get from creating strategies and sticking to it. The market is driven largely by a "black boxes" which, for us retail traders are outside of our ability to access. I wanted to build a tool that could give me a traders edge.
Another factor that has always bothered me was when reading investing books there is a general assumption that a standard entry, say 8/13 cross over, works on all stocks. However, it is not the case and it can be frustrating for a trader using a set up and not realizing that the set up was/is the problem, not the trader. This realization alone has made a huge impact on my trading. The big boxes that control the market know this already.
Also, a lot of indicators that are available don’t take advantage of the backtesting capability provided in Tradingview. It is fairly simple to find 8-9 trades where a set up worked and then fall into the trade of assuming that it cannot fail. Knowing which set ups work and how frequently it will print will change the way that you trade.
The goal with the tool is to identify setups that have worked in the past with a high degree of profitability, high profit factor and low drawdown and using the planning tool allows you to customize the setup to find exactly what you are looking for across any tradeable asset on TradingView.
Over the past 20 years I have realized the following:
1) Not all entries and signals work the same on all stocks and knowing the historical performance of a strategy is critical
2) Not having a plan in advance lowers your probability of success
3) Developing consistency in analysis is critical
4) Developing confidence in your own plan is more important than whose trades you try to copy
5) Having 30 indicators does not help you trade better - it leads to more frustration
So here is the product of these realisations:
1) The tool looks across the most common entry strategies (RMA / EMA / SMA / HMA / WMA cross on 5 dimensions of type and 5 common crossovers) and can be used on 19 different time frames giving you guidance on what the best set up is for the stock you are analysing
2) It incorporates volatility into the strategy – when stocks are trading outside of a predetermined volatility band, a trade will not be entered. This accommodates traders who tend to get shaken out of trades too early.
3) It looks at the impact of “buying the dip” – often a common strategy employed by many traders which now can be backtested and reviewed to see if it actually helped or hindered the trade.
4) It measures your trade plan against your R – what you are willing to risk – and calculates your target profit based on your R multiple
5) It provides a non repaint signal on your base strategy and provides you with signals to trade smaller or shorter signals within the bigger strategy.
There are some additional visual tools:
• Squeeze signals - I am a big fan of the TTM squeeze however the Squeeze by itself can be hard to trade. Seeing a squeeze fire long on a chart can add to trade confidence.
• Seeing zones of support and resistance rather than single lines can also give you some leeway in terms of not getting pushed out of a trade too soon.
The backtester is always reviewed on a multi year period to get an understanding of win rate %, profit ratio and average duration of trade. As an option trader knowing that a high probability move is playing out allows me to make sure that I don’t undercut the time frame for the expiration of the option relative to the historical average duration of a trade. Backtesting on shorter times is unrealistic.
Key benefits
1) It will save you a ton of time. I don’t have to sit in front of a screen watching ticks each day. I can plan for an entry, set an alert for a trade and when the conditions are met the TradingView system sends me a message and I will go and confirm a trade, execute it, set my alerts for control and move on with my life.
2) It allows me to review trade ideas in a consistent manner using the best trade plan and set up for a stock.
3) It forces me to be patient and not panic (always a good thing). With an adjustable volatility feature I can modify the volatility band in the trade plan to accommodate choppy market conditions.
4) It looks at both sides of the market (long and short) and you can calculate the impact of being market neutral or having a directional bias.
I hope this tool helps you to achieve some degree of peace in your trading.
Polaris [Loxx]Polaris is a lower timeframe, high-leverage scalping indicator. It works by scanning for volatility spikes and then calculation the likelihood that those spikes will break market structure to the upside or downside.
Settings
Volatility Type: ATR or TRD , these types will be expanded in future releases.
Volatility Multiplier: How much volatility for market structure break
Filter and source: Proprietary moving average filter period and source type
Equity Calculation Method: Fixed or compounded. This determines trade size. If fixed, then the strategy uses the same quantity per trade, if compounded the strategy uses a percentage of cash on hand as that cash grows or shrinks
% Risk Per Trade: How much you'd like to risk per trade.
Leverage Multiple: How much leverage you'd like to use
% Maintenance Margin: You can find this value posted on the exchange you use
Enabled Forced Liquidation Stop-loss?: If enabled, the strategy will liquidate at measures of leverage automatically. 10x leverage liquidates at 10% opposite move for the trade, for example. This number will be adjusted by the % Maintenance Margin determined by the exchange.
% Minimum Take Profit Cutoff: This controls whether you wish to take trades only over XX% volatility . Since this indicator is to be used for small tight scalps, this keeps you out of trades that are too small to be useful for your desired trading style
Activate Long Pullback Rule?: This controls how the trade is entered. If activated, then the entry won't occur until a pullback happens after market structure break
Activate Short Pullback Rule?: This controls how the trade is entered. If activated, then the entry won't occur until a pullback happens after market structure break
Activate Trend Flip Exits?: Force strategy to exit when trend flips from short to long and long to short
Number of Take Profits: How many take profits levels. 1-5
Activate Trailing Take Profit?: Allows you to set a trailing stop loss after TP2 his hit
Trailing Take Profit Offset Multipler: This determines when the trailing stoploss hits. It's a multiple of volatility
Activate Moving Stop-loss?: Forces the stop loss to move up as targets are reached
Where to Move Stop-loss: At which Take Profit level do we begin to move stoplosses upward with targets
Show dip buying levels: If you have a high risk appetite, these are levels where you could increase your investment size, this has no effect on the strategy but is included for if you wish to manually add to your position size
Activate Longs?: Toggles on/off Longs
Activate Longs?: Toggles on/off Shorts
The remaining settings are multiples of volatility for Take Profits and dip buying levels
UI components
Big green and red plus signs means an entry point. PTF with green and red arrows means "prepare for trend flip". Not every PTF will actually flip the trend. These are just warning shots to make you aware that a possible trend flip is coming. Labels nest to market structure breaks with numbers are the ideal entry level. You can set limit orders at these levels so as to incur less exchange fees on Binance or Bybit for example. The data window provides useful information about the current trade and targets and stoploss of the next upcoming trade giving the current price action of the asset.
Other things to note
this is an extremely high risk strategy depending on how you tune the settings. You can tune down the settings to make it less risky at the cost of profit and hit rate, but that's up to you and your trading style. This can be used all all timeframes, but is meant for timeframes below 4 hours.
Waverider [Loxx]Waverider is a momentum strategy that probes historical data to find the optimal entries based on measures of volatility and gaussian adaptive filtering. To accomplish this, after each successful trade, XX trades will be skipped until a specific loss count is achieved after which the strategy will activate again, searching for the next trade.
Features
Select long/short profit target and stoploss by %
Skip weekends
Toggle on/off adaptive divergence detection and forced exit
MACD MTF Strategy [JoseMetal]============
ENGLISH
============
- Description:
This strategy uses my indicator MACD MTF (check my profile) to generate entries, it also has ATR to define Stop Loss and Take Profit if needed.
The strategy has several customizable options, which allows you to refine the strategy for your asset and timeframe.
You can customize settings for ALL indicator settings (MACD MTF and ATR).
- CUSTOM CONDITIONS TO ENTER A POSITION:
1. Both MACDs agree (current timeframe and higher timeframe).
2. Current timeframe MACD crossover.
3. Higher timeframe MACD crossover.
4. MACDs no longer agree with each other.
- EXIT CONDITION:
1. Predefined Stop Loss and Take Profit based on ATR (stop can be previous wick).
2. MACDs no longer agree with each other.
3. Opposite position entry.
- STOP LOSS TYPE:
1. ATR.
2. Previous wick.
- OTHER OPTIONS:
You can customize any setting for my MACD MTF and ATR.
- Visual:
ATR is shown for the Stop Loss / Take Profit.
The script prints the Take Profit as a green line, Stop Loss as a red line and entry price with a white line.
- Recommendations:
Recommended on 8H or 12H timeframe for the CURRENT timeframe, while using DAILY for the higher timeframe on the MACD MFT (by default).
Entry when BOTH MACDs agree and exit on opposite entry, this has NO TAKE PROFIT or STOP LOSS, so be careful, but gives the BEST profit overall, and being on 8H/12H + Daily lets you relax.
- Customization:
As you can see, almost everything is customizable, for colors and plotting styles check the "Style" tab.
Enjoy!
============
ESPAÑOL
============
- Descripción:
Esta estrategia utiliza mi indicador MACD MTF (revisa mi perfil) para generar entradas, también cuenta con ATR para definir Stop Loss y Take Profit si es necesario.
La estrategia tiene varias opciones personalizables, lo te le permiten refinar la estrategia para te activo y temporalidad.
Puedes personalizar la configuración de TODOS los indicadores (MACD MTF y ATR).
- CONDICIONES PERSONALIZADAS PARA ENTRAR EN UNA POSICIÓN:
1. Ambos MACDs coinciden (temporalidad actual y temporalidad superior).
2. Cruce del MACD en el marco de tiempo actual.
3. Cruce del MACD en el marco temporal superior.
4. Los MACD ya no coinciden entre sí (están en desacuerdo).
- CONDICIÓN DE SALIDA:
1. Stop Loss y Take Profit predefinidos basados en el ATR (el stop puede ser la mecha anterior).
2. Los MACDs ya no coinciden entre sí (están en desacuerdo).
3. Entrada en posición contraria.
- TIPO DE STOP LOSS:
1. ATR.
2. Mecha anterior.
- OTRAS OPCIONES:
Puede personalizar cualquier ajuste para mi MACD MTF y ATR.
- Visual:
El ATR se muestra para el Stop Loss / Take Profit.
El script imprime el Take Profit como una línea verde, el Stop Loss como una línea roja y el precio de entrada con una línea blanca.
- Recomendaciones:
Se recomienda en el marco de tiempo 8H o 12H para el marco de tiempo ACTUAL, mientras que se utiliza DIARIO para el marco de tiempo superior en el MACD MFT (por defecto).
Entrar cuando AMBOS MACDs están de acuerdo y salir en la entrada opuesta, esto no tiene TAKE PROFIT o STOP LOSS, así que tenga cuidado, pero da el MEJOR beneficio en general, y estar en 8H/12H + Diario le permite relajarse.
- Personalización:
Como puedes ver, casi todo es personalizable, para colores y estilos de trazado revisa la pestaña "Estilo".
¡Que lo disfrutes!
ATR Trend Run - Signals Alerts SL and TP by Tech Store OnThe script uses several ATR formulas for entering/exiting trades, support/resistance lines to take TP1 (take profit 1) and another ATR formula for TP2 (take profit 2). Everything is fully configurable to your preference, and you can back-test it via TradingView. You can also configure the indicator for signals during US trading sessions (with or without power hour), as well as taking profits/stop-loss session time(s), as well as to close a position at the end of the trading session no matter what. Also, you can turn all of that off, so there are no trading session/end of day limits and each trade will run until it either hits SL, TP1, TP1 > back to entry, TP2. Note: indicator is set to skip consecutive/opposite signals, while you currently have a trade open > if you hit a trend – ride it to the end!
For example: If you will be day trading SPY and you wish to close your positions no matter what right before the market closes (3:45PM ET > 15min before closes): Make sure to checkbox “Intraday – Close Position Before Market Closes” in the strategy/indicator Settings, so that you are alerted soon before the market closes, if you wish to continue holding the position – leave this checkbox unchecked.
SL: SL is set to be slightly above/below the signal candle, which is best suited for this strategy.
Strategy Take Profit Approach
While the initial position open and SL hit is always based on a closed candle bar (can’t do otherwise, as otherwise you will have 10s of fake signal alerts), there are 2 ways on trading this strategy in terms of TP1 and TP1 taken > back to Entry, which is based off Alert type.
You can switch this as you like within the indicator settings, “Checked: TP1 taken > back to Entry per Price Touch | Unchecked: per Candle Close”.
Candle Close vs Price Touch: with the Default method - Candle Close for an alert for TP1 or if price comes back to Entry after TP1 is taken will only be triggered once candle bar fully closes crossing the area, while Price Touch will alert when price touches the area before candle bar closes.
For example: your trade is running well, you grab TP1 and the price reverses and hits your trade Entry area. With Price Touch – you are immediately alerted to close your trade with no loss and with TP1 profit. With Candle Close - you will receive an alert only once candle bar fully closes on top of the Entry crossing it backwards, meaning it may lower your TP1 profit or even completely reverse the trade into loss in case it will be a huge candle bar for any reason. However, it may touch the Entry area, looking like the price is reversing, but then continue per initial trade direction, sometimes becoming a trend. So, while Price Touch seem like a more conservative approach, Candle Close can give you much bigger profits if you catch a trend, but you can always change it via the Settings.
Note: TradingView back-testing engine does not have a feature to open/close orders IMMEDIATELY via Price Touch trigger, but only when the candle closes after price touches the scripted area/line/etc., so you for the most accurate results, test your strategy out via Candle Close setting. Otherwise, decide yourself. I personally like more Candle Close since I can test it out via back-testing with the most accurate results.
TP2 is set per Candle Close as often the ATR trailing stop line will be hit and bounced off, so it’s best to wait until candle actually breaks it/closes through it.
Note: If you will be observing the strategy LIVE, during LIVE candle bar movement – it will look weird, like it’s placing an order after order during any trigger – this seem like a TradingView bug, but is only observational, once the candle bar is closed and you refresh TradingView it will all look correct.
Back-Testing
If you wish to do some back-testing, just modify the strategy/indicator Settings:
-----1) STRATEGY: This is for back-testing/experimenting with the script inputs.
----------a. You can setup a start date (date, month, year) from which it will start opening back-test trades, select a position size and select TP1 size, the idea here is to close half (or whatever you choose) portion of the trade once you hit your TP1, then to either close at small profit or to catch a trend and close the second portion of the position long way ahead from Entry, otherwise it will alert you to close the position at TP2, if price comes back to Entry, at reversal signal or at the end of US trading session if the option for it is checked. If you wish to close the whole position at TP1, just enter the same amount for TP1 to match backtest position size. Otherwise you can experiment with TP1 sizing – try it out!
-----2) Feel free to experiment with ATR settings and with S&R Left/Right bars, you may be amazed how results will differ and find some really cool combinations!
-----3) Make sure you select/de-select “Intraday – Close Position Before Market Closes” setting depending on what you are back-testing and on which conditions
-----4) Note: If you wish to do some deep back-testing (1+ years), use the “Deep Backtesting” feature within Strategy Tester on the TradingView as otherwise it may show wrong results or even fail to compute the results
Add the alerts
-----Right-click anywhere on the TradingView chart
-----Click on Add alert
-----Condition: ATR Trend Run - Signals Alerts SL and TP, by Tech Store On
----------o Right underneath the condition click on the drop-down menu and select “alert() function calls only”
-----Expiration time: Whatever you wish
-----Alert actions: Whatever notifications you wish
-----Alert name: DO NOT TOUCH THIS
-----Hit “Create”
-----Note: If you change ANY Settings within the indicator – you must DELETE the current alert and create a new one per steps above, otherwise it will continue triggering alerts per old Settings!
- Note: If you add the alert while the script is currently “In Position” it will not know that. So either wait when there will be no position open at all or close your position partially if the bot opens it twice bigger or so in case per script the bot will think it is already in position.
Note: Because of the slippage and the order processing time between TradingView, AutoView and the Broker (it’s usually about a second or so), it is suggested to not use a timeframe lower than 1min. The script is working really well with 1M/3M/5M/H1/H4 timeframes per my back-testing, but feel free to explore via Strategy Back-testing what’s best for the instrument you wish to trade.
If you wish to try this out for a week or so – please reach out and I will give you access.
AVPHOW TO USE:
This script is designed to be used on MES primarily. ES works as well but much more capital is needed.
3000 per contract is the recommended amount of initial capital. This number is a combination of the maintenance requirements to hold a contract through the settlement period and an additional amount for any drawdown. 1k maintenance + 2k drawdown buffer. This is a conservative estimate. You may need to change this to fit your individual broker requirements and risk tolerance.
Depending on the signal and how it is filtered the script will sometimes reverse a position or close it. Be mindful of which.
An important note is to not decrease the number of contracts traded once you have upped the position size if you plan to increase as the profit allows.
SIMULATION:
I've included an option to see the compounding and changes in position size according to the HOW TO section. If you have access to "Deep Backtesting" option the results will be clearer. The current limitations of the data provided by TradingView at the 5m resolution limits the deep backtest to just shy of 1 year worth of trades.
The initial number of contracts to be traded can be changed to fit your own account size you wish to trade. You may also wish to see how it builds from just a single contract and building up based off profit alone. In that case leave the initial size as 1.
The buffer size is the amount of capital required to increase the position size. You may wish to increase risk by lowering this number or have a more conservative one by increasing it.
Job's Tears - V6This strategy is based on Heikin Ashi + supertrend + DMI + RSI .
Fully functional with placing a new order, taking partial profit at the target price, taking partial profit when hit the take profit, and closing an order.
I wrote this strategy mostly in 5min timeframe.
The commission is default at 0.02% and slippage is 1.
InitCapital is 100 USD, place every new order with 20 USD, close 10 USD when hitting the target price and close 2 USD for every take profits.
No leverage is applied.
I use Heikin Ashi candle patterns to identify the buy/sell signal and supertrend to back my signal. Then I use dmi and rsi to filter out the noises.
My target is to catch a big trend, so I use a lot of take profits to maximize the potential profit.
New Short/New Long: Place a market order for a new position of 20 USD.
Target Price: Place a limited order of 10 USD at that price as soon as a new position is ordered as a basic profit in the pocket.
Take Profit: Place a market order to reduce the position by 2 USD each time.
TaoBao: Place a market order to close all remaining positions. It will only show up after hitting the target price as a way to protect our capital.
Close Short/Long: Place a market order to close all remaining positions.