tijan84

X% Drop in X Days, sold X Days after

tijan84 Mis à jour   
It identifies potential buy signals based on a specified percentage drop in price over a set number of days and calculates the total profit or loss (P/L) over a predefined period. Here's a breakdown of the script and its key parameters:

Script Description:
Indicator Name: "X% Drop in X Days, sold X Days after"

Functionality:
The script signals a buy opportunity when the price of an asset drops by a certain percentage (percentage_drop) within a specified length (length) in days.
It calculates the profit or loss percentage after a set number of days (hold_days) from the buy signal.
The script also displays the cumulative total profit or loss over a specified time frame, from a start date (start_period) to an end date (end_period), which is by default set to the current date.
Display:
Buy signals are marked on the chart.
The profit or loss for each trade after the hold period is displayed.
A label showing the total cumulative profit or loss, along with the start and end dates, is displayed on the chart.
Key Parameters:
percentage_drop (10.0% by default): The percentage decrease in price that triggers a buy signal. It represents the threshold for the price drop to consider a buying opportunity.

length (3 days by default): The period over which the drop in price is considered. It's the timeframe used to evaluate the percentage drop.

hold_days (30 days by default): The duration for holding the asset after the buy signal before selling. This parameter defines the time after which the profit or loss is calculated.

start_period (Set to "2022-11-21" by default): The beginning date for calculating the cumulative total profit or loss. This parameter allows the user to define a specific starting point for the analysis.

end_period (Set to the current date by default): The end date for the cumulative total profit or loss calculation. It defaults to the current date but can be set to a specific date for backtesting purposes.

Script Mechanics:
Buy Signal Logic: A buy signal is generated when the closing price is below the highest price of the last 'length' days, adjusted by the 'percentage_drop'.
Profit/Loss Calculation: For each buy signal, the script calculates the profit or loss percentage after 'hold_days' from the purchase. This is displayed on the chart for each trade.
Total P/L Display: The script calculates and displays the cumulative total profit or loss in the defined period (from 'start_period' to 'end_period') in a label on the chart.
Usage:
This script is useful for traders who follow a strategy based on buying assets after significant price drops and holding for a predetermined period. It automates the detection of potential buy opportunities and the calculation of profit or loss, aiding in decision-making and performance analysis.
Notes de version:
It identifies potential buy signals based on a specified percentage drop in price over a set number of days and calculates the total profit or loss (P/L) over a predefined period. Here's a breakdown of the script and its key parameters:

Script Description:
Indicator Name: "X% Drop in X Days, sold X Days after"

Functionality:
The script signals a buy opportunity when the price of an asset drops by a certain percentage (percentage_drop) within a specified length (length) in days.

Key Parameters:
percentage_drop (5.0% by default): The percentage decrease in price that triggers a buy signal. It represents the threshold for the price drop to consider a buying opportunity.

length (3 days by default): The period over which the drop in price is considered. It's the timeframe used to evaluate the percentage drop.

hold_days (14 days by default): The duration for holding the asset after the buy signal before selling. This parameter defines the time after which the profit or loss is calculated.

start_period (Set to "2022-11-21" by default): The beginning date for calculating the cumulative total profit or loss. This parameter allows the user to define a specific starting point for the analysis.

end_period (Set to the current date by default): The end date for the cumulative total profit or loss calculation. It defaults to the current date but can be set to a specific date for backtesting purposes.

Script Mechanics:
Buy Signal Logic: A buy signal is generated when the closing price is below the highest price of the last 'length' days, adjusted by the 'percentage_drop'.
Profit/Loss Calculation: For each buy signal, the script calculates the profit or loss percentage after 'hold_days' from the purchase. This is displayed on the chart for each trade.
Total P/L Display: The script calculates and displays the cumulative total profit or loss in the defined period (from 'start_period' to 'end_period') in a label on the chart.
Usage:
This script is useful for traders who follow a strategy based on buying assets after significant price drops and holding for a predetermined period. It automates the detection of potential buy opportunities and the calculation of profit or loss, aiding in decision-making and performance analysis.
Notes de version:
It identifies potential buy signals based on a specified percentage drop in price over a set number of days and calculates the total profit or loss (P/L) over a predefined period. Here's a breakdown of the script and its key parameters:

Script Description:
Indicator Name: "X% Drop in X Days, sold X Days after"

Functionality:
The script signals a buy opportunity when the price of an asset drops by a certain percentage (percentage_drop) within a specified length (length) in days.

Key Parameters:
percentage_drop (5.0% by default): The percentage decrease in price that triggers a buy signal. It represents the threshold for the price drop to consider a buying opportunity.

length (3 days by default): The period over which the drop in price is considered. It's the timeframe used to evaluate the percentage drop.

hold_days (30 days by default): The duration for holding the asset after the buy signal before selling. This parameter defines the time after which the profit or loss is calculated.

start_period (Set to "2022-11-21" by default): The beginning date for calculating the cumulative total profit or loss. This parameter allows the user to define a specific starting point for the analysis.

end_period (Set to the current date by default): The end date for the cumulative total profit or loss calculation. It defaults to the current date but can be set to a specific date for backtesting purposes.

Script Mechanics:
Buy Signal Logic: A buy signal is generated when the closing price is below the highest price of the last 'length' days, adjusted by the 'percentage_drop'.
Profit/Loss Calculation: For each buy signal, the script calculates the profit or loss percentage after 'hold_days' from the purchase. This is displayed on the chart for each trade.
Total P/L Display: The script calculates and displays the cumulative total profit or loss in the defined period (from 'start_period' to 'end_period') in a label on the chart.
Usage:
This script is useful for traders who follow a strategy based on buying assets after significant price drops and holding for a predetermined period. It automates the detection of potential buy opportunities and the calculation of profit or loss, aiding in decision-making and performance analysis.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?