Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to track profit when long

Hello MVPs

I need help getting started. I'd like to have a macro
that would enable a spreadsheet to automatically
calculate profits for long positions.

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. In A1(day1) IF A3(low) < A5(pivot) AND A4 A5, THEN
A6 = A4 - A5 AND A7 = LONG. IF A4 < A5 then A7 = NOT LONG

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 = NOT LONG, THEN 1. for day2

3. IF B7 = LONG, THEN iIF C4 C5, THEN C6 = C4-B5 AND B6
= 0 AND C7 = LONG. IF C4 < C5 then C6 = C4-B5 AND B6 = 0
AND C7 = CLOSE LONG. IF B7 = NOT LONG, THEN 1 for day3

...this repeats until last non blank column

Thanks in advance for your help and feedback!
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
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo Max Loger Excel Discussion (Misc queries) 0 June 14th 11 04:30 PM
writing a formula in Excel spreadsheet to track how long data has flyboy719 Excel Worksheet Functions 2 January 20th 10 09:59 AM
Long Long Long Nested If Function sed Excel Discussion (Misc queries) 4 December 9th 09 06:44 PM
I need a macro to track the number of students enrolled per month islandgrl1984 Excel Discussion (Misc queries) 1 September 19th 08 02:57 AM
HELP - Too long coding for Macro Eric Excel Worksheet Functions 12 February 22nd 08 02:55 PM


All times are GMT +1. The time now is 01:37 PM.

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"