Optuma Forums › Optuma Scripting › Is it possible to use a timeframe override on an imported script? › Fixed: apply timeframe override directly to SCRIPT function
- Topics: 13
- Replies: 25
- Posts: 38
With much gratitude to Matthew and the Optuma support team, there is an easy (an in hindsight, obvious) solution to this problem.
Simply apply the timeframe override to the SCRIPT function.
Do this even if the imported script has an explicit timeframe override too.
This needs to be done because by default, imported scripts using the SCRIPT function will be assigned the chart’s default timeframe. An explicit timeframe override must be applied to the SCRIPT function to instruct OPTUMA to use the timeframe override for the imported script, not the default chart timeframe.
Referring back to the case study of the original post:
Script_A has the following formula to calculate the weekly value of the Bollinger Band upper line:
BB(Week(PERIODAMOUNT=1), BARS=9, DEFAULT=UpperLine, CALC=Close, STDDEV=2.000000);
Script_B imports Script_A:
BBWeeklyUpperLine = SCRIPT(Week(PERIODAMOUNT=1), SCRIPTNAME=Script_A);
The explicit timeframe override in the SCRIPT function can be seen in bold text. Now Optuma displays the imported script as expected. In this case, the imported script is a weekly Bollinger Band upper line, plotted on a daily chart.
Again, thanks to Matthew and the Optuma support team for their help.