Scale In : Scale OutScale In : Scale Out strategy is an adaptation and extension of dollar-cost-averaging.
As the name implies it not only scales in - allocates a given percentage of available capital to buy at each bar - it also scales out - sells a given percentage of holdings at each bar when a target profit level is reached.
The strategy can potentially mitigate risks associated with market timing.
Although dollar-cost-averaging is often recommended as a strategy for building a position, the management of taking and retaining profits is not often addressed. This strategy demonstrates the potential benefits of managing both the building and (full or partial) liquidation of an investment.
We do not provide any mechanism for managing stop losses. We assume a scale in/out strategy will typically be applied to investing in assets with a high conviction thesis based on criteria external to the strategy. If the strategy does not perform, then the thesis may need to be re-evaluated, and the position liquidated. Even in this case, scaling out should still be considered.
Dollar
Average purchase price 0.1 [PATREND]
Average purchase price
This tool calculates the average purchase and sell price and the profit/loss ratio for the selected symbol based on the user's inputs for the purchase and sell prices and the entry and exit amounts.
Using Average purchase price with DCA strategy
This tool can be used to track the performance of your dollar cost averaging (DCA) investment strategy.
This tool allows you to enter information about your purchase and sell transactions, such as the purchase and sell price and the entry and exit amount, and it calculates the average purchase and sell price and the profit/loss ratio based on this information.
When using a DCA strategy, you can enter information about your regular purchase and sell transactions and the tool will calculate the average purchase and sell price for you.
You can use this information to determine if your strategy is working well and make the necessary adjustments.
In addition, this tool can help you determine when you should increase or decrease the regular investment amounts that you make as part of your DCA strategy.
It can also show you the profit/loss ratio for each sell transaction that you made.
_________________________________
We hope you find it useful.
Don't hesitate to try this tool and customize its settings to meet your trading needs.
We look forward to seeing your opinions and comments.
______________________________________________________________________________________________________
Average purchase price
هذه الأداة تحسب متوسط سعر الشراء والبيع ونسبة الربح / الخسارة للرمز المحدد بناءً على إدخالات المستخدم لأسعار الشراء والبيع ومبالغ الدخول والخروج.
استخدام Average purchase price مع استراتيجية DCA
يمكن استخدام هذه الأداة لتتبع أداء استراتيجية الاستثمار المتوسط التكلفة الدولارية (DCA) الخاصة بك.
تتيح لك هذه الأداة إدخال معلومات عن عمليات الشراء والبيع الخاصة بك، مثل سعر الشراء والبيع وكمية الدخول والخروج، ويقوم بحساب متوسط سعر الشراء والبيع ونسبة الربح / الخسارة بناءً على هذه المعلومات.
عند استخدام استراتيجية DCA، يمكنك إدخال معلومات عن عمليات الشراء والبيع المنتظمة التي تقوم بها وستقوم الأداة بحساب متوسط سعر الشراء والبيع لك. يمكنك استخدام هذه المعلومات لتحديد ما إذا كانت استراتيجيتك تعمل بشكل جيد وإجراء التعديلات اللازمة.
بالإضافة إلى ذلك
يمكن لهذه الأداة مساعدتك في تحديد متى يجب عليك زيادة أو تقليل مبالغ الاستثمار المنتظمة التي تقوم بها كجزء من استراتيجية DCA. كما يمكنها أن تظهر لك نسبة الربح / الخسارة في كل عملية بيع قمت بها.
تصرف كخبير ترجمه مختص باسواق المال وترجم هذا النص للغه الانكليزيه بشكل دقيق
_________________________________
نأمل أن تجدوه مفيدًا لكم .
لا تترددوا في تجربة هذه الأداة وتخصيص إعداداتها لتلبية احتياجاتكم التداولية.
نتطلع إلى رؤية آرائكم وتعليقاتكم .
TTP AbsolutnoAbsolutno is a pine script strategy for backtesting DCA bots with a different approach for placing both safety orders and take profit levels.
Motivation
Using DCA bots with safety orders most of the time is great during bull markets but in bear markets and strong downtrends it can be really challenging to close your deals only relying on safety orders placed based on percentages: price scale and volume scale.
In the past we introduced a script called "add funds simulator" that people used for sending alerts to bots to add funds and help closing deals in red.
We want to cross the use of TA with the safety orders with the intention of getting better results than statically placed safety orders.
What does Absolutno do?
Absolutno uses TA for safety orders, both for opening new safety orders and also to define how low they should be placed based on the volatility of the asset.
Main features
- ATR SO mode: Safety orders can be placed dynamically based on the general volatility of the asset plus the current volatility.
- TA based SO entries: Safety orders are only placed when the deal start condition is true not only when the price pulls back below the next safety order price level. This acts like a hybrid between "add funds simulator" and a traditional DCA bot. Once a safety order is filled, the next SO level gets active waiting for a DSC to trigger below the new entry level.
- Take profit scale: Traditional DCA bots offer a percentage or TA based exit conditions. Absolutno offers a new mode when you can decide to increase or decrease the TP level with each SO getting filled. For example a value of 1.1 TP scale will cause that each SO getting filled makes the TP% grow 10%. A value of 0.9% will reduce each SO by 10%. The lower the price goes you can "lower your expectation", or if you are filling bullish you can actually increase it.
External signal
It comes with a built-in deal start condition that uses RSI cross over 30 which is used only for illustration purposes since Absolutno is designed to be used with external signals.
Use any external signal to enter a new deal and for adding new safety orders.
You can also activate external take profit signal.
When external TP is enabled, all TP features from the bot are disabled to only react to what the external signal instructs the bot.
Bot integration and alerts
Three type of alerts will be sent to the bot: open deal, add funds and close deal.
You will need to enter your bot id and email token in the settings.
Since this strategy uses add funds: you must be aware that the alerts sent from this strategy will contain the amount of funds to add and therefore the bot receiving these alerts will respect them EVEN if the bot was defined with different SO sizes.
Please make sure you fully understand this before using this signal.
The base order alerts don't contain funds information so the bot will always use the base order size as defined in its own settings.
Fiat Currency and Gold Indices (FGXY) CandlesA modification of my previous indicator "Crypto Index (DXY) Candles". The idea was to create a similar currency basket to the standard DXY, but from the perspective of other currencies. Still using the standard DXY weights, this indicator allows you to create a tailored index for other currencies, provided that a currency pair exists for each of the 6 components. This means that even currencies that aren't included should work in theory; just find the 3 character currency prefix used by tradingview and give it a shot! This indicator is useful for gauging how well countries/currencies are holding up and when paired with the standard DXY may help see potential inflection points. For use on longer time frames (~1h-~3d) as some of the data being pulled seems to have issues on lower timeframes.
USD Liquidity Conditions Index Swing Stock Strategy Original credits goes to @ElDoggo22 www.tradingview.com
I looked in the post created by him, of USD liquidity and I have noticed that if you are going to apply a percentile top and bottom to it, can become an interesting swing strategy for US Stocks.
So in this case I decided to create a 99th percentile for top and 4th percentile for bot with a big length, preferably 100+ candles, for this example i took 150.
Rules for entry :
Long : either bot or top lines are ascending
We exit long either the top line is descending, or we have sudden cross of the moving average with both top and bot within the same candle
Short: we enter short when we have a sudden cross down of the moving average with both top and bot within the same candle
We exit short when we have a cross over of the moving average with both top and bot within the same candle ( or we have a long entry condition)
If there are qny questions, please let me know !
AlgoTrade DCA Bot Backtester█ OVERVIEW
This script can be used to backtest DCA Bots. It draws inspiration from 3Commas and has most settings that are available on 3Commas. It contains a few popular DCA Bot Presets that are well known in the community for you to test out! Preset used here: Kirigakure V4
█ FEATURES
DCA Preset (Custom, Standard TA,Urma Lite V3,Kirigakure V1,Kirigakure V3,Kirigakure V4)
Order Size Type (Fixed/% of equity to simulate compounding)
Base Order Size
Safety Order Size
Max Safety Trades Count
Price Deviation to open safety order %
Safety Order Volume Scale
Safety Order Step Scale
Take Profit %
Use ADR (Average Daily Range) as Take Profit
ADR length (if ADR as take profit is enabled)
Take Profit Type (% from total volume / % from base order)
Trailing Take Profit
Stop Loss
Deal Start Condition (Start ASAP) ▶ More Deal Starting Conditions will be added in the future
Bot Direction (Long / Short)
Start Time ▶ 1999-01-01 (Use this to always backtest the entire history)
End Time
This strategy also allows you to plot the Average Price and Take Profit of each trade, so it's easier to follow the trade and understand what's happening.
█ HOW TO USE
1. Select a DCA Preset and change the initial capital to the exact amount that is required (seen in the error message on top of the table). When using a Preset the following settings will be locked, meaning if you change them in the script's settings it won't have any effect:
Base Order Size
Safety Order Size
Max Safety Trades Count
Price Deviation to open safety order %
Safety Order Volume Scale
Safety Order Step Scale
Use ADR (Average Daily Range) as Take Profit
1.1 When using Presets you can choose the Order Size Type of Fixed or % of equity which simulates compounding
1.2 Choose a Direction and a Start and End Time
2. To backtest customized settings choose the preset "Custom"
2.1 All other settings are now "unlocked" and can be used
█ LIMITATIONS
Whenever a DCA preset is changed the initial_capital needs to be changed to the exact amount the settings require. If the initial_capital is not the same there will be an error of top of the table. To fix this error navigate to the Script's Settings and Properties and change the initial_capital to the same amount that is stated in the error.
DCA Bots with a high number of safety orders, e.g. 100, can run into an error that says "Maximum number of orders (9000) reached". If this error happens change the backtesting time to a shorter timeframe.
Using % of equity simulates compounding but is unrealistic because you cannot re-invest every single dollar
█ THANKS
This script in insipred by rouxam's "Backtesting 3commas DCA Bot v2" script
[RS]Dollar Composite IndexExperimental:
a composite of the dollar index with equal weights.
this is a repost of:
www.tradingview.com
TL Data PanelIntroducing the TraderLion Data Panel
Features
1. Plot Quarterly EPS & Sales in a table. Disclaimer | TradingView data for EPS & Sales can be highly inaccurate in some cases.
2. U/D Ratio - Calculates the Up/Down Volume Ratio on a 50 Day Average or 20 Day Average. A number above 1.5 will show in green.
3. DCR - Calculates the Daily Closing Range for the stock. It's green when the DCR is greater than your benchmark (set in indicator settings) and greater than 50%.
4. WCR - Calculates the Weekly Closing Range for the stock. It's green when the DCR is greater than your benchmark (set in indicator settings) and greater than 50%.
5. Extended - Calculates if the stock is extended vs the 10DMA and 10WMA. The output will be Yes or No.
6. RSNHBP Count - Counts the number of RSNHBP in the past 30 sessions. Higher the count the better the odds of a stock performing well in the markets.
7. HV Stats - This shows if a stock meets the HVE/HV1/HVIPO criteria. HVE - Highest Volume Ever. HV1 - Highest Volume in One Year. HVIPO - Highest Volume Since IPO.
Customizations
Up Down Volume Length - Toggle between 50 Day or 20 Day.
Average $ Volume Length - Toggle between 50 Day or 20 Day.
Closing Range Benchmark - Set your benchmark vs any index.
RS Benchmark - Calculate RSNHBP benchmark vs any index.
Table Size - Tweak table size on personal preference.
Table Position - Tweak table position to top right, bottom left, bottom right, or top left.
Margins vs ROE - Toggle this setting to display Margins or ROE.
Color Theme - Toggle between Light or Dark Theme.
If you have any questions, please post them in the comments below!
DCA Bot IndicatorName: DCA Bot Indicator
Category: Dollar Cost Average.
Operating mode: Alerts at a specific time, day of the week and day of the month.
Trades duration: N/A.
Timeframe: 1H
Suggested usage: long-term investing DCA strategies.
Entry: Only indicates the time and then the day of the week or the day of the month to buy.
Exit: As per long-term Investor’s strategy.
Usage: If you want to perform a Dollar Cost Averaging approach with:
- Daily purchases (at a specific time)
- Weekly purchases (at a specific time and day of the week)
- Monthly purchases (at a specific time and day of the month)
It is then possible to set the alert text with a preferred message or for use with trade automation systems. The green background identify the specific time chosen.
It is possible to identify through the Bias Analyzer the best time for the daily purchase.
Configuration:
- Buy Time: hour you would like to buy, please consider that the script is executed at the end of the defined time, so if you would like to buy at 2, have to put 1.
- Buy only Days of the Week: you can select the day you want.
- Buy only on Day of Month, you can specify a specific day.
Credits:
- dsteaves for inspiration
{Gunzo} Stock to Flow (Gold, Silver, Dollar, Bitcoin)This indicator displays the Stock to Flow (S2F) ratio for popular commodities (Gold, Silver, Dollar, Euro, Bitcoin, Ethereum) in order to
compare them and determine which ones could be a good Store of Value (SoV).
OVERVIEW :
Stock to Flow is a popular indicator used to predict commodities scarcity. It evaluates the total stock of a commodity against the total amount that can be produced during a year. This model supposes that if scarcity is increasing, the price is going to increase.
This model has been used over the last years on Bitcoin to determine if the asset was undervalued or overvalued, and even make prediction models on the future price.
This script is going to focus on the Stock to Flow ratio (total stock/amount produced) to compare the following assets over time :
Mining resources (mined) for Gold and Silver
Cryptos assets (mined) for Bitcoin and Ethereum
FIAT currencies (banknotes printed) for Dollar and Euro
CALCULATION :
The calculation of the Stock to Flow ratio evaluates the total stock of a commodity produced against the production made for a specific year. The data is calculated on a yearly basis, then interpolated to get monthly or daily values.
DATA ORIGIN :
The main information needed to calculate the Stock to Flow ratio is the "yearly production" of a commodity. I tried to retrieve that information from the most reliable sources :
for Gold from research on www.gold.org
for Silver from research on www.silverinstitute.org
for Ethereum from research on etherscan.io
for Bitcoin from data source "QUANDL:BCHAIN/TOTBC" from www.quandl.com
for Dollar from research on www.federalreserve.gov
for Euro from research on www.ecb.europa.eu
SETTINGS :
Smoothing for interpolated data : Smoothing factor for assets that are calculated yearly and then interpolated (Gold, Silver, Dollar, Euro, and Ethereum)
Smoothing for non interpolated data : Smoothing factor for assets that are calculated daily and not interpolated (Bitcoin)
Display asset names : Display assets names in a colored rectangle on the right side of the chart
Display asset values : Display assets Stock to Flow ratio in a colored rectangle on the right side of the chart
Display key events for assets : Display important events for the assets at the bottom of the chart using the same color as the assets lines (for example Orange diamond is a Bitcoin halving). Please refer to the script code for the details of all events.
USAGE :
This script can be used on any asset available on TradingView as the data used is either static or external.
However I recommend using it the Gold asset from currency.com as the depth of the chart will be bigger (since 1980s).
It is recommended to used this script on the monthly timeframe as the chart data is calculated yearly and then interpolated.
Ticker Dashboard For Better Stock SelectionHey, this indicator will help you with your stock selection. The goal is to focus on stocks that move (higher ADR) and provide enough liquidity which means less risk.
ADR - Average Daily Range in % (measured from High to Low - does not include gaps like ATR does / Threshold color can be adjusted from input)
%Change - Current % change from prior close price
Vol- Todays Volume in MIO
ADV- Average Daily Volume in MIO - default set to 1 month (20 days, can be changed from input - Colored red if < 1 MIO)
$VOL- Dollar Volume - Average Daily Volume multiplied with the last daily close price. Important for liquidity issues.
TTP Gavin's DCA BacktestPurpose:
The DCA Backtest script was designed to backtest the performance of any indicator using DCA bots.
"Open Deal ASAP" Deal Start Condition:
This script offers "open deal ASAP" deal start condition which will continuously open new deals. IT will wait for the current deal to close before opening a new one.
"Script" Deal Start Condition:
If you select the "Script" deal start condition we provide Bollinger Bands as an example. You can tweak the BB parameters from the indicator settings menu.
"Indicator" Deal Start Condition:
The third option is "Indicator". For this option to work you must have an indicator that plots a unique value that can be recognised as a BUY signal.
We recommend that your indicator plots 1 when it should buy and 0 when there's no signal.
Once you have in the same chart your indicator and your DCA backtest it's time to hook them up. For that follow these steps:
1) select "Indicator" as deal start condition
2) select your indicator from the list as "deal start source"
3) If you are following our recommendation then use 1 as "deal start value" so it can tell the DCA backtest when to open a deal. Make sure that your indicator only plots 0 or 1 so the DCA backtest can distinguish the BUY signal appropriately.
Limitations:
Each time you make changes and save your external indicator while you are backtesting, you will have to hook up the indicator again with the DCA backtest in the settings.
To avoid this, add as many parameters as you need to change in the external indicator so in that way you won't need to save changes to it and therefore will manage to avoid having to hook up the indicator with the DCA backtest.
ETF / Stocks / Crypto - DCA Strategy v1Simple "benchmark" strategy for ETFs, Stocks and Crypto! Super-easy to implement for beginners, a DCA (dollar-cost-averaging) strategy means that you buy a fixed amount of an ETF / Stock / Crypto every several months. For instance, to DCA the S&P 500 (SPY), you could purchase $10,000 USD every 12 months, irrespective of the market price. Assuming the macro-economic conditions of the underlying country remain favourable, DCA strategies will result in capital gains over a period of many years, e.g. 10 years. DCA is the safest strategy that beginners can employ to make money in the markets, and all other types of strategies should be "benchmarked" against DCA; if your strategy cannot outperform DCA, then your strategy is useless.
Recommended Chart Settings:
Asset Class: ETF / Stocks / Crypto
Time Frame: H1 (Hourly) / D1 (Daily) / W1 (Weekly) / M1 (Monthly)
Necessary ETF Macro Conditions:
1. Country must have healthy demographics, good ratio of young > old
2. Country population must be increasing
3. Country must be experiencing price-inflation
Necessary Stock Conditions:
1. Growing revenue
2. Growing net income
3. Consistent net margins
4. Higher gross/net profit margin compared to its peers in the industry
5. Growing share holders equity
6. Current ratios > 1
7. Debt to equity ratio (compare to peers)
8. Debt servicing ratio < 30%
9. Wide economic moat
10. Products and services used daily, and will stay relevant for at least 1 decade
Necessary Crypto Conditions:
1. Honest founders
2. Competent technical co-founders
3. Fair or non-existent pre-mine
4. Solid marketing and PR
5. Legitimate use-cases / adoption
Default Robot Settings:
Contribution (USD): $10,000
Frequency (Months): 12
*Robot buys $10,000 worth of ETF, Stock, Crypto, regardless of the market price, every 12 months since its founding time.*
*Equity curve can be seen from the bottom panel*
Risk Warning:
This strategy is low-risk, however it assumes you have a long time horizon of at least 5 to 10 years. The longer your holding-period, the better your returns. The only thing the user has to keep-in-mind are the macro-economic conditions as stated above. If unsure, please stick to ETFs rather than buying individual stocks or cryptocurrencies.
XU030 USD Purchasing Power ~ Sarp GokdagWhere & How-To Use This Indicator?
This indicator is respectively composed for BIST:XU030 .
In matter, the user decides to use this indicator other than BIST:XU030 , the output of the indicator could be shown wrong.
What is it about?
It shows the purchasing power of BIST:XU030 against United States Dollar.
Although BIST:XU030 have tested new high's repeatedly since 2013, BIST:XU030 's returns on USD have been weakening since then.
DXY COT Commercial Net PositionsThis script was created due to the lack of position of US Dollar Index Futures (DXY).
It is designed to perform a much more liquid and inclusive position analysis.
As the exponential ratios do not mean anything to positions, weights are used as multipliers instead of exponential functions.
Swedish Krona (SEK) Futures are not directly quoted in Quandl, therefore weighted in Euro / dollar parity.
By perceiving these positions as inverse correlations, you can also identify where the world economy is doing well.
COT Commercial Net Positions are calculated as (Short - Long) because of Commercials act according to the reverse of the market.
In this way, you can follow up normally instead of reverse correlation.
Because except in extreme cases, in which case capitals usually shift to Gold.
This is not the case, since there is no capital inflow to other currencies, it is not a strong sell position to the dollar index.
When there is a shift in bonds, we see the effect of the dollar in general.
I created for the Dollar Index in order not to deviate from the concept.
I wanted to share it with everyone as I thought that you have important clues about how investors take positions.
Modified currency weights :
Euro : % 61.8
Japanese Yen : % 13.6
British Pound : %11.9
Canadian Dollar : % 9.1
Swiss Franc : % 3.6
NOTE : You can use it for all instruments except crypto coins, especially US Dollar Index (DXY).
Since the COT data is taken, it will not repaint in 1 week (1W) timeframe.
The log can also be repaint according to the time of data publication.
It will repaint in lower time frames.
I hope it will help your analysis and your scripts,regards.
Volume & Dollar BarsThis scriptlet is a part of an ongoing project and attempts at volume and dollar bar identification. The original idea is taken from excellent books 'Hands-On Machine Learning for Algorithmic Trading' (2019) by Stefan Jansen and 'Advances in Financial Machine Learning' (2018) by Marcos Lopez de Prado.
Statement of Purpose
I am an advocate of Open source and against those who publish their code with a lock icon. My code and ideas are aimed at people with critical thinking, who are able to take an informative and responsible decision when it comes to investing their funds. I do not guarantee that all of my ideas will perform well. As usual, they require a certain degree of your sound judgment. My final aim is to provide you with coding techniques that you could use in your own scripts and strategies.
Dollar Cost Averaging Only Red CandlesThis just shows you the results if, for example, you bought the closing price each day that formed a red candle.
Works on other timeframes than daily.
In the options you can set your own start date, as well as the dollar amount to spend on each buy.
Displays your dollar cost average, total invested, and total portfolio value over time.
Bitmex Dollar Value CalculatorWith this indicator you can easily calculate either the bitcoin value of a certain amount of dollars or the dollar value of your bitcoin (particularly helpful when trading on bitmex)
Tipjar : 38uGQJDDZDL6wX48x4gYTccPeQ3ZHVYmY4 (btc)
BTC Dollar VolumeVolume conversion indicator for coins traded to USD value. Does not work on exchanges with dollar volume already displayed. Will be updated with new features.
Bandas Dolar [SSTEAM]Channel for the Argentine dollar defined by the president of the BCRA Guido Sandleris.
Dollar Volume of BiznesFilosofI am infuriated with the wrong volumes. Because I decided to make my indicator with the true volume in dollars. I will tell about it in more detail on my channel in YouTube.
===
Меня бесят неправильные объемы. Потому, я решил сделать свой индикатор с истинным объемом в долларах. Подробней о нём расскажу на своём канале в Ютуб.
OJLJ Sintetic USD IndexThis script uses information of the principal USD pairs to create an Index:
(A). USDCAD chart is going up very fast, but If we see the USD INDEX we can see that the dollar is not doing the same.
(X). While USDCAD chart goes up with problems making investors to be afraid of a change the USD INDEX shows a normal and very stable increase
(Y). The USDCAD chart shows an importante decrease but after some time it goes to the initial position, the USD INDEX dont go down because the dollar force is the same, this means that the canadian dollar force has increase too
The mathematic methodology is private, but it uses percentile changes to be calculated and I have made some tests to make sure that results work perfectly fine, If you want to know more about the calculation or the test I have made, please send me a message
This indexes offer a way to:
+ Measure changes in an economy without being compared with another as the Forex pairs do
+ Analyze macroeconomic variables in the exchange rate of a determinate economy
+ Use candles instead of lines
+ The script have an input option were you can decide if use wicks or not (Not recomendable)
+ White color means it goes up while red means it goes down
+ The script works perfectly with all the time frames
+ Itcan be used with all the Forex pairs that include USD
Because of all the data used to be calculated this script normally compile after 10-20 seconds
I thought a lot about it and I did a lot of tests, Technical Indicators don’t work the same way that Forex, this index were created and published principaly for users who have more interest in the Fundamental analysis but It can be useful for everyone
Do you like this Index or have any Ideas ? Please let me know with a comment :)