Announcement

Collapse
No announcement yet.

Easy Language Conversion

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Easy Language Conversion

    I have written the following two codes in easy language but I am having difficulties writing the same code in EFS.


    This first one just drawa a high and low line on chart

    Inputs: NoBars(13);

    Value1 = Highest ( High, NoBars);
    If Value1 = value1[1] and Value1[1] = Value1[2] and Value1[2] = Value1[3] then plot1(Value1,"Recent High") ;

    Value2= Lowest(Low,NoBars) ;
    If Value2=Value2[1] and Value2[1] = Value2[2] and Value2[2] = Value2[3] then plot2(Value2,Recent Low") ;


    The Second one just colour codes bars to what I have defined as a rangy market

    Inputs: RangeLength(15), RangeSize(30);

    Condition1 = Highest(High,Rangelength) - Lowest(Low,Rangelength) < RangeSize Points ;

    Value1= High;
    Value2 = Low;

    If Condition1 then
    Plotpaintbar(Value1,Value2,"Rangy", Magenta) ;

  • #2
    Jamie
    For both you can use the new EFS2 functions highest(length,series) and lowest(length,series) as shown in the examples below
    Alex

    PHP Code:
    var NoBars 13;

    var 
    Value1 highest (NoBars,high());
    If 
    Value1.getValue(0) == Value1.getValue(-1) && Value1.getValue(-1) == Value1.getValue(-2) && etc etc 

    PHP Code:
    var Length 15;
    var 
    Points 30;

    var 
    Condition = (highest(Length,high())-lowest(Length,low()))<Points;

    if(
    Condition)
    //insert comand to execute here 

    Comment


    • #3
      Jamie
      If you want you can also replace highest() and lowest() with upperDonchian() and lowerDonchian().
      For the syntax required by these functions see this artcile in the EFS KnowledgeBase
      Alex

      Comment


      • #4
        New to This

        This is basic for one part of EFS statement but does not work, I am new to EFS writing but familiar with ELL.

        Thanks in Advance for help


        Jamie
        Attached Files

        Comment


        • #5
          Jamie
          In the PHP box enclosed below is how you would need to write it.
          At this point I would suggest reading through the Help Guides availabale in the EFS KnowledgeBase and in particular the Guide to Developing EFS Indicators and All About JavaScript - The foundation of EFS which is in the Introduction to EFS section
          Alex

          PHP Code:
          function preMain() {
              
          setPriceStudy(true);
              
          setStudyTitle("High & Lows Stops");
          }

          function 
          main() {
          var 
          NoBars 13 ;
          var 
          Value1 highest NoBars,high());

              if (
          Value1.getValue(0) == Value1.getValue(-1) && 
                  
          Value1.getValue(-1)== Value1.getValue(-2) &&
                  
          Value1.getValue(-2)== Value1.getValue(-3))
                      var 
          Plot1 Value1;
                  
              return 
          Plot1;

          Comment

          Working...
          X