The resource loading... loading...

exchange.SetMaxBarLen

Set the maximum length of the K-line.

exchange.SetMaxBarLen(n)

The parameter n is used to specify the maximum K-line length. n true number

function main() {
    exchange.SetMaxBarLen(50)
    var records = exchange.GetRecords()
    Log(records.length, records)
}
def main():
    exchange.SetMaxBarLen(50)
    r = exchange.GetRecords()
    Log(len(r), r)
void main() {
    exchange.SetMaxBarLen(50);
    auto r = exchange.GetRecords();
    Log(r.size(), r[0]);
}

The exchange.SetMaxBarLen() function affects two aspects for cryptocurrency strategy runtime:

  • Affects the number of K-line bars (Bars) that are obtained on the first call.
  • Affects the maximum number of K-line bars (Bars).

{@fun/Market/exchange.GetRecords exchange.GetRecords}

exchange.GetPeriod exchange.GetRawJSON