r"""Calculate the *True High* value. Parameters ---------- f : pandas.DataFrame Dataframe with columns ``high`` and ``low``. Returns ------- new_column : pandas.Series (float) The array containing the new feature. References ---------- *Today's
(f)
| 1432 | # |
| 1433 | |
| 1434 | def truehigh(f): |
| 1435 | r"""Calculate the *True High* value. |
| 1436 | |
| 1437 | Parameters |
| 1438 | ---------- |
| 1439 | f : pandas.DataFrame |
| 1440 | Dataframe with columns ``high`` and ``low``. |
| 1441 | |
| 1442 | Returns |
| 1443 | ------- |
| 1444 | new_column : pandas.Series (float) |
| 1445 | The array containing the new feature. |
| 1446 | |
| 1447 | References |
| 1448 | ---------- |
| 1449 | *Today's high, or the previous close, whichever is higher* [TS_TR]_. |
| 1450 | |
| 1451 | .. [TS_TR] http://help.tradestation.com/09_01/tradestationhelp/charting_definitions/true_range.htm |
| 1452 | |
| 1453 | """ |
| 1454 | c1 = 'low[1]' |
| 1455 | vexec(f, c1) |
| 1456 | c2 = 'high' |
| 1457 | new_column = f.apply(c2max, axis=1, args=[c1, c2]) |
| 1458 | return new_column |
| 1459 | |
| 1460 | |
| 1461 | # |