PINE LIBRARY
MTFData

Library "MTFData"
Functions to store multi timeframe candle data and swing points.
getCandleData(timeframe, openArray, highArray, lowArray, closeArray, timeArray, olcLookback, alltfs_olcLookback, tfIndex)
Stores current or higher timeframe candle data in arrays.
Parameters:
timeframe (string): The timeframe, for example "240" for 4h
openArray (array<float>): An array to store the candle open price
highArray (array<float>): An array to store the candle high price
lowArray (array<float>): An array to store the candle low price
closeArray (array<float>): An array to store the candle close price
timeArray (array<int>): An array to store the candle time
olcLookback (int): The history reference of the lookback limiting candle
alltfs_olcLookback (array<int>): An array holding the candle time of olcLookback candles ago, which can be used for limiting lookbacks
tfIndex (int): The timeframe's index in the alltfs_olcLookback array
Returns: true if the timeframe changed
trackHiLo(tfchange, timeframe, openArray, highArray, lowArray, closeArray, timeArray, highWickArray, highBodyArray, highTimeArray, lowWickArray, lowBodyArray, lowTimeArray, alltfs_olcLookback, tfIndex)
Stores current or higher timeframe swingpoint data into arrays.
Parameters:
tfchange (bool): Must be true when the timeframe has changed (a new candle has opened)
timeframe (string): The timeframe, for example "240" for 4h
openArray (array<float>): An array that stores the timeframe's candle open price
highArray (array<float>): An array that stores the timeframe's candle high price
lowArray (array<float>): An array that stores the timeframe's candle low price
closeArray (array<float>): An array that stores the timeframe's candle close price
timeArray (array<int>): An array that stores the timeframe's candle time
highWickArray (array<float>): An array to store the swing high price
highBodyArray (array<float>): An array to store the swing high's highest body price
highTimeArray (array<int>): An array to store the swing high candle's time
lowWickArray (array<float>): An array to store the swing low price
lowBodyArray (array<float>): An array to store the swing low's lowest body price
lowTimeArray (array<int>): An array to store the swing high candle's time
alltfs_olcLookback (array<int>): An array holding the time of the max allowed swing point age
tfIndex (int): The timeframe's index in the alltfs_olcLookback array
Returns: Nothing. The array handling happens inside the function.
tfReadable(tfInSec)
Converts a timeframe string ("240") into a more readable string ("4h").
Parameters:
tfInSec (int): The timeframe that should be converted, as timeframe.in_seconds()
Returns: A more readable timeframe string
Functions to store multi timeframe candle data and swing points.
getCandleData(timeframe, openArray, highArray, lowArray, closeArray, timeArray, olcLookback, alltfs_olcLookback, tfIndex)
Stores current or higher timeframe candle data in arrays.
Parameters:
timeframe (string): The timeframe, for example "240" for 4h
openArray (array<float>): An array to store the candle open price
highArray (array<float>): An array to store the candle high price
lowArray (array<float>): An array to store the candle low price
closeArray (array<float>): An array to store the candle close price
timeArray (array<int>): An array to store the candle time
olcLookback (int): The history reference of the lookback limiting candle
alltfs_olcLookback (array<int>): An array holding the candle time of olcLookback candles ago, which can be used for limiting lookbacks
tfIndex (int): The timeframe's index in the alltfs_olcLookback array
Returns: true if the timeframe changed
trackHiLo(tfchange, timeframe, openArray, highArray, lowArray, closeArray, timeArray, highWickArray, highBodyArray, highTimeArray, lowWickArray, lowBodyArray, lowTimeArray, alltfs_olcLookback, tfIndex)
Stores current or higher timeframe swingpoint data into arrays.
Parameters:
tfchange (bool): Must be true when the timeframe has changed (a new candle has opened)
timeframe (string): The timeframe, for example "240" for 4h
openArray (array<float>): An array that stores the timeframe's candle open price
highArray (array<float>): An array that stores the timeframe's candle high price
lowArray (array<float>): An array that stores the timeframe's candle low price
closeArray (array<float>): An array that stores the timeframe's candle close price
timeArray (array<int>): An array that stores the timeframe's candle time
highWickArray (array<float>): An array to store the swing high price
highBodyArray (array<float>): An array to store the swing high's highest body price
highTimeArray (array<int>): An array to store the swing high candle's time
lowWickArray (array<float>): An array to store the swing low price
lowBodyArray (array<float>): An array to store the swing low's lowest body price
lowTimeArray (array<int>): An array to store the swing high candle's time
alltfs_olcLookback (array<int>): An array holding the time of the max allowed swing point age
tfIndex (int): The timeframe's index in the alltfs_olcLookback array
Returns: Nothing. The array handling happens inside the function.
tfReadable(tfInSec)
Converts a timeframe string ("240") into a more readable string ("4h").
Parameters:
tfInSec (int): The timeframe that should be converted, as timeframe.in_seconds()
Returns: A more readable timeframe string
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.