[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bull - Bear calculations



PureBytes Links

Trading Reference Links

Hi Lionel

This answer is from a very good programmer from the Excel List:

Best regards

Walter

====================================

"You can't control how VBA records regarding R1C1 or A1, just relative or
absolute. R1C1 is the nature of the beast for formulas. Understanding is the
clue, and it's fairly easy.
R1C1 ALWAYS means cell A1. It's Row1, column 1.
R[1]C[1] means 1 row to the right & 1 column down from the active cell.
R3C[-1] means Row 3, 1 column to the left. In A1 notation (from cell D5, for
example), this means cell C3 -- 1 col to the left is C, row 3 is row 3.
RC refers to the active cell.
R refers to the whole row
C refers to the whole column.
"=SUM(RC[-1]-RC[-3])" means same row column to the left minus same row, 3
columns to the left. ..."



----- Original Message -----
From: "Lionel Issen" <lissen@xxxxxxxxx>
To: <metastock@xxxxxxxxxxxxx>
Sent: Thursday, May 18, 2000 1:17 PM
Subject: Re: Bull - Bear calculations


| What is RC code?
| Lionel Issen
| lissen@xxxxxxxxx
| ----- Original Message -----
| From: Walter Lake <wlake@xxxxxxxxx>
| To: Metastock bulletin board <metastock@xxxxxxxxxxxxx>
| Sent: Wednesday, May 17, 2000 9:34 PM
| Subject: Bull - Bear calculations
|
|
| > You can use VBA code if you want. I find it a pain. In-cell code is
faster
| > and once the template is set up you can just paste in other contract
data
| > using VBA and the calculation sheet will automatically update itself
very
| > quickly. That's why I only use the last 240 days of the contract.
| >
| > Unfortunately, VBA only accepts RC code. Here's the Linear regression
and
| > slope code to calculate them in the workbook. This does not produce a
| chart.
| >
| > Range("AJ6:AK6").FormulaArray = _
| >         "=LINEST(R[-2]C[-30]:R[238]C[-30],R[-2]C[-33]:R[238]C[-33])"
| >
| >     Range("AL6").Select
| >     ActiveCell.FormulaR1C1 = _
| >         "=RSQ(R[-2]C[-35]:R[238]C[-35],R[-2]C[-32]:R[238]C[-32])"
| >
| > Best regards
| >
| > Walter
| >
| >
| >
|