Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default help needed with VB

Team,

I am working to have a macro calculate profits for long
positions. Below is an example and the criteria needed

1/1/04,1/02/04,1/1/04,1/5/04
112740,112750,113090,113500
111900,111350,112200,112250
112740,112040,113040,113230
111956,112131,112062,112312

row1 DAY, row2 HIGH, row3 LOW, row4 CLOSE, row5 PIVOT,
row6 GAIN, row7 STAT

1.) DAY 1
IF A3(low) < A5(pivot) AND A4 A5,
THEN A6 = A4 - A5 AND A7 = LONG.
IF A3 < A5 and A4 < A5
THEN A6 = A4 - A5 AND A7 = LOSS
IF A3 A5 AND A4 < A5 THEN A7 = NOT LONG

2.) DAY 2
IF A7 = LONG
THEN IF B4 B5,
THEN B6 = B4-A5 AND A6 = 0 (B6 has profit from day1 and
day2) AND B7 = LONG.
IF B4 < B5 THEN B6 = B4-A5 AND A6 = 0 AND B7 = CLOSE
LONG.

IF A7 = LOSS OR NOT LONG
THEN 1.) for DAY 2

this macro run until every column (day) until the last
non bank value in row 1

thanks for any help on this.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default help needed with VB

Hi
What is the square of numbers all about? Are the words underneath it
variable names?? On Day 1, what does A3 (low) mean? Is A3 a cell
reference - if so, what is the "low" bit? If "low" is some variable,
why is it not in your list...

....and so on, and so on...

Paul

"alldreams" wrote in message ...
Team,

I am working to have a macro calculate profits for long
positions. Below is an example and the criteria needed

1/1/04,1/02/04,1/1/04,1/5/04
112740,112750,113090,113500
111900,111350,112200,112250
112740,112040,113040,113230
111956,112131,112062,112312

row1 DAY, row2 HIGH, row3 LOW, row4 CLOSE, row5 PIVOT,
row6 GAIN, row7 STAT

1.) DAY 1
IF A3(low) < A5(pivot) AND A4 A5,
THEN A6 = A4 - A5 AND A7 = LONG.
IF A3 < A5 and A4 < A5
THEN A6 = A4 - A5 AND A7 = LOSS
IF A3 A5 AND A4 < A5 THEN A7 = NOT LONG

2.) DAY 2
IF A7 = LONG
THEN IF B4 B5,
THEN B6 = B4-A5 AND A6 = 0 (B6 has profit from day1 and
day2) AND B7 = LONG.
IF B4 < B5 THEN B6 = B4-A5 AND A6 = 0 AND B7 = CLOSE
LONG.

IF A7 = LOSS OR NOT LONG
THEN 1.) for DAY 2

this macro run until every column (day) until the last
non bank value in row 1

thanks for any help on this.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default help needed with VB

Hi Paul:

The block of numbers are data for 4 days of trading.
row1 is DATE, 2 is HIGH, 3 is LOW, 4 is CLOSE, 5 is
PIVOT, 6 is GAIN and 7 is STATUS.

the words underneath is just the description of each row
just like I did above. therefore, row 1 will always be
DATE, row 2 will be HIGH, etc. the variable is the
column, so DATE 1 is A1, DATE 2 is B, and so on.

Let me know if this answers your questions

Cheers,
Johann

-----Original Message-----
Hi
What is the square of numbers all about? Are the words

underneath it
variable names?? On Day 1, what does A3 (low) mean? Is

A3 a cell
reference - if so, what is the "low" bit? If "low" is

some variable,
why is it not in your list...

....and so on, and so on...

Paul

"alldreams" wrote

in message news:<16b8601c4488d$9423a890
...
Team,

I am working to have a macro calculate profits for

long
positions. Below is an example and the criteria needed

1/1/04,1/02/04,1/1/04,1/5/04
112740,112750,113090,113500
111900,111350,112200,112250
112740,112040,113040,113230
111956,112131,112062,112312

row1 DAY, row2 HIGH, row3 LOW, row4 CLOSE, row5 PIVOT,
row6 GAIN, row7 STAT

1.) DAY 1
IF A3(low) < A5(pivot) AND A4 A5,
THEN A6 = A4 - A5 AND A7 = LONG.
IF A3 < A5 and A4 < A5
THEN A6 = A4 - A5 AND A7 = LOSS
IF A3 A5 AND A4 < A5 THEN A7 = NOT LONG

2.) DAY 2
IF A7 = LONG
THEN IF B4 B5,
THEN B6 = B4-A5 AND A6 = 0 (B6 has profit from day1

and
day2) AND B7 = LONG.
IF B4 < B5 THEN B6 = B4-A5 AND A6 = 0 AND B7 = CLOSE
LONG.

IF A7 = LOSS OR NOT LONG
THEN 1.) for DAY 2

this macro run until every column (day) until the last
non bank value in row 1

thanks for any help on this.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Rows With Non-Needed Data between Needed Data Daren Excel Worksheet Functions 2 September 30th 08 06:47 PM
Help needed please TheGodfather[_2_] Excel Worksheet Functions 1 October 28th 07 06:52 PM
Help needed Monty New Users to Excel 1 July 31st 06 09:40 AM
Help Needed Eric Excel Discussion (Misc queries) 1 June 23rd 06 03:16 AM
If Then help needed RGT New Users to Excel 2 March 18th 05 01:30 AM


All times are GMT +1. The time now is 03:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"