tijan84

X% Drop in X Days, sold X Days after

tijan84 已更新   
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.
版本注释:
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.
版本注释:
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.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?