garryp 39 posts msg #39295 - Ignore garryp |
12/3/2005 12:13:48 PM
Is there any way I can use a set var in 'days ago' (and potentially other) phrases?
set{X,low 10 day low 10 days ago}
works as expected
set{Y,10}
and set{X,low 10 day low Y days ago}
fails.
Is there a way accomplish the second (failed) result, i.e. use of a set var in 'days ago'?
|
manabu 7 posts msg #39323 - Ignore manabu |
12/4/2005 6:26:11 AM
Here is one way that would be the same as
set{Y,15}
set{pastclose, close Y days ago}
Unfortunately it requires several lines and it is not as flexible. But it works.
And maybe it will give you some idea of another way. Best I can do today.
Try this,
/*Select by setting ONE and only one of the daysago values to 1 */
/*All 3 others must be set to 0 */
set{daysago5, 0}
set{daysago10, 0}
set{daysago15, 1}
set{daysago20, 0}
set{close5, close 5 days ago * daysago5}
set{close10, close 10 days ago * daysago10}
set{close15, close 15 days ago * daysago15}
set{close20, close 20 days ago * daysago20}
set{temp1, close5 + close10}
set{temp2, temp1 + close15}
set{temp3, temp2 + close20}
set{pastclose, temp3}
add column pastclose
|