# Calculating 15 minute high and low value for stock trading

#### hayerpa

##### New Member
Hello people,

i'm a newbie stock market trader and i trying my hand on algo trading for a while and i thought of doing all the calculation on my excel sheets. now i'm stuck with a problem for past few days and i'm not able to solve it, so i'm need of a help from fellow members of this forum to help me out.
ok so there is strategy called opening range breakout where one has to calculate the high and low of the stock for a determined time frame that can be 5 or 15 minute depending on the user, now my problem is that as i'm getting tick data from my vendor and i like to save the high price and low price of particular stock on that time frame for strategy to work, but i'm not able to do so.

below is the excel sheet data what i'm talking about now the formula i used in cells are as follow:
i'm able to get the high low value of the stock when the time starts but the value keeps changing even when the end time has passed.
also i like to know as you can see the column "B" is where a tick by tick data every second arrives so i need to use conditional format in it whenever it changes, or you can it changes color whenever there is change in data, so how to do that.

start time = when high and low value should to track to start
end time = when the track ends
5_min_high = high value formed between time start time and end time =IF(AND(V2="Yes",W2="Yes"),H2,H2) {formula used}
5_min_low = low value formed between time start time and end time = =IF(AND(V2="Yes",W2="Yes"),I2,I2) {formula used}
high start = IF(S3>=T3,"Yes","No")
High low = =IF(S3<=U3,"Yes","No")

i hope anyone who is reading this understands what i'm asking please let me know the solution as i'm banging my head over this issue since couple of days.

 A B G H I J S T U V W AA AB Trading stocks last_price open high low close Time start time End time High start High low 5_min_ High 5_min_Low WIPRO 250.6 253.9 254.2 249.25 254.35 1:10:55 PM 12:25:00 PM 12:30:00 PM Yes No 254.2 249.25 MFSL 420.7 424.65 424.8 420.4 423.6 1:10:54 PM 12:25:00 PM 12:30:00 PM Yes No 424.8 420.4 RELIANCE 1407.5 1401 1410.1 1386.55 1392.4 1:10:56 PM 12:25:00 PM 12:30:00 PM Yes No 1410.1 1386.55 PCJEWELLER 34.6 35.5 35.8 33.8 35.95 1:10:54 PM 12:25:00 PM 12:30:00 PM Yes No 35.8 33.8 BHEL 51.75 53.8 54.3 51.5 53.85 1:10:56 PM 12:25:00 PM 12:30:00 PM Yes No 54.3 51.5 ALBK 26 26.15 26.45 25.8 26.05 1:10:37 PM 12:25:00 PM 12:30:00 PM Yes No 26.45 25.8 TATACOMM 349.15 361 361.8 348.05 359.25 1:10:46 PM 12:25:00 PM 12:30:00 PM Yes No 361.8 348.05 IOC 142.3 144.65 144.95 141.4 144.5 1:10:56 PM 12:25:00 PM 12:30:00 PM Yes No 144.95 141.4 RPOWER 3.6 3.6 3.6 3.6 3.3 1:10:51 PM 12:25:00 PM 12:30:00 PM Yes No 3.6 3.6 AJANTPHARM 1007.05 1009.9 1014 1003 1006 1:10:02 PM 12:25:00 PM 12:30:00 PM Yes No 1014 1003

<tbody>
</tbody>

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

#### Swayzy

##### Board Regular
With some simple vba you can all the up and down ticks you want in separate sheets.

I cant see you solving this without some saving of data since I assume that your problem is that your vendors data keeps changing (updating). For this VBA is THE king, you can save the current tick and for example check wether it is higer or lower than before and thua check vs your current periods lowest low etc...

Replies
4
Views
341
Replies
1
Views
284
Replies
0
Views
236
Replies
3
Views
167
Replies
0
Views
222

1,127,167
Messages
5,623,130
Members
415,956
Latest member
Footballtend

### 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.

### Which adblocker are you using?

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

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