Announcement

Collapse
No announcement yet.

User defined TIME INTERVAL in an EFS Formula?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • User defined TIME INTERVAL in an EFS Formula?

    Hi,
    Does anyone know what efs coding to use to create the option of defining the TIME interval that an efs formula will use?

    EG : - the attached study is a "close price" line of a specific user defined symbol - but i'd like to adapt it so that it could display a 5min / or 15min etc close price line - instead of the efs adopting the time interval that the advanced chart it is applied on is using, as it usually does.

    Many thanks,
    Paul
    Attached Files

  • #2
    Paul
    I think that in your formula var vValue would be defined as
    close(0,-1,"ES #F,5");
    Here below is the efs running on a 1 min chart and beneath that the corresponding 5 min chart as a comparison.
    Alex

    Comment


    • #3
      Hi Alex,
      Thanks, thats very close to what i'm after. The study you've just posted is slightly different to what i was thinking of - in terms of the horizontal x-axis time scale - your study has compressed around 4 days of data under the 1min chart. I never thought it could do that, and this scaling provides the benefit of being able to see the support-resistance levels of the last 4 days on the 5min chart.

      When i first thought of this, i had in mind the study having the same x-axis time scale as the 1min adv chart it was applied to -simply for ease of comparison. Can this be done?

      Also, i'd be grateful if you could post the altered studies - makes it far easier to work out the changes you've made!

      Thanks again,
      Paul

      Comment


      • #4
        Paul
        Aligning different time frames is one of the more complex things to do with the current efs language and you may want to see the work Jason has done in this thread.
        You could use his study and set one of the MAs to Length 1 to achieve what you want.
        Irrespective here is the formula that returned the 5 min plot in my prior message. To change interval you just go to Edit Studies and type symbol,interval.
        Alex

        PHP Code:
        function preMain() {
            
        setPriceStudy(false);
            
        setStudyTitle("ES #F");
            
        setCursorLabelName("ES #F");
        }
        function 
        main(nSymbol){

            if(
        nSymbol==null)nSymbol="ES #F,5";
            
            var 
        vValue=close(0,-1,nSymbol);

            return 
        vValue;

        Comment


        • #5
          Thanks Alex.

          Comment

          Working...
          X