Announcement

Collapse
No announcement yet.

indicator for enko chart

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

  • indicator for enko chart

    Good morning,
    I have found in the forum an efs of alert for renko chart. Unfortunately the alert is built on
    the change of color of the box and therefore the signal is wrong because in the same bar
    there can be more boxes and the long signal eventually goes off on the closing of the last drawn box.
    I have found instead online this indicator code for metastock that points out the change of tendency in the renko at the end of the bar and therefore it would be usable to plan a correct trading system.
    Who felt like decoding it would be of great help for the community, i think.


    pc:= Input("pc",0,100,1);(here percent.or points)
    K:=CLOSE*pc/100; RenkoLine:=If(***(1)=1,CLOSE, If(PREV>=0, If(CLOSE<PREV-
    2*K,-(PREV-2*K), Floor(Max(C-PREV,0)/K)*K+PREV), If(CLOSE>Abs(PREV)+2*K,-
    PREV+2*K, Floor(Max(Abs(PREV)-C,0)/K)*K+PREV))); RL:=Abs(RenkoLine); RL;
    BW:=If(***(1)=1,0, If(RL>Ref(RL,-1),+1,If(RL<Ref(RL,-1),-1,PREV))); BW;0;

    gigi
    Last edited by wdgigi; 02-15-2008, 03:10 AM.

  • #2
    Here are others codes in wealth lab language and tradestation easylanguage of an renko indicator by Konkop.

    Is someone that can traduce it in efs?

    WLD CODE:

    {#OptVar1 2;1;5;1}
    {#OptVar2 10;1;21;1}
    HideVolume;
    EnableTradeNotes(false,true,true);

    var Bar, Period: integer;
    var Mult, UP_line, DOWN_line, Brick: float;

    var RENKO_UP, RENKO_DN: integer;

    RENKO_UP:=CreateSeries;
    RENKO_DN:=CreateSeries;

    Mult:=#OptVar1;
    Period:=#OptVar2;

    for Bar := 3 to BarCount - 1 do
    begin

    Brick:= Mult*ATR(Bar,Period);

    If Bar < 10 then
    begin
    UP_line:= PriceHigh(Bar);
    DOWN_line:= PriceLow(Bar);
    Brick:= Mult*(PriceHigh(Bar)-PriceLow(Bar));
    @RENKO_UP[Bar]:=UP_line;
    @RENKO_DN[Bar]:=DOWN_line;
    end;

    If Bar > 10 then
    begin
    if ( PriceClose(Bar) > (UP_line + Brick) ) then begin
    UP_line := UP_line + Brick;
    DOWN_line:= UP_line - Brick;
    @RENKO_UP[Bar]:=UP_line;
    @RENKO_DN[Bar]:=DOWN_line;
    end;

    if ( PriceClose(Bar) < (DOWN_line - Brick) ) then begin
    DOWN_line:= DOWN_line - Brick;
    UP_line:= DOWN_line + Brick;
    @RENKO_UP[Bar]:=UP_line;
    @RENKO_DN[Bar]:=DOWN_line;
    end;
    end;

    @RENKO_UP[Bar]:=UP_line;
    @RENKO_DN[Bar]:=DOWN_line;

    end;

    for Bar := 20 to BarCount-1 do
    begin
    if not LastPositionActive then
    { Entry Rules }
    begin

    if @RENKO_UP[Bar] > @RENKO_UP[Bar-1]
    then BuyAtMarket( Bar+1, 'Market' );

    if @RENKO_DN[Bar] < @RENKO_DN[Bar-1]
    then ShortAtMarket( Bar+1, 'Market' );
    end
    else

    { Exit Rules }

    if ( (@RENKO_UP[Bar] < @RENKO_UP[Bar-1]) and PositionLong(LastPosition) )
    then begin SellAtMarket( Bar+1, #All, 'Market' );
    ShortAtMarket( Bar+1, 'Market' );
    end;


    if ( (@RENKO_DN[Bar] > @RENKO_DN[Bar-1]) and PositionShort(LastPosition) )
    then begin CoverAtMarket( Bar+1, #All, 'Market' );
    BuyAtMarket( Bar+1, 'Market' );
    end;

    end;

    // Display Unit
    PlotSeries(RENKO_UP, 0, #Green, #Thick );
    PlotSeries(RENKO_DN, 0, #Red, #Thick );
    var ATRPane: integer = CreatePane(50,false,false);
    PlotSeriesLabel(ATRSeries(10), ATRPane, #Blue, #Thick, 'ATR(10)' );


    TRADESTATION EASYLANGUAGE CODE:

    {Renko-Adaptive indicator (based on ATR)
    Written by konkop 07.03.2002.
    *********************
    Attention: set MaxBarsBack (f.e. =30) in this study according with
    MaxBarsBack value in the Renko_Adaptive strategy
    for correct step-by-step calculations of the buy/sell levels
    *********************}

    Inputs: K(1),
    Smooth(10);

    vars:Brick(0) ,DN(0), UP(0), BricksUp(0), BricksDn(0);

    Value1 = AvgTrueRange(Smooth);

    If BarNumber = 1 Then Begin
    Up = H;
    Dn = L;
    Brick = K*(H - L);
    End;
    If BarNumber > 1 then begin
    If C > UP + Brick Then begin
    BricksUp = IFF(Brick = 0, 0, Floor((C - Up)/Brick)*Brick);
    UP = Up + BricksUp;
    Brick = K*Value1;
    DN = Up - Brick;
    BricksDn = 0;
    End;
    If C < Dn - Brick Then begin
    BricksDn = IFF(Brick = 0, 0, Floor((Dn - C)/Brick)*Brick);
    Dn = Dn - BricksDn;
    Brick = K*Value1;
    Up = Dn + Brick;
    BricksUp = 0;
    End;
    End;

    Plot1(UP, "Up");
    Plot2(DN, "Dn");

    TRADESTATION EASYLANGUAGE SIGNAL:


    {Renko-Adaptive signal (based on ATR)
    Written by konkop 07.03.2002.
    *********************
    Attention: set MaxBarsBack (f.e. =30) in this study according with
    MaxBarsBack value in the Renko_Adaptive indicator
    for correct step-by-step calculations of the buy/sell levels
    *********************}

    Inputs: K(1),
    Smooth(10),
    Short(false);

    vars: Brick(0) ,DN(0), UP(0), BricksUp(0), BricksDn(0);

    Value1 = AvgTrueRange(Smooth);

    If BarNumber = 1 Then Begin
    Up = H;
    Dn = L;
    Brick = K*(H-L);
    End;

    If BarNumber > 1 then begin
    If C > UP + Brick Then begin
    BricksUp = IFF(Brick = 0, 0, Floor((C - Up)/Brick)*Brick);
    UP = Up + BricksUp;
    Brick = K*Value1;
    DN = Up - Brick;
    BricksDn = 0;
    End;
    If C < Dn - Brick Then begin
    BricksDn = IFF(Brick = 0, 0, Floor((Dn - C)/Brick)*Brick);
    Dn = Dn - BricksDn;
    Brick = K*Value1;
    Up = Dn + Brick;
    BricksUp = 0;
    End;
    {Trade Rules with or without short trades}
    If Short = false then begin
    If Up > Up[1] then buy at C;
    If Dn < Dn[1] then exitlong at C;
    End;
    If Short = true then begin
    If Up > Up[1] then buy at C;
    If Dn < Dn[1] then sell at C;
    {If C < Dn[1] then exitlong;
    If C > Up[1] then exitshort;}
    End;
    End;

    Comment

    Working...
    X