Lunch-BreakThis script is only for Lunch breaks of London, NYSE and Tokyo session for those who don't want to trade between in these times.
Narzędzia Pine
Custom Multi-Timeframe IndicatorIt's a pretty simple example of a nice custom screener you can run for multiple timeframes. This is an RSI screener, but you can easily change the function for your own Indicator.
Screener displays:
Last value of the instrument
RSI value for up to 10 instruments / 4 timeframes.
In Parameters you can change:
4 timeframes
10 instruments
Parameters for RSI
Styling parameters for table
If the selected timeframe will be lower than the current one you will receive a warning message in a table.
Thanks to @MUQWISHI to help me code it.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
OrderbugThis script demonstrate what I don't understand - according to documentation with order managements
The from_entry parameter should execute the exit on this specified trade.
The chart shows the right information, but the list of trades, in the Strategy tester panel doesn't make sense:
This is an extract of the CSV file I got from this script:
The enter1 is getting matched against 4 others entry names, each closing 30% of the position.
10,Exit Long,exit loss2
10,Entry Long,enter 3
===================
9,Exit Long,exit loss4
9,Entry Long,enter 3
==================
8,Exit Long,exit loss4
8,Entry Long,enter 2
==================
7,Exit Long,exit loss3
7,Entry Long,enter 2
===================
6,Exit Long,exit loss8
6,Entry Long,enter 2
==================
5,Exit Long,exit loss10
5,Entry Long,enter 2
==================
4,Exit Long,exit loss10
4,Entry Long,enter 1
===================
3,Exit Long,exit loss5
3,Entry Long,enter 1
===================
2,Exit Long,exit loss9
2,Entry Long,enter 1
===================
1,Exit Long,exit loss6
1,Entry Long,enter 1
TRADEMASTER 2.35Trade master Trend Finder This is a volatility tool designed to get the daily bottom and top values calculated using a daily ATR and IV values. ATR values can be calculated directly, however for IV I recommend to take the values from external sources for the asset that you want to
Front Angler Percent CJA nice little gadget.
Can be used to visually hint on volatility.
Will show a leading vertical bar which shows percentage of price, both up and down, in relation to current price.
Easy Backtester PROWHAT IS EasyBacktester ?
EasyBacktester is a tool that helps you backtest trading strategies built by yourself with an included strategy builder and a multitude of options.
From within the parameters of the tool, you can specifically pick your entry settings across 12 most common indicators, such as "RSI", "MACD", "Moving Averages" etc... Then you can immediately visualise your setup's Stop-loss & Take Profit, your expected Profits & Loss and a lot of other statistics for your entry strategy. Once you are satisfied with your entry strategy, you are given a set of tools to optimize your setup using stop-loss rules, take profits rules, partial profits, trailing-stops, entry timing...
WHY IS THIS TOOL DIFFERENT ?
EasyBacktester is a backtesting engine with no coding skills required. TradingView allows for "Strategy Scripting" using PineScript, which is not an option for non-coder audience. EasyBacktester fills this gap and allow non-coders to get an idea of how their trading strategies may perform using mouse clicks only.
Some similar attempts have been made on TradingView, allowing some limited options, but none have the same capabilities EasyBacktester offers, for instance, as of April 2022 these features have not been seen in any other TradingView tools:
- partial take profits
- leverage simulation
- a multitude of trailing stop-loss possibilities including trail triggers and trail parameters
- visualisation of entries including stop-loss, take profits, partial take profits, and trailing stops. One can now visualize such complex setups.
- visualisation of Profits & Loss
- time in trade
- wait strategy after a signal: for example, when RSI is oversold, "WAIT until price retraces 100% of the original signal" amongst other possibilities
QUICK START GUIDE:
STEP 1: DEFINE YOUR SIGNAL STRATEGY
From the settings of the tool, find the "SIGNALS STRATEGY" section.
Select a type of entry you wish to simulate, for example "LONGs", and activate the checkbox right before "Simulate".
Right below, you will find 4 signal builder for you to play with and pick your strategy accordingly.
For example, to simulate a signal when RSI is oversold, follow these steps:
- On the 1st multiple choice box, select "RSI"
- On the 2nd multiple choice box, select "is below..."
- On the 3rd multiple choice box, select "OverSold level"
Don't forget to activate this rule by checking the checkbox in front of it.
After this first step, one should immediately see the chart affected with some plots. The dots represents the signal entry defined by the rule we just created, and the red/green boxes visually represent trades that could have been taken with this signal which, in this example, occurs "when RSI is below oversold level". Note that all specific parameters for RSI including its specific "oversold level" is customisable at the end of the tools settings along with all other indicators settings.
STEP 2: STATISTICS
By default, the "APPEARANCE" section only plots potential entry signals (materialized by dots) and actual entry boxes (materialized by red/green boxes).
But the user can easily add other precious statistics to the chart, and obviously the most important one for backtesting: Profits & Loss (P&L).
In the "STATISTICS" section please check the "P&L" box to see appear a chart of the simulated P&L for our example. You should immediately see a new graph below the chart representing the evolution of the P&L after each entry.
Other statistics are available to the user, including: Equity, Number of Trades, Time in Position, Number of trades Won, Number of trades Lost, Number of trades Stopped.
Play around with those to see them plotted on your chart.
STEP 3: OPTIMIZE YOUR ENTRY
Under the "ENTRY STRATEGY" section, one can pick how to enter AFTER the signal, which provides the user with an extensive flexibility to pick its timing.
Here there are a various set of choices offered, ranging from the default "Market Order at Next Candle Open", to "Limit Order: at signal's candle open" or even "Stop-Buy: at break of last candle high". As its name suggests, this option allows you to actually wait before randomly enter in trade.
It is important to also note that the user can totally prevent entry if the conditions are not filled after a customizable number of candles represented in "Max bars to wait for entry" (default being 1, meaning the engine will wait the condition to be filled during only 1 candle)
STEP 4: MANAGE YOUR RISK
Under the "RISK MANAGEMENT" section, the user is given a series of options to set the amount (s)he would like to risk.
This is extremely important to set, and is the result of a combination of customizable options including:
- the Initial Capital of the account
- the amount to risk per trade, and HOW to risk it: some fixed % the initial equity or adjust the stop-loss to the desired risk ?
- use of leverage or not
- initial stop-loss, as well as minimum and maximum
- trailing stop-loss: what should trigger the trailing ? and by how much should the engine trail ?
STEP 5: HAVE AN EXIT PLAN
Under the "EXIT STRATEGY", the user can define how to exit the trade.
For instance, here again a lot of options are given:
- Take Profit: exit at some level of profits defined by a multiple of the stop-loss, or a multiple of the ATR, or some % or points
- Partial Profit taking before exit
- Panic close position after some time spent on the trade
STEP 6: FURTHER OPTIMIZATIONS
Under the sections "Commissions" & "Calendar & Sessions", one can simulate real trading conditions by including commissions fees as well as filtering actual dates and trading sessions. These sections are straightforward for any user to use.
SETP 7: INDICATORS SETTINGS
Since EasyBacktester uses a predefined set of indicators to get started, those indicators are also customizable in the last section of the settings. Here, one can easily customize RSI periodicity, MACD lengths, Moving averages types & lengths, ATR, etc...
STEP 8: GOING FURTHER
This is only a start to give users an overview of how various options affect their trading performance. But of course, each trader has its special recipe and specific detailed setup that is not possible to embed in a single tool. For advanced simulation, EasyBacktester provides plug & play connectors for advanced users. Namely, there are 3 connectors:
- signal connector
- trail trigger connector
- exit connector
Each of these connectors are an opportunity to customize the engine signals, trail trigger and exit choices with the user's own options. This case does require a little bit of coding, but it can easily be implemented by copy-pasting existing resources or with a slight help of a professional. In fact, the only conditions to build a proper connector is to export a plot with the numbers 1 (for signals), 2 (for trigger trails) and 3 (for exits). Here is an example of custom SIGNAL connector compatible with EasyBacktester, to produce a signal when last RSI was below 30 and current RSI reads above 30:
============================================================
//@version=5
indicator("My custom RSI signal")
// when previous RSI 14 was below 30 and current RSI 14 is above 30, set "custom_signal" to 1, otherwise set "custom_signal" to 0
custom_signal = ta.rsi(close, 14) < 30 and ta.rsi(close, 14) > 30 ? 1 : 0
// Export a plot of "custom_signal", but do not display it
plot(custom_signal, title="my signal", display=display.none)
============================================================
Once this indicator has been built, the user only needs to connect it with EasyBacktester as follow:
1. Open a desired chart, and add both EasyBacktester indicator as well as the custom "My custom signal" we just created above.
2. Open EasyBacktester's settings, and in the first option, there is "Connect signals source" which by default is set to "close". In the multiple choices, find your custom signal which should be named something like "My custom RSI signal: my signal", generally speaking the name is built like this " : ".
3. Now the custom code is connected to EasyBacktester, but we need to indicate the engine we actually want to use it as custom signal.
4. Under the "SIGNALS STRATEGY" section, where we generally build signals rules, there is special rule for this specific connection named "Use external source as entry signal". Just check the checkbox to activate it and see how the chart took our custom signal into consideration.
That's it for the overview of EasyBacktester. Thank you for reading and happy trading :)
Ultimate risk management toolHow to use:
Use the cursor to select the time, entry, stop loss, and target position. Then a window will pop up and type the trading fee or any other things you want to adjust to calculate the actual reward/risk ratio according to the price you selected.
Known error:
Settings of this script can't be saved as default might due to the interactive price selection function. If anyone knows how to fix it, please let me know.
feature:
1. Dynamic profit label can move up and down vertically on the right-hand side of the box.
2. The breakeven line can tell you you can move your stop loss to the entry price when the price reaches it.
3. Calculate the actual reward/risk ratio based on the trading fee. The calculator only calculates the actual Risk/Reward Ratio, which might be helpful for scalpers.
4. When the price touches sl or tp, that side of the box will be highlighted. Sometimes it doesn't work but I will try my best to fix it. Feel free to share your idea to help me to fix it.
5. Price alert. This tool compares with the alert function but reopens it if you want to change the alert price.
CRYPTO MARKET SESSION ANALYZER INDICATORCrypto Market Session Analyzer is an easy-to-use yet powerful analysis tool that helps the trader visualize and analyze price movements over three different trading sessions:
1) European Session
2) US session
3) Asian session
Automatically tracks the corresponding levels for each market session.
This indicator can be used on all timeframes equal to or less than 15 minutes.
Although this is a simple indicator to use, some care must be taken when using it. The trader must be careful to set the correct times for each session according to his UTC timezone. By default the indicator uses UTC. If your console is set to UTC + 2 for example, you will need to take this into account and align the times correctly. You can adjust the time for each session from the user interface. Following the example, if the opening of the UE session is set to 9 and UTC of your console is set to UTC + 2, the script will proceed to create the level at opening time 11.
HOW IT WORK
The indicator automatically draws a horizontal line at the open and a horizontal line at the close of each session. The indicator clears past support and resistance every 24 hours to provide a clean and easy-to-read chart, updating new levels session after session.
Blue indicates the EU session.
Orange indicates the US session.
Purple indicates the Asian session.
Input Text Area to Array then Reshape Table█ OVERVIEW
Simple method to convert from input.text_area to array using str.split.
Reshape table using switch, not necessary must use matrix.reshape.
Might be useful pine script to replace input.symbol.
█ FEATURES
Table can positioned by any position and font size can be resized.
Reshape table and sorting array if necessary.
█ CREDITS
Credits to TradingView for new update of input.text_area.
[TTI] StockBee labelsHISTORY AND CREDITS –––––––––––––––––––––––––––––––––––––––––––––––––––––––
Since I am getting a big interest in the StockBee's TI65 indicator, I decided to make another one which covers the rest of the things I have seen on his chart.
WHAT IT DOES ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
👉 StockBee Labels = these include important measurements that you can have on the chart
— V = Traded Volume Today
— $ = Dollar Net Change Today
— Stop = Stop which is calculated by Low + 1/2 Trading Range
— TI65 = Absolute momentum value
— LD1 = Yesterday's Low
— TC = Todays True Closing Range
— MDR = Modified Double Trouble
Hover over the cells to get additional information
👉 Unusual Volume Bubble = these indicate when an unusually big volume has occurred
👉 Daily Bull/Bear Flags = Technical formation for Bull and Bear Flags
HOW TO USE IT –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
👉 StockBee Labels = can be used to determine the momentum strength, stop losses and general movement of stock. They are really good utility labels
👉 Unusual Volume Bars = Indicate significant times in the development of the tickers price movement. These signal extra caution as can be a begining of a big move
👉 Daily Bull and Bear Flags are technical patterns. If you look to trade Bull Flags make sure there is a preceding trend, consolidation channel and good volume pattern beforehand
Positions Watcher & Gain/Loss LinesPositions Watcher & Gain/Loss Lines is a companion table indicator that keeps an eye on open positions, regardless of the ticker you are currently viewing.
Keep track of up to 20 positions and their change on the day as well as the gain/loss of your positions. There are 9 different default positions as well as the ability to add a gap from the borders, incase you have other information already in the default position you want to use. It also has the ability to change the width of the table borders.
Additionally, this indicator provides the ability to overlay gain/loss horizontal lines at set percentages. This can be based on the positions that are set, in addition to placing lines on all charts starting at the close, open, high or low.
Part of this indicator is based on the following indicator and at some point the plan is to merge both indicators.
Have modification ideas for this indicator? Just let me know and I will gladly consider them!
[TTI] Position Sizing Calculatorb]HISTORY AND CREDITS –––––––––––––––––––––––––––––––––––––––––––––––––––––––
"Perhaps the greatest secret to top trading and investing success is appropriate money management or what we now call POSITION SIZING" - Dr. Van Tharp, Definite Guide to Position Sizing (Market Wizard Book #1)
For those of you who have studied position sizing you know the power it can have to the bottom line of your portfolio.
WHAT IT DOES ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
The indicator allows you to quickly determine your position size after you decide to open a trading or investing position. Additionally, it gives you targets in terms of R-multiples (R) that tell you at what price level you achieve 2R or 200% return to a given risk.
The indicator also has the option to print these levels on chart for you.
You can use the calculator for the loaded ticker or other ticker that you wish.
1️⃣ Percent Calculator
👉 Choose position size (%) of total trading portfolio. General guideline here is 25% to be maximum (as per Mark Minervini criteria)
👉 Choose stop loss (%) of total position. This means that if you have 100k portfolio and your position size is 25% (25k), how much of that 25k are you willing to lose in order to asses you are wrong.
OR
2️⃣ Dollar Value Calculator
👉 Choose Stop Price ($) - general guidance is to use technical stop price.
👉 Choose Amount to risk ($) - this is the absolute amount of money you are willing to risk on a position
Both 1️⃣ & 2️⃣ calculate the targets and the target prices in order to determine where to take profits
Additionally, you get instant information for:
👉 How many shares you ought to buy
👉 What is the total size of the position to open
👉 What is your stop amount (either in $ terms or in $ of portfolio)
👉 What is the Risk to Total Equity with the current parameters.
HOW TO USE IT –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
✅ STEP 1
Choose ticker and input the price at which you open a position
✅ STEP 2
Choose 1️⃣ Percent Calculator OR 2️⃣ Dollar Value Calculator
Depending on the parameters you use to open a position
✅ STEP 3
Review the table and the Additional data section to see how much Shares you ought to buy and what is the Risk To Total Equity
✅ STEP 4
Put Alerts for Stop Loss and Take Profits
SymMatrixTableSimple Example Table for Displaying Price, RSI, Volume of multiple Tickers on selected Timeframe
Displays Price, RSI and Volume of 3 Tickers and Timeframe selected by user input
Conditional Table Cell coloring
Price color green if > than previous candle close and red if < previous candle close
RSI color green if < 30 and red if > 70 (RSI14 by default)
Volume color green if above average volume and red if less than that (SMA20 volume by default)
Can turn on/off whole table, header columns, row indices, or select individual columns or rows to show/hide
// Example Mixed Type Matrix To Table //
access the simple example script by uncommenting the code at the end
Basically I wanted to have the headers and indices as strings and the rest of the matrix for the table body as floats, then conditional coloring on the table cells
And also the functionality to turn rows and columns on/off from table through checkboxes of user input
Before I was storing each of the values separately in arrays that didn't have a centralized way of controlling table structure
so now the structure is :
- string header array, string index array
- float matrix for table body
- color matrix with bool conditions for coloring table cells
- bool checkboxes for controlling table display
Coins x Value CalculatorThrough this script you will be able to calculate in real time your total number of coins correlated to the value that is at that moment, so you will not need to log into the brokerage or be simulating sales to know what your total value is in the asset...
To use it, just add it to your favorites and then right after adding it to the chart, clicking on its gear, a field will appear for you to enter your total amount of coins corresponding to that chart, then immediately calculate the value that is the total of your coins , will also show the entire history of appreciation or devaluation that its capital corresponding to that asset had.
Translator Portuguese:
Através desse script você poderá calcular em tempo real o seu numero de moedas total correlacionado ao valor que se encontra naquele momento ,assim nao precisara logar na corretora ou ficar simulando vendas para saber qual valor esta seu total no ativo...
Para usar basta adicionar ele a seus favoritos e então logo após adicionar ao gráfico, clicando na engrenagem dele aparecera um campo para voce digitar sua quantidade de moedas total correspondente a aquele gráfico logo em seguida calculara imediatamente o valor que se encontra o total de suas moedas, também mostrara todo o histórico de valorização ou desvalorização que seu capital correspondente aquele ativo teve.
Fed and ECB Calendar by KziHello traders,
Here is a script that i've done for testing the timestamp and the input.time fonction.
You can see verticals lines blue and yellow.
The blue are the ECB meeting date (7 dates)
The yellow are the FED meeting date. (10 Dates)
// In the parameter you can enter the next rolling month date for ECB and FED
// I don't figure out how to add label / Txt on the lines
// And be carreful i don't put the real hours of the meeting.
positionsize calculatorHow to use:
Use the cursor to select the time, entry, stop loss, and target position. Enter the trading fee to calculate the reward/risk ratio and the actual reward/risk ratio (including the commission) according to the price you selected.
Known error:
Settings of this script can't be saved as default might due to the interactive price selection function. If anyone knows how to fix it, please let me know.
feature:
The visual Risk/Reward box, have three price labels on the right hand of the box.
Calculate the actual reward/risk ratio based on the trading fee.
The visual Risk/Reward box will extend automatically.
Syminfo [Epi]Hello! This little script tells you everything TradingView lets you access in a ticker's syminfo in Pine Script:
- description
- type: crypto, economic, forex, fund, futures, index, spread, stock
- tickerid, such as AMEX:BLOK
- prefix, such as AMEX
- Ticker, such as BLOK
- root: for derivatives such as futures contracts
- currency, such as USD
- base currency: returns 'BTC' for the ticker 'BTCUSD'
- mintick
- point value
- session: regular, extended
- timezone
Some surprises I found in my development:
- there are some more types than mentioned in the documentation,
- the tickerid takes on additional information if you adjust for dividends or show extended session,
- the prefix contains "_DL" additions depending on your data subscriptions, .e.g. "CME_MINI_DL:ES1!",
- with futures, TV will show session.regular both for the 'regular' and the 'electronic' session.
- Unfortunately, syminfo does not contain the 'sector', although TV has the information in the database (the sector is shown in the screener but not accessed in Pine Script).
I use this little utility in my development and hope it's useful for the community. I see such a great number of contributions from the community and would like to give back, even if it's not much.
Moon Launch Alerts Template [Indicator]I created this indicator/study script because i ran into the issue that the same Alerts would fire multiple times. For example it would trigger a Long signal when already being in a Long. I guess there would be no issue with a very basic strategy but with a larger script and many variables, it seemed to create complications.
This is resolved by a TradingLine oscillator and only when it switches to a new and different position from previous, will it trigger an Alert.
If you are in a Long and it signals Long again, then this is seen as a "Continuation Long" in the Alerts settings. You can use this condition to add to your existing position (Optional). Continuation signals are plotted as bright green/red dots.
You will notice there's an option to uncheck "Trade Shorts" and "Trade Exits" signals.
Lets say you choose not to trade Short and Exits, then your Long would only Exit once a Short signal is detected.
This could prove useful for Back-testing purposes.
This quick example script uses the EMA 10, EMA 200, emaPlus1Atr and emaMinus1Atr.
To use in your script, you will need to modify and add your own BUY/SELL/EXIT signals in the box where it says:
//// INPUT YOUR BUY/SELL/EXIT SIGNALS HERE: ////
//////////////////////////////////////////////////
Hope someone will find this useful, or even just as an additional visual confirmation for your own trading strategy and script.
Multi Asset + Correlation OverlayFrom time to time, you may want to overlay multiple assets on the same chart instead of using multi-chart views. This can be a much cleaner way of viewing and comparing multiple assets. There is some functionality built into TradingView that lets you do this to a certain extent, but I wanted additional options, correlation labeling and ways to adjust the overlay location. So, today I am releasing to the community my Multi-Asset + Correlation Overlay script / indicator.
What is does: This script allows you to overlay the price of any ticker onto your chart. It also labels the line with the ticker name, and calculates / labels the correlation coefficient of your newly overlayed asset.
How to use it: Add the indicator to your chart. Then, go into the indicator settings to set the ticker of the asset you want to pull in along with how you want to "offset" it. Your 2 tickers may not be priced near each-other, so the offset setting allows you to pull the ticker you added up/down to better visually align with your chart's price range/layout. For instance, if the asset you added is priced $400 higher than the underlying chart price, you may want to set the offset to -400.
If you would like to add multiple tickers and multiple overlays, you can do that by just adding the indicator to your chart more than once. The color is adjustable, and the ticker of the asset will print to the right of the line representing the asset price. The script also calculates the correlation coefficient between the ticker overlay and the underlying chart asset. The correlation coefficient prints to the right of the ticker.
Fusion: Big Arty CandlesAnyone who follows Arty knows about his "Big A** Candle" strategies.
I didn't like the BAC indicators that had code available so I wrote this one that has some decent flexibility and display options.
You can use this to enter a trade immediately after a BAC, probably in the opposite direction and ride the pullback that usually occurs or just use it to avoid trading until things settle down. I use it to avoid trading for a few bars on the 15 minute timeframe on bitcoin.
The settings are certainly not optimized so set them to whatever suits your needs as the defaults will probably be wrong for you.
The code is structured to easily drop into a bigger system so use it as a lone indicator or add the code to some bigger project you are creating. If you do integrate it into something else then send me a note as it would be nice to know it's being well used.
Finally, if you find value please do make a comment, give a thumbs up etc.
Enjoy and good luck!
Profit Harvester System
(1) Strategy Introduction
- This is a profit harvesting system, an optimized high frequency trading strategy, by invitation only
- It can achieve a stable average annual return and is suitable for most crypto-currency markets
- It is recommended that the initial capital of one crypto-currency pair is greater than 2000 USDT
- You need to bear some floating loss, but don't worry, the strategy will stop profit and reduce positions automatically
- Support leverage from 1 to 5 times, but note that there is a strong leveling risk when leverage is greater than 1 times
- Support strategy alerts. You can add alerts at the top of the trading panel
(2) Parameters
- Indicator Resolution
- Min Resolution (Minutes) : The resolution of the indicator, i.e. the interval for updating the indicator, default 240 minutes
- MA Trending Line
- Draw Trending Line? : Draw trend lines to determine the long/short direction
- Moving Average Type : Type of moving average, default is SMA
- Moving Average Period : The period of the moving average, SMA30 by default
- Normalized On Balance Volume
- Draw Normalized On Balance Volume? : Plot the normalized OBV to show the volume/price relationship
- Moving Average Type : Type of moving average, default is EMA
- Moving Average Period : The period of the moving average, EMA21 by default
- Sigma of Normalized On Balance Volume : Upper and lower range of normalized OBV for determining the energy of the volume/price relationship
- Trading settings
- What Trades Should Be Taken? : The trading direction, supports long only, short only or no trade
- Maximum Shares of Position : The maximum number of shares of the position, i.e. the initial capital (default is 2000) is divided into that number of shares equally
- First Shares on Entrying Position : The number of shares occupied when entrying position to avoid missing the trend market
- Profit Ratio for Average Entry Price : Close all positions and cancel all orders when the current price exceeds the average position price and the profit rate is reached
- Increase Ratio for Next Share : Equal proportion of the order price when adding position
- Trading Leverage (Risk Term) : Trading leverage supports from 1 to 5 times, 2 by default. However, there is a strong leveling risk when the leverage is greater than 1!
- Max Floating Loss of Equity (Risk Term) : How much do you wanna risk. When the max floating loss threshold is reached, the position will be closed and all orders will be canceled!
- Price Trail Stop : Whether enable price trail stop mode to obtain more profits
(3) About usage
- This strategy is by invitation only. If you are interested in this strategy or would like to use it, please leave a message
- The default parameters is suitable for VETUSDT, MATICUSDT, ATOMUSDT, XRPUSDT and so on
- It is highly recommended to use long-only direction rather than short-only direction because the market will not go down forever
(4) Exceptions
- When "Increase Ratio for Next Share" is too small and "Maximum Shares of Position" is too large, there may be an error that the number of orders exceeds 9000, which is caused by the limitation of tradingview itself
Happy trading and enjoy your life!
————————————————————————————————————————
(1) 策略简介
- 这是一个利润收割系统,一种优化的高频交易策略,仅限受邀请使用
- 可以达到稳定的平均年化收益率,且适用于大部分数字货币市场
- 建议单个数字货币交易对的基础资金大于2000USDT,避免单笔交易资金低于最低交易资金限制
- 需要您承受一定的浮亏,但是不用担心,本策略会自动执行止盈和解套
- 支持1至5倍的杠杆,但是需要注意,杠杆大于1倍时存在爆仓风险
- 支持策略提醒,在交易面板上方添加策略提醒即可
(2) 参数说明
- Indicator Resolution
- Min Resolution (Minutes) : 指标的分辨率,即更新指标的间隔,默认240分钟更新1次
- MA Trending Line
- Draw Trending Line? : 是否需要绘制趋势线,用于判断多空方向
- Moving Average Type : 移动平均线的类型,默认为SMA
- Moving Average Period : 移动平均线的周期,默认为240分钟下的30日均线
- Normalized On Balance Volume
- Draw Normalized On Balance Volume? : 是否需要绘制归一化OBV指标,该指标反应量价关系
- Moving Average Type : 移动平均线的类型,默认为EMA
- Moving Average Period : 移动平均线的周期,默认为240分钟下的21日均线
- Sigma of Normalized On Balance Volume : 归一化OBV的上下区间,用于判断量价关系的能量
- Trading settings
- What Trades Should Be Taken? : 代表可以交易的方向,支持仅多头、仅空头或不交易
- Maximum Shares of Position : 仓位的最大份数,即将初始资金(默认为2000)等分为该份数的资金
- First Shares on Entrying Position : 当开仓后,首仓占用的份数,以避免错过趋势行情
- Profit Ratio for Average Entry Price : 当前价格大于仓位均价,并达到该收益率时,关闭所有仓位并取消所有挂单
- Increase Ratio for Next Share : 等比加仓的价格比例
- Trading Leverage (Risk Term) : 交易杠杆,支持1-5倍杠杆,默认为2倍杠杆,但是杠杆大于1倍时存在爆仓风险!
- Max Floating Loss of Equity (Risk Term) : 自开仓开始,您愿意承受的最大浮亏,当达到该浮亏后,仓位全平并取消所有订单!
- Price Trail Stop : 是否启用尾单止盈模式,以收割更多的利润
(3) 使用说明
- 该策略仅限受邀请使用,如果您对该策略感兴趣或者想要使用我的脚本,请给我留言
- 默认参数适用于 VETUSDT MATICUSDT ATOMUSDT XRPUSDT 等交易对
- 强烈建议使用多头交易而不是空头交易,因为市场不会永远下跌
(4) 异常情况
- 当"Increase Ratio for Next Share"设置过小而"Maximum Shares of Position"设置过大时,可能会出现订单数量超过9000的错误,这是tradingview本身的限制导致的
祝大家交易愉快
Backtesting- IndicatorFor anyone interested, Here is an example of how to put backtesting results into an Indicator. This calculates the same values as you find in the Summary Screen of the built in Strategy backtester. This will use the same result size as the standard backtester i.e. 5 minute chart grabs roughly 1 month of data, 1 minute chart grabs 1 week of data, etc... I tried to keep this as self-contained as possible so I put most of the code for the results in the bottom of the Indicator. The results stop at the last completed trade signal i.e. a Buy has a Sell to it. This is the same indicator I posted earlier with the PCT Trailing StopLoss so you will see that code in here as well. As said in my previous posting, the indicator is just a simple EMA crossover to give it something to do and I would not recommend using this indicator on its own, but instead copy the code to your own indicator if you find it useful. I also left the code in so that you can switch back to a Strategy if you want to verify the results.
Additional Notes:
- The results are within an acceptable margin of error due to the fact that the Indicator is having to calculate based on when the Buy and Sell Signal occur as opposed to when actual trades occur like in the Strategy Backtester
- I was trying to find a way to set the number of Buy Signals to use i.e. show me the results from the past 100 trades but couldn't sort out the logic. I am open to suggestions. Also keep in mind I am not a coder by profession so if you have any ideas on that front, please explain it to me as though I am a 5 year old child and provide code examples if possible :)
- I included the Strategy results in the Screen Shots so that you can see where the results line up.
Additional Additional Note:
This is not financial advice. Use at your own risk.