Conditional Formula with Multiple Columns - Help!

matthewlouis

Active Member
Joined
Mar 28, 2014
Messages
374
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have 3 columns of stock prices – the date, the low, the high, and the close. I am trying to build a formula (may have to be in multiple columns with each column having its own formula) that returns the A point price, B point price, and C point price of something called the ABCD pattern -- D is the calculated projection of price based on the price of A, B, and C. Very accurate and time tested way to project prices. I need to an algoto calculate this everyday without having to look at a chart.

A bullish pattern is when the price starts off at a low point – Point A of the ABCD pattern. As price rises, the B point is formed once you get a lower high and lower low. Then when you get a higher high and higher low, the price previous to that bar is the C point. This may be multiples formulas (I think) that will identify the A, B, and C points given the higher highs, higher lows, lower highs, and lower lows. It has to be looked day-by-day to see if any of these A, B, or C price points have been created.

NOTE: The pattern is broken IF the price forms the ABC part of the pattern and then price CLOSES below A. That’s a failed pattern.

I don’t know how to do VBA – which I think would work best – so can anyone help me do this in columns with formulas for each column?

Thanks in advance!

HIGHLOWCLOSE
4/6/20182,656.882,586.272,604.47
4/9/20182,653.552,610.792,613.16
4/10/20182,665.452,635.782,656.87
4/11/20182,661.432,639.252,642.19
4/12/20182,674.722,653.832,663.99
4/13/20182,680.262,645.052,656.30
4/16/20182,686.492,665.162,677.84
4/17/20182,713.342,692.052,706.39
4/18/20182,717.492,703.632,708.64
4/19/20182,702.842,681.902,693.13
4/20/20182,693.942,660.612,670.14
4/23/20182,682.862,657.992,670.29
4/24/20182,683.552,617.322,634.56
4/25/20182,645.302,612.672,639.40
4/26/20182,676.482,647.16
2,666.95


The A point is the low on April 6 of 2656.88.

The B point is April 18 at 2717.49 because April 19 had a lower low and lower high than APril18.

The C point low is April 25 at 2612.67 because April 26 had a higher high and a higher low than April 25.




<tbody>
</tbody>
 
Last edited by a moderator:
The D is calculated once you have the A, B, and the C. Not sure we are connecting on how an ABCD works (?)

So let's say 2553.80 in the low in this example. I have put all your formulas in place. This is what it says.

4/6/20182,656.882,586.272,604.472,586.272,586.27TRUEFALSEFALSE0.000.00
4/9/20182,653.552,610.792,613.16FALSETRUE2,586.27FALSETRUEFALSEFALSE0.000.00
4/10/20182,665.452,635.782,656.87FALSEFALSE2,586.27FALSETRUEFALSEFALSE0.000.00
4/11/20182,661.432,639.252,642.19FALSETRUE2,586.27FALSETRUEFALSEFALSE0.000.00
4/12/20182,674.722,653.832,663.99FALSEFALSE2,586.27FALSETRUEFALSEFALSE0.000.00
4/13/20182,680.262,645.052,656.30FALSETRUE2,586.27FALSETRUEFALSEFALSE0.000.00
4/16/20182,686.492,665.162,677.84FALSETRUE2,586.27FALSETRUEFALSEFALSE0.000.00
4/17/20182,713.342,692.052,706.39FALSETRUE2,586.27FALSETRUEFALSEFALSE0.000.00
4/18/20182,717.492,703.632,708.64FALSEFALSE2,586.27FALSETRUEFALSEFALSE0.000.00
4/19/20182,702.842,681.902,693.13TRUEFALSE2,586.27FALSETRUETRUEFALSE2,693.130.00
4/20/20182,693.942,660.612,670.14TRUEFALSE2,586.27FALSETRUETRUEFALSE2,693.130.00
4/23/20182,682.862,657.992,670.29TRUEFALSE2,586.27FALSETRUETRUEFALSE2,693.130.00
4/24/20182,683.552,617.322,634.56FALSEFALSE2,586.27FALSETRUETRUEFALSE2,693.130.00
4/25/20182,645.302,612.672,639.40TRUETRUE2,586.27FALSETRUETRUETRUE2,693.132,639.40
4/26/20182,676.482,647.162,666.94FALSETRUE2,586.27FALSETRUETRUETRUE2,693.132,639.40
4/27/20182,677.352,659.012,669.91FALSETRUE2,586.27FALSETRUETRUETRUE2,693.132,639.40

<tbody>
</tbody>


I can;t follow what this is telling me. The B point is 2717.49 on April 18 -- but I don;t see that anywhere. The C point is 2,612.67 on April 25 but I don;t see that either.
 
Last edited:
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Two reasons:
1st problem
Note you haven't said which of the three prices you want, so I have assumed you want the close price (column D)
You never told me that you wanted the High price for the B point,
To get the high price you need to change the D2 to B2 in the B trigger equations
2:nd PRoblem
You state that the B point is on the 18 April, however if you look at the B trigger it only goes true on the 19th april, This is because the equation is using data that is only available on the 19th. So If you want to use price on the 18th you must realise that you will only know that it is a B trigger a day later.
If you want to do both of these go to the third line down where the equations shows D3 and change this to B2 and copy down , that will give you the figure you are expecting. I would guess that that C trigger is similar but i haven't looked at it.
 
Upvote 0
Sorry, I know I didn;t explain it well.

The C Trigger worked. Regarding the B Trigger, is there any way to subract a row to get it? It returns the 2702 as you said it would and the one prior to it is 2717, that is the B Point.

Thanks so much for your patience with me and ALL your help.
 
Last edited:
Upvote 0
Hey offthelip! Got the ABCD sheet figured out now. . . could not have done this without your help, thanks so much, you're awesome.

I did an Index and Match to get the B Point High using the last 0.00 as the search and match. Works perfect.

Thanks again !! :)
 
Last edited:
Upvote 0
The C Trigger worked. Regarding the B Trigger, is there any way to subract a row to get it? It returns the 2702 as you said it would and the one prior to it is 2717, that is the B Point.
You don't need to use index and match to get the B trigger price ( that is a horrible way of doing it) just change the Row number of the value you are picking up for hte B trigger price. i.e on row 11 column M of my workbook I have got:
Code:
=IFERROR(IF(AND(K11,NOT(K10)),B10,M10),0)
If you change this to
Code:
=IFERROR(IF(AND(K11,NOT(K10)),B9,M10),0)
and then copy this to the whole column you will pick up the previous day's High price for the trigger.
Look through all the equations I have written and try and understand what I have done, this will allow you to modify it to your own requirements. ( Like this modification)
 
Upvote 0
Well . .. running into some that work and some that don't work. Hmmmm. I made the change to
=IFERROR(IF(AND(K11,NOT(K10)),B9,M10),0)

This is the B Triggered formula =IFERROR(IF(AND(K11,G11),TRUE,AND(L10,NOT(J11))),"")

Does that one need to be adjusted?

Again, some of the highs are correct and some are not. (??)
 
Last edited:
Upvote 0
Well phooey, I had the number in wrong spot, it works, sorry to bother you.
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top