TA.Highest
The TA.Highest() function is used to calculate the highest price within a period.
TA.Highest(inReal)
TA.Highest(inReal, period, attr)Examples
javascript
function main() {
var records = exchange.GetRecords()
var highestForOpen = TA.Highest(records, 10, "Open")
Log(highestForOpen)
}
python
def main():
records = exchange.GetRecords()
highestForOpen = TA.Highest(records, 10, "Open")
Log(highestForOpen)
rust
fn main() {
let records = exchange.GetRecords(None, None, None).unwrap();
// Rust's TA.Highest has no attribute name parameter; first extract the opening price numeric sequence, then calculate (not including the current Bar)
let opens: Vec<f64> = records.iter().map(|r| r.Open).collect();
let highestForOpen = TA.Highest(&opens, 10);
Log!(highestForOpen);
}
c++
void main() {
auto records = exchange.GetRecords();
auto highestForOpen = TA.Highest(records.Open(), 10);
Log(highestForOpen);
}Returns
| Type | Description |
number | The |
Arguments
| Name | Type | Required | Description |
inReal |
| Yes | The |
period | number | No | The |
attr | string | No | The |
See Also
Remarks
For example, when calling the TA.Highest(records, 30, "High") function, if the period parameter period is set to 0, it means calculating all Bar in the K-line data passed in by the inReal parameter; if the attribute parameter attr is not specified, the data passed in by the inReal parameter is treated as an ordinary array.