Announcement

Collapse
No announcement yet.

Todays open plus a certain number

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

  • Todays open plus a certain number

    hello

    i would like to create an efs that takes the Today's Open and be able to add and subtract a certain number of my choosing to that today's open and have those 2 numbers displayed on the chart as lines

    can you help me with that?

    thx,
    j

  • #2
    j, this is quite simple, I've just slightly modified the preinstalled Today's Open study:

    PHP Code:

    //Developed by EMET
    //Today's open and number of my choosing to that today's open

    /*
    I would like to create an efs that takes the Today's Open and be able
    to add and subtract a certain number of my choosing to that today's
    open and have those 2 numbers displayed on the chart as lines
    */

    var fpArray = new Array();

    function 
    preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Today's Open (TO)");
        
    setCursorLabelName("TO");

        
    setDefaultBarStyle(PS_DASH);
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarFgColor(Color.red1);    
        
    setDefaultBarFgColor(Color.red2);        
        
    setDefaultBarThickness(20);
        
    setDefaultBarThickness(21);
        
    setDefaultBarThickness(22);
        
        
    setPlotType(PLOTTYPE_FLATLINES0);
        
    setPlotType(PLOTTYPE_FLATLINES1);
        
    setPlotType(PLOTTYPE_FLATLINES2);    
        
    //Other param
        
    askForInput();

        var 
    x=0;
        
    fpArray[x] = new FunctionParameter("Displace"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setLowerLimit(0);        
            
    setDefault(0.5);
        }
        
    }

    var 
    bInit false;
    var 
    xOpen  null;

    function 
    main(Displace) {
        
        if(
    isMonthly() || isWeekly() || isDaily())
        return;
        
        if(
    bInit == false){
            
    xOpen  open(inv("D"));
            
    bInit true;
        }
        
        var 
    vOpen  getSeries(xOpen);
        var 
    vOpenInc  vOpen Displace;
        var 
    vOpenDec  vOpen Displace;
        
        return new Array (
    vOpenvOpenIncvOpenDec);

    Comment


    • #3
      Originally posted by emet
      j, this is quite simple, I've just slightly modified the preinstalled Today's Open study:

      PHP Code:

      //Developed by EMET
      //Today's open and number of my choosing to that today's open

      /*
      I would like to create an efs that takes the Today's Open and be able
      to add and subtract a certain number of my choosing to that today's
      open and have those 2 numbers displayed on the chart as lines
      */

      var fpArray = new Array();

      function 
      preMain() {
          
      setPriceStudy(true);
          
      setStudyTitle("Today's Open (TO)");
          
      setCursorLabelName("TO");

          
      setDefaultBarStyle(PS_DASH);
          
      setDefaultBarFgColor(Color.blue0);
          
      setDefaultBarFgColor(Color.red1);    
          
      setDefaultBarFgColor(Color.red2);        
          
      setDefaultBarThickness(20);
          
      setDefaultBarThickness(21);
          
      setDefaultBarThickness(22);
          
          
      setPlotType(PLOTTYPE_FLATLINES0);
          
      setPlotType(PLOTTYPE_FLATLINES1);
          
      setPlotType(PLOTTYPE_FLATLINES2);    
          
      //Other param
          
      askForInput();

          var 
      x=0;
          
      fpArray[x] = new FunctionParameter("Displace"FunctionParameter.NUMBER);
          
      with(fpArray[x++]){
              
      setLowerLimit(0);        
              
      setDefault(0.5);
          }
          
      }

      var 
      bInit false;
      var 
      xOpen  null;

      function 
      main(Displace) {
          
          if(
      isMonthly() || isWeekly() || isDaily())
          return;
          
          if(
      bInit == false){
              
      xOpen  open(inv("D"));
              
      bInit true;
          }
          
          var 
      vOpen  getSeries(xOpen);
          var 
      vOpenInc  vOpen Displace;
          var 
      vOpenDec  vOpen Displace;
          
          return new Array (
      vOpenvOpenIncvOpenDec);



      thank you very much, appreciated

      Comment

      Working...
      X