Hi Alexis,
thanks for the reply, this is great. One more question, is it possible to get the current bar of a 5 min chart from a 1 minute chart, instead of doing the aggregation myself.
- I think I found the answer to my own question with this from help..
myVar = open( 0, inv("D") );
is this the correct approach?
Thanks again,
Safwan
thanks for the reply, this is great. One more question, is it possible to get the current bar of a 5 min chart from a 1 minute chart, instead of doing the aggregation myself.
- I think I found the answer to my own question with this from help..
myVar = open( 0, inv("D") );
is this the correct approach?
Thanks again,
Safwan
Originally posted by Alexis C. Montenegro
Safwan
Yes it is possible. To accomplish that you need to pass to the called efs an interval series using the inv() function.
For the called efs to be able to run in the context of the interval that is being passed to it the inv() series must be the last parameter being passed. Note that because you are passing a parameter you also need to pass all the other parameters that the study is expecting
Enclosed below is a revision of the sample script posted earlier in this thread and now set to run the Arps Trender in the context of the 5 minute interval. Besides adding the necessary inv() parameter to the efsExternal() function I have also modified the return statement to return the series rather than the value by using getSeries(). In the charts that follow you can see a comparison of the sample script running on a 1 minute chart and the original Arps Trender script running on a 5 minute chart.
Alex
Safwan
Yes it is possible. To accomplish that you need to pass to the called efs an interval series using the inv() function.
For the called efs to be able to run in the context of the interval that is being passed to it the inv() series must be the last parameter being passed. Note that because you are passing a parameter you also need to pass all the other parameters that the study is expecting
Enclosed below is a revision of the sample script posted earlier in this thread and now set to run the Arps Trender in the context of the 5 minute interval. Besides adding the necessary inv() parameter to the efsExternal() function I have also modified the return statement to return the series rather than the value by using getSeries(). In the charts that follow you can see a comparison of the sample script running on a 1 minute chart and the original Arps Trender script running on a 5 minute chart.
Alex
PHP Code:
function preMain(){
setPriceStudy(true);
setCursorLabelName("Trender");
setPlotType(PLOTTYPE_SQUAREWAVE);
}
var ExtStudy = null;
function main(){
if(ExtStudy==null) ExtStudy = efsExternal("/Advanced/Arps Crown Jewels/Arps Trender.efs", 2, "true",
Color.blue, Color.red, Color.white, "false", "false", "false", inv(5));
//added inv(5) as last parameter of efsExternal() function
return getSeries(ExtStudy);//modified to return the series for synchronization purpose
}
Comment