Announcement

Collapse
No announcement yet.

code translation into EFS

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

  • code translation into EFS

    Can someone translate the code representing Kaufman's Efficiency ratio below:

    input: Price((H+L)/2), ERLen(21);
    var: effratio(0), netchg(0), totchg(0);

    if CurrentBar = 1 then
    effratio = Price
    else
    begin
    NetChg = Price - Price[ ERLen ] ;
    TotChg = Summation( AbsValue( Price - Price[1] ), ERLen ) ;
    if TotChg > 0 then
    EffRatio = NetChg / TotChg -plot3
    else
    EffRatio = 0 ;
    end;

    plot1(effratio, "ER");
    plot3(average(plot1,erlen),"Avg");
    if plot1>plot3 then setplotcolor(1,green);
    if plot1 plot2(plot3,"");

  • #2
    WilliamV
    The attached efs will replicate the TradeStation code.
    In the image below you can see the returns from both scripts
    Alex

    Attached Files

    Comment


    • #3
      Now I'll add a few bands and test how to incorporate it.

      Alex, you've come through once again. Thank you very much.

      William

      Comment

      Working...
      X