I have an efs script that plots some indicators in a study. These indicators are calculated off of things like the TRIN and the VIX. I'm accomplishing this with code like this:
trin = close(0,1,"$TRIN");
vix = close(0,1,"$VIX");
The problem I'm having is these don't appear to be returning the values of those other symbols at the proper relative time in the chart. What I mean is, If I look at my indicator (or print out the values from within my script with debug statements) it looks shows the trin/vix with one value. But, if I pull up an actual chart and align it with the chart my study is applied to (same day/time) I can see that the values of the TRIN and VIX are actually quite different than what those calls are returning.
Am I mis-understanding how accessing secondary symbols from within EFS should work? I'm assuming if my main() function is being executed against a 3m bar at 10:27 on 10/01/2003 for say "ES" then the above calls will give me the values of TRIN and VIX at 10:27 (or at least 10:29:59) on 10/01/2003. But this is definitely NOT what I'm getting according to the charts of those actual symbols.
P.S. - I did spend some time searching to see if this had been covered as I'm new out here but I could not find any discussion on this topic. If its here and I just didn't find it, please point me in the right direction. Thx.
trin = close(0,1,"$TRIN");
vix = close(0,1,"$VIX");
The problem I'm having is these don't appear to be returning the values of those other symbols at the proper relative time in the chart. What I mean is, If I look at my indicator (or print out the values from within my script with debug statements) it looks shows the trin/vix with one value. But, if I pull up an actual chart and align it with the chart my study is applied to (same day/time) I can see that the values of the TRIN and VIX are actually quite different than what those calls are returning.
Am I mis-understanding how accessing secondary symbols from within EFS should work? I'm assuming if my main() function is being executed against a 3m bar at 10:27 on 10/01/2003 for say "ES" then the above calls will give me the values of TRIN and VIX at 10:27 (or at least 10:29:59) on 10/01/2003. But this is definitely NOT what I'm getting according to the charts of those actual symbols.
P.S. - I did spend some time searching to see if this had been covered as I'm new out here but I could not find any discussion on this topic. If its here and I just didn't find it, please point me in the right direction. Thx.
Comment