0% found this document useful (0 votes)
14 views4 pages

How To Find Resistance

This document provides steps to calculate trading signals for an N-day breakout system in Excel. It describes calculating the N-day high and low, then the trading signal based on comparing the current day's price to the highs and lows. It notes this is a simple example and real strategies can be more complex.

Uploaded by

Dick Logic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

How To Find Resistance

This document provides steps to calculate trading signals for an N-day breakout system in Excel. It describes calculating the N-day high and low, then the trading signal based on comparing the current day's price to the highs and lows. It notes this is a simple example and real strategies can be more complex.

Uploaded by

Dick Logic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

To calculate trading signals for an N-day breakout system in Excel, you will need to use

formulas and conditional statements. Below are the steps to do this:

Assumptions:

• You have a column of historical price data in ascending order, with the most
recent price at the bottom.
• N represents the number of days you want to use for the breakout calculation
(e.g., 20 days).

Steps:

1. Calculate the N-day high and low: In separate columns, calculate the N-day high
and low for each day. For example, if your price data is in column A, and you
want to calculate the 20-day high and low, you can use the following formulas
starting from row 22 (assuming you have headers in row 1):
• To calculate the 20-day high: =MAX(OFFSET($A$2,COUNT(A:A)-ROW(A22)-
19,0,20,1))
• To calculate the 20-day low: =MIN(OFFSET($A$2,COUNT(A:A)-ROW(A22)-
19,0,20,1))
2. Calculate the trading signal: Next, you need to determine the trading signal
based on the current day's price compared to the N-day high and low.
• Create a new column, let's say in column C, and label it "Signal."
• In cell C22 (assuming you have headers in row 1), use the following formula to
calculate the signal: =IF(A22 > B22, "Buy", IF(A22 < C22, "Sell", ""))

This formula checks if the current day's price (cell A22) is greater than the 20-day high
(cell B22). If it is, it assigns "Buy" to the signal. If not, it checks if the current day's price is
lower than the 20-day low (cell C22) and assigns "Sell" to the signal. If neither condition
is met, the cell is left empty ("").

3. Interpret the signals: You can visually interpret the signals in the "Signal" column.
When it says "Buy," it indicates a potential long entry signal, and when it says
"Sell," it indicates a potential exit or short entry signal.

Remember that this is a simple example, and real trading strategies can be more
complex with additional factors like stop-loss and take-profit levels, risk management,
and transaction costs. Always thoroughly test your trading strategies on historical data
and consider the associated risks before using them in live trading.
To add an index to a table in MySQL using the ALTER TABLE statement, you can use the
ADD INDEX or ADD KEY clause. Here's the general syntax:

sqlCopy code
ALTER TABLE table_name ADD INDEX index_name (column1, column2, ...);

or

sqlCopy code
ALTER TABLE table_name ADD KEY index_name (column1, column2, ...);

Where:

• table_name is the name of the table to which you want to add the index.
• index_name is the name you want to give to the index. This is optional, and if not
provided, MySQL will generate a name automatically.
• column1, column2, ... are the column(s) you want to include in the index. You
can specify multiple columns to create a composite index.

Here's an example of adding an index to a table:

Let's assume you have a table named employees , and you want to add an index on the
last_name column:

sqlCopy code
ALTER TABLE employees ADD INDEX idx_last_name (last_name);

Or you can use the ADD KEY clause:

sqlCopy code
ALTER TABLE employees ADD KEY idx_last_name (last_name);

Both of these statements will add an index named idx_last_name to the last_name
column in the employees table.

If you want to create a composite index on multiple columns, you can list those columns
within the parentheses:

sqlCopy code
ALTER TABLE employees ADD INDEX idx_full_name (first_name, last_name);
This will create an index named idx_full_name on both the first_name and
last_name columns in the employees table.

Remember that adding an index can impact the performance of your database, so make
sure to carefully consider which columns to include in the index based on your query
patterns. Also, keep in mind that adding an index to large tables may take some time,
during which the table may be locked for writes. Plan the index addition during a
maintenance window if necessary.

To add an index to a table in MySQL using the ALTER TABLE statement, you can use the
ADD INDEX or ADD KEY clause. Here's the general syntax:

sqlCopy code
ALTER TABLE table_name ADD INDEX index_name (column1, column2, ...);

or

sqlCopy code
ALTER TABLE table_name ADD KEY index_name (column1, column2, ...);

Where:

• table_name is the name of the table to which you want to add the index.
• index_name is the name you want to give to the index. This is optional, and if not
provided, MySQL will generate a name automatically.
• column1, column2, ... are the column(s) you want to include in the index. You
can specify multiple columns to create a composite index.

Here's an example of adding an index to a table:

Let's assume you have a table named employees , and you want to add an index on the
last_name column:

sqlCopy code
ALTER TABLE employees ADD INDEX idx_last_name (last_name);

Or you can use the ADD KEY clause:

sqlCopy code
ALTER TABLE employees ADD KEY idx_last_name (last_name);
Both of these statements will add an index named idx_last_name to the last_name
column in the employees table.

If you want to create a composite index on multiple columns, you can list those columns
within the parentheses:

sqlCopy code
ALTER TABLE employees ADD INDEX idx_full_name (first_name, last_name);

This will create an index named idx_full_name on both the first_name and
last_name columns in the employees table.

Remember that adding an index can impact the performance of your database, so make
sure to carefully consider which columns to include in the index based on your query
patterns. Also, keep in mind that adding an index to large tables may take some time,
during which the table may be locked for writes. Plan the index addition during a
maintenance window if necessary.

You might also like