TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule

TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions

Worden Discussion Forum » Customer Training & Support » PCFs, EasyScan and Custom Indicators » First Hour Range

Hello, when using platinum I am struggling to figure out a PCF that will allow me to look at the first half hour and/or first hour ranges in a PCF. Some of my trading evolves around breeches of these ranges?

Any thoughts?

There isn't any good way to do this in TC2000.

I can give you an option if you are willing to change all of the dates in a formula (probably using the replace function in a text editor).

It also has a limitation that the last 30-minute bar of the previous trading day needs to be distinctive enough (having an open, high, low, close, close and volume different from all of the other bars) to be able to determine how many bars have passed since the last 30-minute bar of the previous trading day.

With these limitations in mind, the following formula using a 30-minute time frame would give you the high of the first 30-minute bar of the current trading day.

IIF(O'10/17/18' = O1 AND H'10/17/18' = H1 AND L'10/17/18' = L1 AND C'10/17/18' = C1 AND V'10/17/18' = V1, H, IIF(O'10/17/18' = O2 AND H'10/17/18' = MAXH2 AND L'10/17/18' = L2 AND C'10/17/18' = C2 AND V'10/17/18' = V2, H1, IIF(O'10/17/18' = O3 AND H'10/17/18' = H3 AND L'10/17/18' = L3 AND C'10/17/18' = C3 AND V'10/17/18' = V3, H2, IIF(O'10/17/18' = O4 AND H'10/17/18' = H4 AND L'10/17/18' = L4 AND C'10/17/18' = C4 AND V'10/17/18' = V4, H3, IIF(O'10/17/18' = O5 AND H'10/17/18' = H5 AND L'10/17/18' = L5 AND C'10/17/18' = C5 AND V'10/17/18' = V5, H4, IIF(O'10/17/18' = O6 AND H'10/17/18' = H6 AND L'10/17/18' = L6 AND C'10/17/18' = C6 AND V'10/17/18' = V6, H5, IIF(O'10/17/18' = O7 AND H'10/17/18' = H7 AND L'10/17/18' = L7 AND C'10/17/18' = C7 AND V'10/17/18' = V7, H6, IIF(O'10/17/18' = O8 AND H'10/17/18' = H8 AND L'10/17/18' = L8 AND C'10/17/18' = C8 AND V'10/17/18' = V8, H7, IIF(O'10/17/18' = O9 AND H'10/17/18' = H9 AND L'10/17/18' = L9 AND C'10/17/18' = C9 AND V'10/17/18' = V9, H8, IIF(O'10/17/18' = O10 AND H'10/17/18' = H10 AND L'10/17/18' = L10 AND C'10/17/18' = C10 AND V'10/17/18' = V10, H9, IIF(O'10/17/18' = O11 AND H'10/17/18' = H11 AND L'10/17/18' = L11 AND C'10/17/18' = C11 AND V'10/17/18' = V11, H10, IIF(O'10/17/18' = O12 AND H'10/17/18' = H12 AND L'10/17/18' = L12 AND C'10/17/18' = C12 AND V'10/17/18' = V12, H11, IIF(O'10/17/18' = O13 AND H'10/17/18' = H13 AND L'10/17/18' = L13 AND C'10/17/18' = C13 AND V'10/17/18' = V13, H12, 1 / 0)))))))))))))

The following formula using a 30-minute time frame would return the low of the first 30 minutes of the current trading day.

IIF(O'10/17/18' = O1 AND H'10/17/18' = H1 AND L'10/17/18' = L1 AND C'10/17/18' = C1 AND V'10/17/18' = V1, L, IIF(O'10/17/18' = O2 AND H'10/17/18' = H2 AND L'10/17/18' = L2 AND C'10/17/18' = C2 AND V'10/17/18' = V2, L1, IIF(O'10/17/18' = O3 AND H'10/17/18' = H3 AND L'10/17/18' = L3 AND C'10/17/18' = C3 AND V'10/17/18' = V3, L2, IIF(O'10/17/18' = O4 AND H'10/17/18' = H4 AND L'10/17/18' = L4 AND C'10/17/18' = C4 AND V'10/17/18' = V4, L3, IIF(O'10/17/18' = O5 AND H'10/17/18' = H5 AND L'10/17/18' = L5 AND C'10/17/18' = C5 AND V'10/17/18' = V5, L4, IIF(O'10/17/18' = O6 AND H'10/17/18' = H6 AND L'10/17/18' = L6 AND C'10/17/18' = C6 AND V'10/17/18' = V6, L5, IIF(O'10/17/18' = O7 AND H'10/17/18' = H7 AND L'10/17/18' = L7 AND C'10/17/18' = C7 AND V'10/17/18' = V7, L6, IIF(O'10/17/18' = O8 AND H'10/17/18' = H8 AND L'10/17/18' = L8 AND C'10/17/18' = C8 AND V'10/17/18' = V8, L7, IIF(O'10/17/18' = O9 AND H'10/17/18' = H9 AND L'10/17/18' = L9 AND C'10/17/18' = C9 AND V'10/17/18' = V9, L8, IIF(O'10/17/18' = O10 AND H'10/17/18' = H10 AND L'10/17/18' = L10 AND C'10/17/18' = C10 AND V'10/17/18' = V10, L9, IIF(O'10/17/18' = O11 AND H'10/17/18' = H11 AND L'10/17/18' = L11 AND C'10/17/18' = C11 AND V'10/17/18' = V11, L10, IIF(O'10/17/18' = O12 AND H'10/17/18' = H12 AND L'10/17/18' = L12 AND C'10/17/18' = C12 AND V'10/17/18' = V12, L11, IIF(O'10/17/18' = O13 AND H'10/17/18' = H13 AND L'10/17/18' = L13 AND C'10/17/18' = C13 AND V'10/17/18' = V13, L12, 1 / 0)))))))))))))

The following formula using a 30-minute time frame would return the high of the first 60 minutes if the current trading day.

IIF(O'10/17/18' = O1 AND H'10/17/18' = H1 AND L'10/17/18' = L1 AND C'10/17/18' = C1 AND V'10/17/18' = V1, L, IIF(O'10/17/18' = O2 AND H'10/17/18' = H2 AND L'10/17/18' = L2 AND C'10/17/18' = C2 AND V'10/17/18' = V2, MAXH2, IIF(O'10/17/18' = O3 AND H'10/17/18' = H3 AND L'10/17/18' = L3 AND C'10/17/18' = C3 AND V'10/17/18' = V3, MAXH2.1, IIF(O'10/17/18' = O4 AND H'10/17/18' = H4 AND L'10/17/18' = L4 AND C'10/17/18' = C4 AND V'10/17/18' = V4, MAXH2.2, IIF(O'10/17/18' = O5 AND H'10/17/18' = H5 AND L'10/17/18' = L5 AND C'10/17/18' = C5 AND V'10/17/18' = V5, MAXH2.3, IIF(O'10/17/18' = O6 AND H'10/17/18' = H6 AND L'10/17/18' = L6 AND C'10/17/18' = C6 AND V'10/17/18' = V6, MAXH2.4, IIF(O'10/17/18' = O7 AND H'10/17/18' = H7 AND L'10/17/18' = L7 AND C'10/17/18' = C7 AND V'10/17/18' = V7, MAXH2.5, IIF(O'10/17/18' = O8 AND H'10/17/18' = H8 AND L'10/17/18' = L8 AND C'10/17/18' = C8 AND V'10/17/18' = V8, MAXH2.6, IIF(O'10/17/18' = O9 AND H'10/17/18' = H9 AND L'10/17/18' = L9 AND C'10/17/18' = C9 AND V'10/17/18' = V9, MAXH2.7, IIF(O'10/17/18' = O10 AND H'10/17/18' = H10 AND L'10/17/18' = L10 AND C'10/17/18' = C10 AND V'10/17/18' = V10, MAXH2.8, IIF(O'10/17/18' = O11 AND H'10/17/18' = H11 AND L'10/17/18' = L11 AND C'10/17/18' = C11 AND V'10/17/18' = V11, MAXH2.9, IIF(O'10/17/18' = O12 AND H'10/17/18' = H12 AND L'10/17/18' = L12 AND C'10/17/18' = C12 AND V'10/17/18' = V12, MAXH2.10, IIF(O'10/17/18' = O13 AND H'10/17/18' = H13 AND L'10/17/18' = L13 AND C'10/17/18' = C13 AND V'10/17/18' = V13, MAXH2.11, 1 / 0)))))))))))))

And the following formula using a 30-minute time frame would return the low of the first 60 minutes of the current trading day.

IIF(O'10/17/18' = O1 AND H'10/17/18' = H1 AND L'10/17/18' = L1 AND C'10/17/18' = C1 AND V'10/17/18' = V1, L, IIF(O'10/17/18' = O2 AND H'10/17/18' = H2 AND L'10/17/18' = L2 AND C'10/17/18' = C2 AND V'10/17/18' = V2, MINL2, IIF(O'10/17/18' = O3 AND H'10/17/18' = H3 AND L'10/17/18' = L3 AND C'10/17/18' = C3 AND V'10/17/18' = V3, MINL2.1, IIF(O'10/17/18' = O4 AND H'10/17/18' = H4 AND L'10/17/18' = L4 AND C'10/17/18' = C4 AND V'10/17/18' = V4, MINL2.2, IIF(O'10/17/18' = O5 AND H'10/17/18' = H5 AND L'10/17/18' = L5 AND C'10/17/18' = C5 AND V'10/17/18' = V5, MINL2.3, IIF(O'10/17/18' = O6 AND H'10/17/18' = H6 AND L'10/17/18' = L6 AND C'10/17/18' = C6 AND V'10/17/18' = V6, MINL2.4, IIF(O'10/17/18' = O7 AND H'10/17/18' = H7 AND L'10/17/18' = L7 AND C'10/17/18' = C7 AND V'10/17/18' = V7, MINL2.5, IIF(O'10/17/18' = O8 AND H'10/17/18' = H8 AND L'10/17/18' = L8 AND C'10/17/18' = C8 AND V'10/17/18' = V8, MINL2.6, IIF(O'10/17/18' = O9 AND H'10/17/18' = H9 AND L'10/17/18' = L9 AND C'10/17/18' = C9 AND V'10/17/18' = V9, MINL2.7, IIF(O'10/17/18' = O10 AND H'10/17/18' = H10 AND L'10/17/18' = L10 AND C'10/17/18' = C10 AND V'10/17/18' = V10, MINL2.8, IIF(O'10/17/18' = O11 AND H'10/17/18' = H11 AND L'10/17/18' = L11 AND C'10/17/18' = C11 AND V'10/17/18' = V11, MINL2.9, IIF(O'10/17/18' = O12 AND H'10/17/18' = H12 AND L'10/17/18' = L12 AND C'10/17/18' = C12 AND V'10/17/18' = V12, MINL2.10, IIF(O'10/17/18' = O13 AND H'10/17/18' = H13 AND L'10/17/18' = L13 AND C'10/17/18' = C13 AND V'10/17/18' = V13, MINL2.11, 1 / 0)))))))))))))

TY Sir! I did have to tweak the syntax a bit as the code as posted would not pass. Here is the final PCF for this. For some reason on my system, I had to add a lot of surrounding quotes to make it pass the syntax checker.

That is a bit odd as the versions posted seemed to work in my copy just fine. The only error I can think of that might happen is a division by zero errorr when it isn't running on the correct date. I am happy to read you were able to get it to work correctly on your system with the extra parantheses.

Just a note that there may be some indicator or indicators which might be shorter or work better than checking the open, high, low, close, and volume, but I do not know what, if anything, would do so.

Well appears that the forumula is not working this morning. (bumz).

Current Formula:

Another test I did was remove the IIF and just did a boolean eval and it appears to be working:

(O'10/18/18' = O1 AND H'10/18/18' = H1 AND L'10/18/18' = L1 AND C'10/18/18' = C1 AND V'10/18/18' = V1)

This evaluated to true:

The formulas aren't designed to return true or false. The formulas just return the high or low of the first 30 minutes or 60 minutes of the trading day when using a 30-minute time frame.

If you wanted to check for example if the current price was above this value, you would need to put the following in front of it:

C >

Resulting in the following:

C > IIF(O'10/18/18' = O1 AND H'10/18/18' = H1 AND L'10/18/18' = L1 AND C'10/18/18' = C1 AND V'10/18/18' = V1, H, IIF(O'10/18/18' = O2 AND H'10/18/18' = MAXH2 AND L'10/18/18' = L2 AND C'10/18/18' = C2 AND V'10/18/18' = V2, H1, IIF(O'10/18/18' = O3 AND H'10/18/18' = H3 AND L'10/18/18' = L3 AND C'10/18/18' = C3 AND V'10/18/18' = V3, H2, IIF(O'10/18/18' = O4 AND H'10/18/18' = H4 AND L'10/18/18' = L4 AND C'10/18/18' = C4 AND V'10/18/18' = V4, H3, IIF(O'10/18/18' = O5 AND H'10/18/18' = H5 AND L'10/18/18' = L5 AND C'10/18/18' = C5 AND V'10/18/18' = V5, H4, IIF(O'10/18/18' = O6 AND H'10/18/18' = H6 AND L'10/18/18' = L6 AND C'10/18/18' = C6 AND V'10/18/18' = V6, H5, IIF(O'10/18/18' = O7 AND H'10/18/18' = H7 AND L'10/18/18' = L7 AND C'10/18/18' = C7 AND V'10/18/18' = V7, H6, IIF(O'10/18/18' = O8 AND H'10/18/18' = H8 AND L'10/18/18' = L8 AND C'10/18/18' = C8 AND V'10/18/18' = V8, H7, IIF(O'10/18/18' = O9 AND H'10/18/18' = H9 AND L'10/18/18' = L9 AND C'10/18/18' = C9 AND V'10/18/18' = V9, H8, IIF(O'10/18/18' = O10 AND H'10/18/18' = H10 AND L'10/18/18' = L10 AND C'10/18/18' = C10 AND V'10/18/18' = V10, H9, IIF(O'10/18/18' = O11 AND H'10/18/18' = H11 AND L'10/18/18' = L11 AND C'10/18/18' = C11 AND V'10/18/18' = V11, H10, IIF(O'10/18/18' = O12 AND H'10/18/18' = H12 AND L'10/18/18' = L12 AND C'10/18/18' = C12 AND V'10/18/18' = V12, H11, IIF(O'10/18/18' = O13 AND H'10/18/18' = H13 AND L'10/18/18' = L13 AND C'10/18/18' = C13 AND V'10/18/18' = V13, H12, 1 / 0)))))))))))))

Understood but the formula is not doing that. I suspect that the IFF function is not working correctly. If you look at the results it does not return the value it should.

IIF( (236.81 = 236.81 AND 237.98 = 237.98 AND 234.71 = 234.71 AND 235.54 = 235.54 AND 49400.00 = 49400.00) ,(236.71) ,IIF( (236.81 = 239.55 AND 237.98 = 239.65 AND 234.71 = 238.10 AND 235.54 = 238.95 AND 49400.00 = 157500.00) ,(237.98) ,IIF(....

I should have gotten 237.98 returned but I didn't, i got -1 (which is what I replaced 1/0 with at the end of the nested IIF statements. the if clause was true so the true condition of the IIF should have returned 237.98 but it instead fired the false condition and continued with the other nested IIF's

And another oddity. I created a simple static IIF

IIF ((20>10), (3),(4) )

This returns 4 and I also had to surround all of the values with () in order for syntax checker to clear it.

Are you using TC2000 v12.5 instead of TC2000 v18? If so, please try the following for the high.

ABS(O'10/18/18' = O AND H'10/18/18' = H AND L'10/18/18' = L AND C'10/18/18' = C AND V'10/18/18' = V) * (H) - NOT(O'10/18/18' = O AND H'10/18/18' = H AND L'10/18/18' = L AND C'10/18/18' = C AND V'10/18/18' = V) * (ABS(O'10/18/18' = O1 AND H'10/18/18' = H1 AND L'10/18/18' = L1 AND C'10/18/18' = C1 AND V'10/18/18' = V1) * (H1) - NOT(O'10/18/18' = O1 AND H'10/18/18' = H1 AND L'10/18/18' = L1 AND C'10/18/18' = C1 AND V'10/18/18' = V1) * (ABS(O'10/18/18' = O2 AND H'10/18/18' = H2 AND L'10/18/18' = L2 AND C'10/18/18' = C2 AND V'10/18/18' = V2) * (H2) - NOT(O'10/18/18' = O2 AND H'10/18/18' = H2 AND L'10/18/18' = L2 AND C'10/18/18' = C2 AND V'10/18/18' = V2) * (ABS(O'10/18/18' = O3 AND H'10/18/18' = H3 AND L'10/18/18' = L3 AND C'10/18/18' = C3 AND V'10/18/18' = V3) * (H3) - NOT(O'10/18/18' = O3 AND H'10/18/18' = H3 AND L'10/18/18' = L3 AND C'10/18/18' = C3 AND V'10/18/18' = V3) * (ABS(O'10/18/18' = O4 AND H'10/18/18' = H4 AND L'10/18/18' = L4 AND C'10/18/18' = C4 AND V'10/18/18' = V4) * (H4) - NOT(O'10/18/18' = O4 AND H'10/18/18' = H4 AND L'10/18/18' = L4 AND C'10/18/18' = C4 AND V'10/18/18' = V4) * (ABS(O'10/18/18' = O5 AND H'10/18/18' = H5 AND L'10/18/18' = L5 AND C'10/18/18' = C5 AND V'10/18/18' = V5) * (H5) - NOT(O'10/18/18' = O5 AND H'10/18/18' = H5 AND L'10/18/18' = L5 AND C'10/18/18' = C5 AND V'10/18/18' = V5) * (ABS(O'10/18/18' = O6 AND H'10/18/18' = H6 AND L'10/18/18' = L6 AND C'10/18/18' = C6 AND V'10/18/18' = V6) * (H6) - NOT(O'10/18/18' = O6 AND H'10/18/18' = H6 AND L'10/18/18' = L6 AND C'10/18/18' = C6 AND V'10/18/18' = V6) * (ABS(O'10/18/18' = O7 AND H'10/18/18' = H7 AND L'10/18/18' = L7 AND C'10/18/18' = C7 AND V'10/18/18' = V7) * (H7) - NOT(O'10/18/18' = O7 AND H'10/18/18' = H7 AND L'10/18/18' = L7 AND C'10/18/18' = C7 AND V'10/18/18' = V7) * (ABS(O'10/18/18' = O8 AND H'10/18/18' = H8 AND L'10/18/18' = L8 AND C'10/18/18' = C8 AND V'10/18/18' = V8) * (H8) - NOT(O'10/18/18' = O8 AND H'10/18/18' = H8 AND L'10/18/18' = L8 AND C'10/18/18' = C8 AND V'10/18/18' = V8) * (ABS(O'10/18/18' = O9 AND H'10/18/18' = H9 AND L'10/18/18' = L9 AND C'10/18/18' = C9 AND V'10/18/18' = V9) * (H9) - NOT(O'10/18/18' = O9 AND H'10/18/18' = H9 AND L'10/18/18' = L9 AND C'10/18/18' = C9 AND V'10/18/18' = V9) * (ABS(O'10/18/18' = O10 AND H'10/18/18' = H10 AND L'10/18/18' = L10 AND C'10/18/18' = C10 AND V'10/18/18' = V10) * (H10) - NOT(O'10/18/18' = O10 AND H'10/18/18' = H10 AND L'10/18/18' = L10 AND C'10/18/18' = C10 AND V'10/18/18' = V10) * (ABS(O'10/18/18' = O11 AND H'10/18/18' = H11 AND L'10/18/18' = L11 AND C'10/18/18' = C11 AND V'10/18/18' = V11) * (H11) - NOT(O'10/18/18' = O11 AND H'10/18/18' = H11 AND L'10/18/18' = L11 AND C'10/18/18' = C11 AND V'10/18/18' = V11) * (ABS(O'10/18/18' = O12 AND H'10/18/18' = H12 AND L'10/18/18' = L12 AND C'10/18/18' = C12 AND V'10/18/18' = V12) * (H12) - NOT(O'10/18/18' = O12 AND H'10/18/18' = H12 AND L'10/18/18' = L12 AND C'10/18/18' = C12 AND V'10/18/18' = V12) * (-1)))))))))))))

And the following to check for the current price being above the high.

C > ABS(O'10/18/18' = O AND H'10/18/18' = H AND L'10/18/18' = L AND C'10/18/18' = C AND V'10/18/18' = V) * (H) - NOT(O'10/18/18' = O AND H'10/18/18' = H AND L'10/18/18' = L AND C'10/18/18' = C AND V'10/18/18' = V) * (ABS(O'10/18/18' = O1 AND H'10/18/18' = H1 AND L'10/18/18' = L1 AND C'10/18/18' = C1 AND V'10/18/18' = V1) * (H1) - NOT(O'10/18/18' = O1 AND H'10/18/18' = H1 AND L'10/18/18' = L1 AND C'10/18/18' = C1 AND V'10/18/18' = V1) * (ABS(O'10/18/18' = O2 AND H'10/18/18' = H2 AND L'10/18/18' = L2 AND C'10/18/18' = C2 AND V'10/18/18' = V2) * (H2) - NOT(O'10/18/18' = O2 AND H'10/18/18' = H2 AND L'10/18/18' = L2 AND C'10/18/18' = C2 AND V'10/18/18' = V2) * (ABS(O'10/18/18' = O3 AND H'10/18/18' = H3 AND L'10/18/18' = L3 AND C'10/18/18' = C3 AND V'10/18/18' = V3) * (H3) - NOT(O'10/18/18' = O3 AND H'10/18/18' = H3 AND L'10/18/18' = L3 AND C'10/18/18' = C3 AND V'10/18/18' = V3) * (ABS(O'10/18/18' = O4 AND H'10/18/18' = H4 AND L'10/18/18' = L4 AND C'10/18/18' = C4 AND V'10/18/18' = V4) * (H4) - NOT(O'10/18/18' = O4 AND H'10/18/18' = H4 AND L'10/18/18' = L4 AND C'10/18/18' = C4 AND V'10/18/18' = V4) * (ABS(O'10/18/18' = O5 AND H'10/18/18' = H5 AND L'10/18/18' = L5 AND C'10/18/18' = C5 AND V'10/18/18' = V5) * (H5) - NOT(O'10/18/18' = O5 AND H'10/18/18' = H5 AND L'10/18/18' = L5 AND C'10/18/18' = C5 AND V'10/18/18' = V5) * (ABS(O'10/18/18' = O6 AND H'10/18/18' = H6 AND L'10/18/18' = L6 AND C'10/18/18' = C6 AND V'10/18/18' = V6) * (H6) - NOT(O'10/18/18' = O6 AND H'10/18/18' = H6 AND L'10/18/18' = L6 AND C'10/18/18' = C6 AND V'10/18/18' = V6) * (ABS(O'10/18/18' = O7 AND H'10/18/18' = H7 AND L'10/18/18' = L7 AND C'10/18/18' = C7 AND V'10/18/18' = V7) * (H7) - NOT(O'10/18/18' = O7 AND H'10/18/18' = H7 AND L'10/18/18' = L7 AND C'10/18/18' = C7 AND V'10/18/18' = V7) * (ABS(O'10/18/18' = O8 AND H'10/18/18' = H8 AND L'10/18/18' = L8 AND C'10/18/18' = C8 AND V'10/18/18' = V8) * (H8) - NOT(O'10/18/18' = O8 AND H'10/18/18' = H8 AND L'10/18/18' = L8 AND C'10/18/18' = C8 AND V'10/18/18' = V8) * (ABS(O'10/18/18' = O9 AND H'10/18/18' = H9 AND L'10/18/18' = L9 AND C'10/18/18' = C9 AND V'10/18/18' = V9) * (H9) - NOT(O'10/18/18' = O9 AND H'10/18/18' = H9 AND L'10/18/18' = L9 AND C'10/18/18' = C9 AND V'10/18/18' = V9) * (ABS(O'10/18/18' = O10 AND H'10/18/18' = H10 AND L'10/18/18' = L10 AND C'10/18/18' = C10 AND V'10/18/18' = V10) * (H10) - NOT(O'10/18/18' = O10 AND H'10/18/18' = H10 AND L'10/18/18' = L10 AND C'10/18/18' = C10 AND V'10/18/18' = V10) * (ABS(O'10/18/18' = O11 AND H'10/18/18' = H11 AND L'10/18/18' = L11 AND C'10/18/18' = C11 AND V'10/18/18' = V11) * (H11) - NOT(O'10/18/18' = O11 AND H'10/18/18' = H11 AND L'10/18/18' = L11 AND C'10/18/18' = C11 AND V'10/18/18' = V11) * (ABS(O'10/18/18' = O12 AND H'10/18/18' = H12 AND L'10/18/18' = L12 AND C'10/18/18' = C12 AND V'10/18/18' = V12) * (H12) - NOT(O'10/18/18' = O12 AND H'10/18/18' = H12 AND L'10/18/18' = L12 AND C'10/18/18' = C12 AND V'10/18/18' = V12) * (C + 1)))))))))))))

The IIF() function isn't valid in TC2000 v12.5. It was introduced in TC2000 v17.

TC2000 v12.5 also seems to be using the opening bar of the current trading day instead of the closing bar of the previous trading day when I am using a date in an intraday formula.

Hi Bruce - I really like this solution for 1st 30 min high low - I was wondering if its possible to get the :4:30 am - 9:30am high low as a range - as i have premarket data on chart - also can the line be extended to end of the day

Don

It thinking this through, it might be possible for Forex (although we don't carry volume for Forex so having a unique bar in the visible range of the chart might be more problematic), but not for stocks. The issue is that we would need to know the number of bars before and after our test bar to get the high and low of that range. The number of pre / post market bars is not fixed for stocks.

ok thats true for stocks = what about the last premarket bar from 9:00 to 9:30 the high and low of that bar as 2 horizontal lines

What gets identified in TC2000 v18+ when using the current date is the last bar of the previous trading day. If you don't know how many pre-market bars there are, it isn't possible to know what the value of the last pre-market bar might be because you don't know how many bars it happened after the last bar of the previous trading day.

the stocks i watch all have 10 30 minute bars from 4:30 to 9:30 - so is that possible ?

The following should work for the high between 4:30 AM and 9:30 AM (assuming this is 10 bars like you said).

IIF(O'02/15/19' = O1 AND H'02/15/19' = H1 AND L'02/15/19' = L1 AND C'02/15/19' = C1 AND V'02/15/19' = V1, H, IIF(O'02/15/19' = O2 AND H'02/15/19' = H2 AND L'02/15/19' = L2 AND C'02/15/19' = C2 AND V'02/15/19' = V2, MAXH2, IIF(O'02/15/19' = O3 AND H'02/15/19' = H3 AND L'02/15/19' = L3 AND C'02/15/19' = C3 AND V'02/15/19' = V3, MAXH3, IIF(O'02/15/19' = O4 AND H'02/15/19' = H4 AND L'02/15/19' = L4 AND C'02/15/19' = C4 AND V'02/15/19' = V4, MAXH4, IIF(O'02/15/19' = O5 AND H'02/15/19' = H5 AND L'02/15/19' = L5 AND C'02/15/19' = C5 AND V'02/15/19' = V5, MAXH5, IIF(O'02/15/19' = O6 AND H'02/15/19' = H6 AND L'02/15/19' = L6 AND C'02/15/19' = C6 AND V'02/15/19' = V6, MAXH6, IIF(O'02/15/19' = O7 AND H'02/15/19' = H7 AND L'02/15/19' = L7 AND C'02/15/19' = C7 AND V'02/15/19' = V7, MAXH7, IIF(O'02/15/19' = O8 AND H'02/15/19' = H8 AND L'02/15/19' = L8 AND C'02/15/19' = C8 AND V'02/15/19' = V8, MAXH8, IIF(O'02/15/19' = O9 AND H'02/15/19' = H9 AND L'02/15/19' = L9 AND C'02/15/19' = C9 AND V'02/15/19' = V9, MAXH9, IIF(O'02/15/19' = O10 AND H'02/15/19' = H10 AND L'02/15/19' = L10 AND C'02/15/19' = C10 AND V'02/15/19' = V10, MAXH10, IIF(O'02/15/19' = O11 AND H'02/15/19' = H11 AND L'02/15/19' = L11 AND C'02/15/19' = C11 AND V'02/15/19' = V11, MAXH10.1, IIF(O'02/15/19' = O12 AND H'02/15/19' = H12 AND L'02/15/19' = L12 AND C'02/15/19' = C12 AND V'02/15/19' = V12, MAXH10.2, IIF(O'02/15/19' = O13 AND H'02/15/19' = H13 AND L'02/15/19' = L13 AND C'02/15/19' = C13 AND V'02/15/19' = V13, MAXH10.3, IIF(O'02/15/19' = O14 AND H'02/15/19' = H14 AND L'02/15/19' = L14 AND C'02/15/19' = C14 AND V'02/15/19' = V14, MAXH10.4, IIF(O'02/15/19' = O15 AND H'02/15/19' = H15 AND L'02/15/19' = L15 AND C'02/15/19' = C15 AND V'02/15/19' = V15, MAXH10.5, IIF(O'02/15/19' = O16 AND H'02/15/19' = H16 AND L'02/15/19' = L16 AND C'02/15/19' = C16 AND V'02/15/19' = V16, MAXH10.6, IIF(O'02/15/19' = O17 AND H'02/15/19' = H17 AND L'02/15/19' = L17 AND C'02/15/19' = C17 AND V'02/15/19' = V17, MAXH10.7, IIF(O'02/15/19' = O18 AND H'02/15/19' = H18 AND L'02/15/19' = L18 AND C'02/15/19' = C18 AND V'02/15/19' = V18, MAXH10.8, IIF(O'02/15/19' = O19 AND H'02/15/19' = H19 AND L'02/15/19' = L19 AND C'02/15/19' = C19 AND V'02/15/19' = V19, MAXH10.9, IIF(O'02/15/19' = O20 AND H'02/15/19' = H20 AND L'02/15/19' = L20 AND C'02/15/19' = C20 AND V'02/15/19' = V20, MAXH10.10, IIF(O'02/15/19' = O21 AND H'02/15/19' = H21 AND L'02/15/19' = L21 AND C'02/15/19' = C21 AND V'02/15/19' = V21, MAXH10.11, IIF(O'02/15/19' = O22 AND H'02/15/19' = H22 AND L'02/15/19' = L22 AND C'02/15/19' = C22 AND V'02/15/19' = V22, MAXH10.12, IIF(O'02/15/19' = O23 AND H'02/15/19' = H23 AND L'02/15/19' = L23 AND C'02/15/19' = C23 AND V'02/15/19' = V23, MAXH10.13, 1 / 0)))))))))))))))))))))))

And the following should work for the low between 4:30 AM and 9:30 AM (using the same assumptions).

IIF(O'02/15/19' = O1 AND H'02/15/19' = H1 AND L'02/15/19' = L1 AND C'02/15/19' = C1 AND V'02/15/19' = V1, L, IIF(O'02/15/19' = O2 AND H'02/15/19' = H2 AND L'02/15/19' = L2 AND C'02/15/19' = C2 AND V'02/15/19' = V2, MINL2, IIF(O'02/15/19' = O3 AND H'02/15/19' = H3 AND L'02/15/19' = L3 AND C'02/15/19' = C3 AND V'02/15/19' = V3, MINL3, IIF(O'02/15/19' = O4 AND H'02/15/19' = H4 AND L'02/15/19' = L4 AND C'02/15/19' = C4 AND V'02/15/19' = V4, MINL4, IIF(O'02/15/19' = O5 AND H'02/15/19' = H5 AND L'02/15/19' = L5 AND C'02/15/19' = C5 AND V'02/15/19' = V5, MINL5, IIF(O'02/15/19' = O6 AND H'02/15/19' = H6 AND L'02/15/19' = L6 AND C'02/15/19' = C6 AND V'02/15/19' = V6, MINL6, IIF(O'02/15/19' = O7 AND H'02/15/19' = H7 AND L'02/15/19' = L7 AND C'02/15/19' = C7 AND V'02/15/19' = V7, MINL7, IIF(O'02/15/19' = O8 AND H'02/15/19' = H8 AND L'02/15/19' = L8 AND C'02/15/19' = C8 AND V'02/15/19' = V8, MINL8, IIF(O'02/15/19' = O9 AND H'02/15/19' = H9 AND L'02/15/19' = L9 AND C'02/15/19' = C9 AND V'02/15/19' = V9, MINL9, IIF(O'02/15/19' = O10 AND H'02/15/19' = H10 AND L'02/15/19' = L10 AND C'02/15/19' = C10 AND V'02/15/19' = V10, MINL10, IIF(O'02/15/19' = O11 AND H'02/15/19' = H11 AND L'02/15/19' = L11 AND C'02/15/19' = C11 AND V'02/15/19' = V11, MINL10.1, IIF(O'02/15/19' = O12 AND H'02/15/19' = H12 AND L'02/15/19' = L12 AND C'02/15/19' = C12 AND V'02/15/19' = V12, MINL10.2, IIF(O'02/15/19' = O13 AND H'02/15/19' = H13 AND L'02/15/19' = L13 AND C'02/15/19' = C13 AND V'02/15/19' = V13, MINL10.3, IIF(O'02/15/19' = O14 AND H'02/15/19' = H14 AND L'02/15/19' = L14 AND C'02/15/19' = C14 AND V'02/15/19' = V14, MINL10.4, IIF(O'02/15/19' = O15 AND H'02/15/19' = H15 AND L'02/15/19' = L15 AND C'02/15/19' = C15 AND V'02/15/19' = V15, MINL10.5, IIF(O'02/15/19' = O16 AND H'02/15/19' = H16 AND L'02/15/19' = L16 AND C'02/15/19' = C16 AND V'02/15/19' = V16, MINL10.6, IIF(O'02/15/19' = O17 AND H'02/15/19' = H17 AND L'02/15/19' = L17 AND C'02/15/19' = C17 AND V'02/15/19' = V17, MINL10.7, IIF(O'02/15/19' = O18 AND H'02/15/19' = H18 AND L'02/15/19' = L18 AND C'02/15/19' = C18 AND V'02/15/19' = V18, MINL10.8, IIF(O'02/15/19' = O19 AND H'02/15/19' = H19 AND L'02/15/19' = L19 AND C'02/15/19' = C19 AND V'02/15/19' = V19, MINL10.9, IIF(O'02/15/19' = O20 AND H'02/15/19' = H20 AND L'02/15/19' = L20 AND C'02/15/19' = C20 AND V'02/15/19' = V20, MINL10.10, IIF(O'02/15/19' = O21 AND H'02/15/19' = H21 AND L'02/15/19' = L21 AND C'02/15/19' = C21 AND V'02/15/19' = V21, MINL10.11, IIF(O'02/15/19' = O22 AND H'02/15/19' = H22 AND L'02/15/19' = L22 AND C'02/15/19' = C22 AND V'02/15/19' = V22, MINL10.12, IIF(O'02/15/19' = O23 AND H'02/15/19' = H23 AND L'02/15/19' = L23 AND C'02/15/19' = C23 AND V'02/15/19' = V23, MINL10.13, 1 / 0)))))))))))))))))))))))

This assumes pre / post market data is on, a 30 minute time frame, there are 10 exactly bars in this time span, and these are the only pre / post market bars after midnight ET. You will need to update the dates used in the formula for it to continue working.

thx Bruce - the high but that got me the high of the 8:30-9:00 bar - and the low was from the 8:00 - 8:30 bar

OK, what stocks are you looking at that have 10 pre-market bars ?

Are you interested in the high and low of the entire pre market span (my assumption is this is what you wanted and that there are 10 pre market bars)?

Or are you just interested in the last 30-minute pre market bar?

i look at spy aapl nflx and some other l top stocks - and it is just the last bar in pre market 9:930 i have been doing it manually drawing the line but thought it could be done by a pcf

I am counting eleven 30 minute pre-market bars for those symbols including the bars ending at 4:30 AM ET and 9:30 AM ET. If this is correct and you are only interested in the 11th pre market bar, then please try the following for the high.

IIF(O'02/15/19' = O1 AND H'02/15/19' = H1 AND L'02/15/19' = L1 AND C'02/15/19' = C1 AND V'02/15/19' = V1, 1 / 0, IIF(O'02/15/19' = O2 AND H'02/15/19' = H2 AND L'02/15/19' = L2 AND C'02/15/19' = C2 AND V'02/15/19' = V2, 1 / 0, IIF(O'02/15/19' = O3 AND H'02/15/19' = H3 AND L'02/15/19' = L3 AND C'02/15/19' = C3 AND V'02/15/19' = V3, 1 / 0, IIF(O'02/15/19' = O4 AND H'02/15/19' = H4 AND L'02/15/19' = L4 AND C'02/15/19' = C4 AND V'02/15/19' = V4, 1 / 0, IIF(O'02/15/19' = O5 AND H'02/15/19' = H5 AND L'02/15/19' = L5 AND C'02/15/19' = C5 AND V'02/15/19' = V5, 1 / 0, IIF(O'02/15/19' = O6 AND H'02/15/19' = H6 AND L'02/15/19' = L6 AND C'02/15/19' = C6 AND V'02/15/19' = V6, 1 / 0, IIF(O'02/15/19' = O7 AND H'02/15/19' = H7 AND L'02/15/19' = L7 AND C'02/15/19' = C7 AND V'02/15/19' = V7, 1 / 0, IIF(O'02/15/19' = O8 AND H'02/15/19' = H8 AND L'02/15/19' = L8 AND C'02/15/19' = C8 AND V'02/15/19' = V8, 1 / 0, IIF(O'02/15/19' = O9 AND H'02/15/19' = H9 AND L'02/15/19' = L9 AND C'02/15/19' = C9 AND V'02/15/19' = V9, 1 / 0, IIF(O'02/15/19' = O10 AND H'02/15/19' = H10 AND L'02/15/19' = L10 AND C'02/15/19' = C10 AND V'02/15/19' = V10, 1 / 0, IIF(O'02/15/19' = O11 AND H'02/15/19' = H11 AND L'02/15/19' = L11 AND C'02/15/19' = C11 AND V'02/15/19' = V11, H, IIF(O'02/15/19' = O12 AND H'02/15/19' = H12 AND L'02/15/19' = L12 AND C'02/15/19' = C12 AND V'02/15/19' = V12, H1, IIF(O'02/15/19' = O13 AND H'02/15/19' = H13 AND L'02/15/19' = L13 AND C'02/15/19' = C13 AND V'02/15/19' = V13, H2, IIF(O'02/15/19' = O14 AND H'02/15/19' = H14 AND L'02/15/19' = L14 AND C'02/15/19' = C14 AND V'02/15/19' = V14, H3, IIF(O'02/15/19' = O15 AND H'02/15/19' = H15 AND L'02/15/19' = L15 AND C'02/15/19' = C15 AND V'02/15/19' = V15, H4, IIF(O'02/15/19' = O16 AND H'02/15/19' = H16 AND L'02/15/19' = L16 AND C'02/15/19' = C16 AND V'02/15/19' = V16, H5, IIF(O'02/15/19' = O17 AND H'02/15/19' = H17 AND L'02/15/19' = L17 AND C'02/15/19' = C17 AND V'02/15/19' = V17, H6, IIF(O'02/15/19' = O18 AND H'02/15/19' = H18 AND L'02/15/19' = L18 AND C'02/15/19' = C18 AND V'02/15/19' = V18, H7, IIF(O'02/15/19' = O19 AND H'02/15/19' = H19 AND L'02/15/19' = L19 AND C'02/15/19' = C19 AND V'02/15/19' = V19, H8, IIF(O'02/15/19' = O20 AND H'02/15/19' = H20 AND L'02/15/19' = L20 AND C'02/15/19' = C20 AND V'02/15/19' = V20, H9, IIF(O'02/15/19' = O21 AND H'02/15/19' = H21 AND L'02/15/19' = L21 AND C'02/15/19' = C21 AND V'02/15/19' = V21, H10, IIF(O'02/15/19' = O22 AND H'02/15/19' = H22 AND L'02/15/19' = L22 AND C'02/15/19' = C22 AND V'02/15/19' = V22, H11, IIF(O'02/15/19' = O23 AND H'02/15/19' = H23 AND L'02/15/19' = L23 AND C'02/15/19' = C23 AND V'02/15/19' = V23, H12, IIF(O'02/15/19' = O24 AND H'02/15/19' = H24 AND L'02/15/19' = L24 AND C'02/15/19' = C24 AND V'02/15/19' = V24, H13, IIF(O'02/15/19' = O25 AND H'02/15/19' = H25 AND L'02/15/19' = L25 AND C'02/15/19' = C25 AND V'02/15/19' = V25, H14, IIF(O'02/15/19' = O26 AND H'02/15/19' = H26 AND L'02/15/19' = L26 AND C'02/15/19' = C26 AND V'02/15/19' = V26, H15, IIF(O'02/15/19' = O27 AND H'02/15/19' = H27 AND L'02/15/19' = L27 AND C'02/15/19' = C27 AND V'02/15/19' = V27, H16, IIF(O'02/15/19' = O28 AND H'02/15/19' = H28 AND L'02/15/19' = L28 AND C'02/15/19' = C28 AND V'02/15/19' = V28, H17, IIF(O'02/15/19' = O29 AND H'02/15/19' = H29 AND L'02/15/19' = L29 AND C'02/15/19' = C29 AND V'02/15/19' = V29, H18, IIF(O'02/15/19' = O30 AND H'02/15/19' = H30 AND L'02/15/19' = L30 AND C'02/15/19' = C30 AND V'02/15/19' = V30, H19, IIF(O'02/15/19' = O31 AND H'02/15/19' = H31 AND L'02/15/19' = L31 AND C'02/15/19' = C31 AND V'02/15/19' = V31, H20, 1 / 0)))))))))))))))))))))))))))))))

And the following for the low.

IIF(O'02/15/19' = O1 AND H'02/15/19' = H1 AND L'02/15/19' = L1 AND C'02/15/19' = C1 AND V'02/15/19' = V1, 1 / 0, IIF(O'02/15/19' = O2 AND H'02/15/19' = H2 AND L'02/15/19' = L2 AND C'02/15/19' = C2 AND V'02/15/19' = V2, 1 / 0, IIF(O'02/15/19' = O3 AND H'02/15/19' = H3 AND L'02/15/19' = L3 AND C'02/15/19' = C3 AND V'02/15/19' = V3, 1 / 0, IIF(O'02/15/19' = O4 AND H'02/15/19' = H4 AND L'02/15/19' = L4 AND C'02/15/19' = C4 AND V'02/15/19' = V4, 1 / 0, IIF(O'02/15/19' = O5 AND H'02/15/19' = H5 AND L'02/15/19' = L5 AND C'02/15/19' = C5 AND V'02/15/19' = V5, 1 / 0, IIF(O'02/15/19' = O6 AND H'02/15/19' = H6 AND L'02/15/19' = L6 AND C'02/15/19' = C6 AND V'02/15/19' = V6, 1 / 0, IIF(O'02/15/19' = O7 AND H'02/15/19' = H7 AND L'02/15/19' = L7 AND C'02/15/19' = C7 AND V'02/15/19' = V7, 1 / 0, IIF(O'02/15/19' = O8 AND H'02/15/19' = H8 AND L'02/15/19' = L8 AND C'02/15/19' = C8 AND V'02/15/19' = V8, 1 / 0, IIF(O'02/15/19' = O9 AND H'02/15/19' = H9 AND L'02/15/19' = L9 AND C'02/15/19' = C9 AND V'02/15/19' = V9, 1 / 0, IIF(O'02/15/19' = O10 AND H'02/15/19' = H10 AND L'02/15/19' = L10 AND C'02/15/19' = C10 AND V'02/15/19' = V10, 1 / 0, IIF(O'02/15/19' = O11 AND H'02/15/19' = H11 AND L'02/15/19' = L11 AND C'02/15/19' = C11 AND V'02/15/19' = V11, L, IIF(O'02/15/19' = O12 AND H'02/15/19' = H12 AND L'02/15/19' = L12 AND C'02/15/19' = C12 AND V'02/15/19' = V12, L1, IIF(O'02/15/19' = O13 AND H'02/15/19' = H13 AND L'02/15/19' = L13 AND C'02/15/19' = C13 AND V'02/15/19' = V13, L2, IIF(O'02/15/19' = O14 AND H'02/15/19' = H14 AND L'02/15/19' = L14 AND C'02/15/19' = C14 AND V'02/15/19' = V14, L3, IIF(O'02/15/19' = O15 AND H'02/15/19' = H15 AND L'02/15/19' = L15 AND C'02/15/19' = C15 AND V'02/15/19' = V15, L4, IIF(O'02/15/19' = O16 AND H'02/15/19' = H16 AND L'02/15/19' = L16 AND C'02/15/19' = C16 AND V'02/15/19' = V16, L5, IIF(O'02/15/19' = O17 AND H'02/15/19' = H17 AND L'02/15/19' = L17 AND C'02/15/19' = C17 AND V'02/15/19' = V17, L6, IIF(O'02/15/19' = O18 AND H'02/15/19' = H18 AND L'02/15/19' = L18 AND C'02/15/19' = C18 AND V'02/15/19' = V18, L7, IIF(O'02/15/19' = O19 AND H'02/15/19' = H19 AND L'02/15/19' = L19 AND C'02/15/19' = C19 AND V'02/15/19' = V19, L8, IIF(O'02/15/19' = O20 AND H'02/15/19' = H20 AND L'02/15/19' = L20 AND C'02/15/19' = C20 AND V'02/15/19' = V20, L9, IIF(O'02/15/19' = O21 AND H'02/15/19' = H21 AND L'02/15/19' = L21 AND C'02/15/19' = C21 AND V'02/15/19' = V21, L10, IIF(O'02/15/19' = O22 AND H'02/15/19' = H22 AND L'02/15/19' = L22 AND C'02/15/19' = C22 AND V'02/15/19' = V22, L11, IIF(O'02/15/19' = O23 AND H'02/15/19' = H23 AND L'02/15/19' = L23 AND C'02/15/19' = C23 AND V'02/15/19' = V23, L12, IIF(O'02/15/19' = O24 AND H'02/15/19' = H24 AND L'02/15/19' = L24 AND C'02/15/19' = C24 AND V'02/15/19' = V24, L13, IIF(O'02/15/19' = O25 AND H'02/15/19' = H25 AND L'02/15/19' = L25 AND C'02/15/19' = C25 AND V'02/15/19' = V25, L14, IIF(O'02/15/19' = O26 AND H'02/15/19' = H26 AND L'02/15/19' = L26 AND C'02/15/19' = C26 AND V'02/15/19' = V26, L15, IIF(O'02/15/19' = O27 AND H'02/15/19' = H27 AND L'02/15/19' = L27 AND C'02/15/19' = C27 AND V'02/15/19' = V27, L16, IIF(O'02/15/19' = O28 AND H'02/15/19' = H28 AND L'02/15/19' = L28 AND C'02/15/19' = C28 AND V'02/15/19' = V28, L17, IIF(O'02/15/19' = O29 AND H'02/15/19' = H29 AND L'02/15/19' = L29 AND C'02/15/19' = C29 AND V'02/15/19' = V29, L18, IIF(O'02/15/19' = O30 AND H'02/15/19' = H30 AND L'02/15/19' = L30 AND C'02/15/19' = C30 AND V'02/15/19' = V30, L19, IIF(O'02/15/19' = O31 AND H'02/15/19' = H31 AND L'02/15/19' = L31 AND C'02/15/19' = C31 AND V'02/15/19' = V31, L20, 1 / 0)))))))))))))))))))))))))))))))

that did it Bruce thank you very much - you are amazing at these pdfs

You're welcome.