Creating new DateSeries involving Math.Min
Author: sedelstein
Creation Date: 12/22/2011 7:04 PM
profile picture

sedelstein

#1
I would like to create a new DataSeries equal to the minimum of the two values, the low of the series minus a 14 day ATR or the low of a series minus a 100 day atr

I've created two series

DataSeries atr14 = ATR.Series(Bars, short_atr_pd);
DataSeries atr100 = ATR.Series(Bars, long_atr_pd);

I want to create a new series, call it LB for lower bound

DataSeries LB = new DataSeries(Bars, "Lower Bound");

the following doesn't work

LB = Math.Min (Bars.Low - 0.5 * atr14, Bars.Low - atr100);

Do I have to do it in a loop or is there another solution?

Thanks
profile picture

Eugene

#2
You have to do it in a loop.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).