Calculating 15 minute high and low value for stock trading

hayerpa

New Member
Joined
Oct 24, 2019
Messages
1
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.


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

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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...
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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