TimeFrameRequirements
Timeframe requirements is an Attribute in TradersYard X Script.
If you want a script to use data from various timeframes, the class requires the attribute „TimeFrameRequirements". You can specify multiple timeframes here:
1
[TimeFrameRequirements("1 day")]
2
[TimeFrameRequirements("15 minutes", "1 day", "1 week")]
Copied!
The amount of data provided for the other timeframes will always be the same as the number of actual candles loaded into the chart. If there are 500 candles for a 5-minute chart, then 500 candles of another timeframe will also be loaded. In the first example above, 500 daily candles will be loaded. In the second example, 500 15-minute candles, 500 daily candles, and 500 weekly candles will be loaded. The amount of data can become rather large very quickly, thus you should take precautions when using this attribute.
Important:
If a class uses a different indicator that requires one or more secondary timeframes, then the "TimeFrameRequirements" attribute must be set for the class retrieving the data. An example of this can be seen here: GetDayBar.
Copy link