Announcement

Collapse
No announcement yet.

Volume % formula for watch list

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

  • Volume % formula for watch list

    Hi,
    I am new with esignal so I have not enough knowledge to create EFS formula.

    I am now looking for formula for my watch list.

    It is formula that calculate actual "volume %".

    It is Volume% = Current volume / Average volume
    and shown in %.


    Can somebody write this formula and publish it here ?
    Thank you.
    Richard

  • #2
    I've been looking for something like this. Can you please post it if you figure it out?

    Comment


    • #3
      This could be a starting point, as an example.
      Sorry, I usually don't use eSignal vers.11 so I don't know if it works in watch list.
      Massimo

      //
      // Caution. Use at your own risk !!!
      // Created with eSignal vers.10.6
      //
      function preMain() {
      setPriceStudy(false);
      var fp1 = new FunctionParameter("xPer", FunctionParameter.NUMBER);
      fp1.setName("Periods of Volume Average ?");
      fp1.setLowerLimit(2);
      fp1.setDefault(14); // here you can change default value

      }
      var vTag=0;
      var bInit=false;
      var vPer=null;
      var vAveVol=null;
      var xAveVol=null;
      var vPercent=null;

      function main(xPer) {
      if (bInit==false) {
      vPer=xPer;
      if (vPer==null) vPer=2;
      xAveVol=sma(vPer, volume()); // or ema(vPer, volume(0));
      addBand(100, PS_SOLID, 1, Color.RGB(0,0,0), vTag++); // here you can add bands
      bInit=true;
      }
      //if (getBarState()==BARSTATE_NEWBAR) { // if you want to compute once per bar
      vAveVol=xAveVol.getValue(0); // here you can change getValue()
      vPercent=100*(volume(0)/vAveVol);
      //}

      return (vPercent);

      }

      Comment

      Working...
      X