Trader
Trader

Reputation: 1

How to get full data from different timeframe as array?

var DailyCloseArray = array.new_float()

if barstate.islast

    for i = 0 to bar_index
        DailyCloseArray.push(request.security(syminfo.tickerid, "D", close[i])) 

log.info(str.tostring(array.size(DailyCloseArray)))

// Plot the latest stored daily close
plot(close)

How to get full data from different timeframe as array?

var DailyCloseArray = array.new_float()

if barstate.islast

    for i = 0 to bar_index
        DailyCloseArray.push(request.security(syminfo.tickerid, "D", close[i])) 

Error: Cannot use loop variables or mutable variables from a loop's local scope as expression arguments in request.*() calls.

Upvotes: 0

Views: 42

Answers (0)

Related Questions