1) Comparing the 2 approachs below, which one is more draining more resources?
A) To Create a Series
var myStudy1 = null;
var bInit = false;
function main() {
var myVar1;
if ( bInit == false ) {
myStudy1 = ema( 20 );
bInit = true;
}
//retrieve the current values
myVar1 = myStudy1.getValue(0);
return myVar1;
}
B) To Retrieve a Single Value
function main() {
...
...
myVar = sma( 10 );
//do something with the value in myVar
}
What I want is to calculate the EMAs of 10min, 30min and 60min, daily, and weekly in an EFS. And I will open all of these charts with the EFS loaded in each one of them. It takes quite a long time to load and I wonder if there is anyway to speed it up.
2) Also, if I hv already loaded the EFS in one timeframe, will it be using the same amt or less amt of resources to load the same EFS in another timeframe. I hv already "hardwired" the interval using inv() in it and so all charts are just making sure same set of data.
thx
A) To Create a Series
var myStudy1 = null;
var bInit = false;
function main() {
var myVar1;
if ( bInit == false ) {
myStudy1 = ema( 20 );
bInit = true;
}
//retrieve the current values
myVar1 = myStudy1.getValue(0);
return myVar1;
}
B) To Retrieve a Single Value
function main() {
...
...
myVar = sma( 10 );
//do something with the value in myVar
}
What I want is to calculate the EMAs of 10min, 30min and 60min, daily, and weekly in an EFS. And I will open all of these charts with the EFS loaded in each one of them. It takes quite a long time to load and I wonder if there is anyway to speed it up.
2) Also, if I hv already loaded the EFS in one timeframe, will it be using the same amt or less amt of resources to load the same EFS in another timeframe. I hv already "hardwired" the interval using inv() in it and so all charts are just making sure same set of data.
thx
Comment