Announcement

Collapse
No announcement yet.

amVWAP starting point

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

  • amVWAP starting point

    Hi,

    I want to change the starting point of amVWAP.
    I want to change it at 17:00 from 0:00.
    How should I do it?
    I contribute a script and an image.
    I am a beginner.

    Thanking you in advance.


    /************************************************** *******
    Alexis C. Montenegro ゥ July 2005
    Use and/or modify this code freely. If you redistribute it
    please include this and/or any other comment blocks and a
    description of any changes you make.
    ************************************************** ********/

    // NOTE:
    // This efs requires amStudies.efsLib in the FunctionLibrary folder.
    // If you do not have this file you can download it at the link below.
    // http://share.esignal.com/groupconten...ies&groupid=10

    var fpArray = new Array();

    function preMain() {

    setPriceStudy(true);
    setStudyTitle("VWAP");
    setCursorLabelName("VWAP",0);
    setDefaultBarFgColor(Color.blue,0);
    setPlotType(PLOTTYPE_SQUAREWAVE,0);
    setDefaultBarThickness(1,0);
    askForInput();

    var x=0;
    fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
    with(fpArray[x++]){
    setDefault();
    }
    fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
    with(fpArray[x++]){
    setDefault();
    }
    fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
    with(fpArray[x++]){
    setName("Show Parameters");
    setDefault(false);
    }
    }

    var amLib = addLibrary("amStudies.efsLib");
    var bInit = false
    var xVWAP = null;

    function main(Symbol,Interval,Params) {

    if(bInit==false){
    with( amLib ) {
    if(Symbol == null) Symbol = getSymbol();
    if(Interval == null) Interval = getInterval();
    var vSymbol = Symbol+","+Interval;
    xVWAP = amVWAP(sym(vSymbol));
    setShowTitleParameters(eval(Params));
    bInit=true;
    }
    }

    return getSeries(xVWAP);
    }
    Attached Files

  • #2
    kounosuke

    I want to change the starting point of amVWAP.
    I want to change it at 17:00 from 0:00.
    How should I do it?
    Currently it is not possible to do that using the amVWAP() function because it relies on the change of date to reset its values. When I have some time I will see if I can add the option to set a user defined start time.
    Alex

    Comment


    • #3
      Originally posted by Alexis C. Montenegro
      kounosuke



      Currently it is not possible to do that using the amVWAP() function because it relies on the change of date to reset its values. When I have some time I will see if I can add the option to set a user defined start time.
      Alex

      Thank you for a reply.

      I did a time zone in London and came to be usable first of all.
      I wait for user defined to come to be made for pleasure.
      Attached Files

      Comment


      • #4
        kounosuke
        I added a new amVWAP2() function to the amStudies library which now allows to define the starting time for the VWAP calculation. See this post for the link to the library. A complete efs that uses the new function is also posted here
        In the following images you can see a comparison of the two VWAP functions with the original one resetting at 0:00 (top chart) and the new one resetting at the user defined time of 17:00 (bottom chart). Both charts were plotted using Japan's time zone on the PC
        Alex



        Comment


        • #5
          I am not successful.

          Alex

          I introduced VWAP2, but am not successful.
          A message appearing in an image is given.
          How can you display it properly?
          Thanking you in advance.
          Attached Files

          Comment


          • #6
            kounosuke
            That error message indicates to me that you did not download the new version of the amStudies.efsLib function library which includes the amVWAP2() function. See this post for the location of the library
            Alex

            Comment


            • #7
              A great success

              Alex

              I got possible to work properly when I did it to be sold with a thing of advice.
              You are a great programmer.
              Thank you very much.

              Comment


              • #8
                kounosuke
                You are most welcome and thank you for the kind words
                Alex

                Comment

                Working...
                X