Announcement

Collapse
No announcement yet.

Can anyone Help

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

  • Can anyone Help

    I am trying to make simple Indicator based on Elders Force Index, the indicator works fine until I try to add an exponential moving average to it.

    I am sur there is a simple error
    Attached Files

  • #2
    Can someone also help me to get a Centre Line based @ 0


    Cheers


    and thanks in advance




    Jamie

    Comment


    • #3
      Jamie
      The built-in studies require a series as a source. This series can be either a price series, another built-in study or a custom series. To create a custom series you need to use either the efsInternal() or the efsExternal() functions which retrieve the result of a calculation performed in a separate function or external efs and convert it to a series.
      For the description of the these functions and the required syntax see the links above which will take you to the corresponding articles in the EFS KnowledgeBase. Further information together with some examples can be found in this thread.
      In the case of your efs you need to first create a separate function within that same script and call it (for example) myCalc. In that function you process the equation

      PHP Code:
      myVar volume(0) * ( close(0) - close(-1)); 
      You then use myVar as the return for that function.
      Once you have done that you create the series in the main function using efsInternal() and then use that series as the source for the ema study.

      PHP Code:
      var mySeries efsInternal("myCalc");//this calls the separate function and creates the series
      var myAverage ema(10mySeries); //built-in study uses the custom series as source 
      You could also write it as follows if you do not need the custom series as a separate variable.

      PHP Code:
      var myAverage ema(10efsInternal("myCalc")); 
      In either case you would use myAverage as the return..
      As an example see the Chaikin oscillator study in this thread which has a very similar contruct to the one I just described here.
      Alex

      Comment


      • #4
        Jamie
        To add the centerline at 0 use the addBand() function
        Alex

        Comment


        • #5
          Thanks very much for your help

          Comment

          Working...
          X