Announcement

Collapse
No announcement yet.

Need help with multiple ma efs

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

  • Need help with multiple ma efs

    Hello,

    I am writing a peice of code to display multiple price indicators - in this case MA s, I want to be able to enter in a blank value and the code just not display the MA in question - at present I get a message saying Invalid Length ...

    Some help would be appreciated.

    Thanks

    Paul Murray
    Attached Files

  • #2
    Paul
    Try the attached revision of your efs and see if it does what you are asking. Note that I only modified the first moving average as an example. Set its length to 0 and it will not display.
    Alex
    Attached Files

    Comment


    • #3
      Thanks Alex, that works - I will expand the solution to the other MAs.

      Paul.

      Comment


      • #4
        Paul
        While doing that you can simplify the process by combining into one the two conditional statements I added to your script. See the example enclosed below
        Alex

        PHP Code:
        if(Length_1>0){
                if (
        vEma1 == nullvEma1 = new MAStudy(Length_1,0,"Close"MAStudy.EXPONENTIAL);
                var 
        xEma1 vEma1.getValue(MAStudy.MA)
            }else{
                var 
        xEma1 null;
            } 

        Comment


        • #5
          Have implemented the new piece of code in the last post, thanks.

          Paul.

          Comment

          Working...
          X