Announcement

Collapse
No announcement yet.

Candlestick counter

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

  • Candlestick counter

    is there anyone out there who could help me in translating the Tradestation code below into ELS function. It is the code for thebinary candlestick counter of this russian guy Likhovidov
    I am sure otehr users would be gratefull!!!
    Thnx

  • #2
    and now with the code included

    FUNCTION: CandleCode
    inputs:
    BBlength( numericsimple ), {recommended value 55}
    Deviations( numericsimple ), {recommended value 0.5}
    Variables:
    BodyHi( 0 ),
    BodyLo( 0 ),
    Body( 0 ),
    UpperShadow( 0 ),
    LowerShadow( 0 ),
    ThBot_Body( 0 ),
    ThTop_Body( 0 ),
    ThBot_Ushd( 0 ),
    ThTop_Ushd( 0 ),
    ThBot_Lshd( 0 ),
    ThTop_Lshd( 0 ),
    ColorCode(0),
    BodyCode(0),
    UshdCode(0),
    LshdCode(0);

    BodyHi = MaxList( Open, Close );
    BodyLo = MaxList( Open, Close );
    Body = BodyHi – BodyLo;
    UpperShadow = High – BodyHi;
    LowerShadow = BodyLo – Low;

    ThBot_Body = BollingerBand( Body, Bblength, -Deviations);
    ThTop_Body = BollingerBand( Body, Bblength, Deviations);
    ThBot_Ushd = BollingerBand(UpperShadow, Bblength, -Deviations);
    ThTop_Ushd = BollingerBand(UpperShadow, Bblength, Deviations);
    ThBot_Lshd = BollingerBand(LowerShadow, Bblength, -Deviations);
    ThTop_Lshd = BollingerBand(LowerShadow, Bblength, Deviations);

    If Close >= Open then
    begin
    ColorCode = 64;
    if Body = 0 then BodyCode = 0
    else if Body < ThBot_Body then
    BodyCode = 16
    else if Body < ThTop_Body then
    BodyCode = 32
    else
    BodyCode = 48;
    end
    else
    begin
    ColorCode = 0;
    if Body = 0 then
    BodyCode = 48
    else if Body < ThBot_Body then
    BodyCode = 32
    else if Body < ThTop_Body then
    BodyCode = 16
    else
    BodyCode = 0;
    end;
    if UpperShadow = 0 then
    UshdCode = 0
    else if UpperShadow < ThBot_Ushd then
    UshdCode = 4
    else if UpperShadow < ThTop_Ushd then
    UshdCode = 8
    else
    UshdCode = 12;
    if LowerShadow = 0 then
    LshdCode = 3
    else if LowerShadow < ThBot_Lshd then
    LshdCode = 2
    else if LowerShadow < ThTop_Lshd then
    LshdCode = 1
    else LshdCode = 0;

    CandleCode = ColorCode + BodyCode + UshdCode + LshdCode;

    Indicator: CandleCode
    inputs:
    BBlength( 55 ),
    Deviations( 0.5 ),
    Avrg(9);
    variables:
    Ccode( 0 );
    Ccode = CandleCode( Bblength, Deviations );
    Plot1(Ccode, “ Ccode” );
    Plot2(Average (Ccode, Avrg ), “ CcodeAvrg” );

    Comment


    • #3
      sinoks
      You may want to check out the code that TS Support posted this morning as I think it contains the same study by Likhovidov.
      You can find the efs here
      Alex

      Comment

      Working...
      X