Announcement

Collapse
No announcement yet.

Can EFS do this?

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

  • Can EFS do this?

    Here's what I want to do:

    On a 60 minute chart, for the first bar of the day, write to a file, the high and low of that bar.

    If possible, I'd also like to collect the day's high and low for that day.

    So, a line written to the file would be...

    first 60 min high, first 60 min low, day high, day low

    I"m no coder, but if someone could give me a start that would be awesome. I don't even know if this is possible.

    Thanks for all answers.

  • #2
    here is a darn good satrt...

    var sTime=930;
    var eTime=1000;
    var trendHigh=0;
    var trendLow=0;
    var tag=0;
    var doorbell=0;
    var door = 0;
    var end1=0;

    function preMain(){

    debugClear();

    setPriceStudy(true);
    setStudyTitle("RangeHandL");
    setCursorLabelName("rangeH", 0);
    setCursorLabelName("rangeL", 1);
    setDefaultBarStyle(PS_SOLID, 0);
    setDefaultBarStyle(PS_SOLID, 1);
    setDefaultBarFgColor(Color.green, 0);
    setDefaultBarFgColor(Color.red, 1);
    setDefaultBarThickness(3, 0);
    setDefaultBarThickness(3, 1);
    setPlotType(PLOTTYPE_SQUAREWAVE, 0);
    setPlotType(PLOTTYPE_SQUAREWAVE, 1);

    var fp1 = new FunctionParameter("sTime", FunctionParameter.NUMBER);
    fp1.setName("sTime"); fp1.setLowerLimit(0); fp1.setDefault(930);

    var fp2 = new FunctionParameter("eTime", FunctionParameter.NUMBER);
    fp2.setName("eTime"); fp2.setLowerLimit(0); fp2.setDefault(1000);
    }

    function main(sTime, eTime){

    mktTime=getHour()*100+getMinute()*1;

    if(sTime==null) sTime=930;
    if(eTime==null) eTime=1000;

    if(mktTime*1==sTime*1){
    tag=0;
    trendHigh=open();
    trendLow=open();
    doorbell=0;
    door=0;
    end1 = 0;
    }

    if(mktTime>=sTime && mktTime < eTime){

    if(high()>trendHigh)
    trendHigh=high()

    if(low()<trendLow)
    trendLow=low()

    setBarFgColor(Color.green, 0);
    setBarFgColor(Color.red, 1);
    setBarThickness(1, 0);
    setBarThickness(1, 1);

    }

    return new Array(trendHigh, trendLow);
    }

    Comment


    • #3
      dloomis,

      What can I say except thank you! I am green with envy over those of you who can code like wizards. I'm going to start playing with this for a few days. I hope it's ok if I can ask more later.

      Regards,

      Bob

      Comment


      • #4
        of course it is ok to ask...

        The code is pretty simple, you should be able to get the idea pretty quick

        Comment


        • #5
          BTW, Dave is a wizard... don't believe him if he tells you otherwise

          Comment

          Working...
          X