Harmonic Patterns Indicators....to be corrected

Discussion in 'Strategy Building' started by Shax, Nov 25, 2021.

  1. Shax

    Shax

    Hi,

    I have found in my archive this formula in Easylanguage, which allows to identify different Harmonic Patterns:
    Butterfly, Gartley, Crab, Bat, etc ..., but Tradestation reports some errors that I do not know how to solve;
    if someone can correct the formula,.....I thank you in advance.
     
  2. Shax

    Shax

    In this image you can see the error that Tradestation reports, and the code is green
    because there are several open curly brackets: { that have not been closed and therefore exclude most of the code;

    if someone can correct the formula, I can reciprocate with several Technical Analysis books (pdf and epub).

    [​IMG]
     
  3. ph1l

    ph1l

    Your file is corrupted with extra characters like the ones past the ");" in this line close to the end.
    Code:
    if bestConfirm > 0 then plot56(bestConfirm,"p56");  2 @# F  [0 V, }$ i3 W . y! \; ^  G! @8 E2 o$ oEND;
    
    I found a better looking copy on http://www.0762jr.com/thread-43114-1-1.html, but bad characters are just hidden and show when lines are highlighted or copied and pasted. So I tried to parse the code from the page source with
    Code:
    cat pagesource.htm | fgrep '<li>' | perl -p -e 's/<li>/\n<li>/g;' | grep '^<li>' |
    perl -p -e 'use warnings; use strict;
    s/&nbsp;//g; s/<li>//; s/<.*//; s/ +\r?\n/\r\n/;
    s/&apos;/\047/gi;
    s/&quot;/"/gi;
    s/&nbsp;/ /gi;
    s/&amp;/\&/gi;
    s/&lt;/</gi;
    s/&gt;/>/gi;
    s/&#([0-9]+);/chr($1)/gie;
    s/&#x([0-9a-f]+);/chr(hex($1))/gie;
    s/[^[:ascii:]]//g;' > harmonic_patterns.txt
    
    and put the output in the attached harmonic_patterns.txt
     
    Shax likes this.
  4. Shax

    Shax

    I thank you for inserting another formula of Harmonic Patterns, but unfortunately this one contains errors too;
    the first error is the word: BatSetup() that Tradestation reports as: "Word not recognized by Easylanguage" (see image), and then I think that also the other words:

    BatConfirm ()
    ButterflySetup()
    ButterflyConfirm()
    GartleySetup()
    GartleyConfirm()

    etc..., will be considered as errors.
    If someone could correct the formula,....I thank you in advance.

    [​IMG]
     
  5. ph1l

    ph1l

    It looks like you have already seen another version here, and the only non-whitespace and non-comment differences between the version I posted before and that one are the use of "input:" vs "inputs:"
    Code:
    diff -w harmonic_patterns.txt harmonic_patterns2.txt
    14,15c11
    <     p83 bar low
    < }
    ---
    >       p83 bar low }
    20,42c16
    < { The pattern rules are from
    <     Harmonic Trading Vol 1 & 2, Scott Carney
    < }
    <
    < {
    < Revision History:
    <     2013-01-10: Initial release (MarsallaMarceau)
    < }
    <
    < input: zigfac(2);
    <
    < input: ShoBat(true);
    < input: ShoButterfly(false);
    < input: ShoGartley(false);
    < input: ShoCrab(false);
    < input: ShoDeepCrab(false);
    < input: ShoFiveOh(false);
    < input: ShoABeCD(false{AB=CD});
    < input: ShoBars(true);
    <
    < input: ShoFibLabel(false);
    < input: ShoZigZag(true);
    < input: ShoZZBands(false);
    ---
    > { The pattern rules are from Harmonic Trading Vol 1 & 2, Scott Carney }
    44,45c18,22
    < input: BearishColor(darkred);
    < input: BullishColor(darkgreen);
    ---
    > { Revision History: 2013-01-10: Initial release (MarsallaMarceau) }
    >
    > inputs: zigfac (2), ShoBat (true), ShoButterfly (false), ShoGartley (false), ShoCrab (false), ShoDeepCrab (false),
    >                ShoFiveOh (false), ShoABeCD (false{AB=CD}), ShoBars (true), ShoFibLabel (false), ShoZigZag (true),
    >                ShoZZBands (false), BearishColor (darkred), BullishColor (darkgreen);
    
    But you wrote TradeStation gives the same "Word not recognized by Easylanguage" error pointing to BatSetup for that version. So, the issue could be something unsupported in your TradeStation.
     
  6. Shax

    Shax

    The words contained in the formula:

    BatSetup()
    BatConfirm ()
    ButterflySetup()
    ButterflyConfirm()
    GartleySetup()
    GartleyConfirm()

    are not part of the Easylanguage, in fact using Tradestation's official online help:

    http://help.tradestation.com/09_01/tsdevhelp/subsystems/elword/elword_Left.htm

    and looking for them by clicking on Index, they are not found;
    probably they are Functions created by the author but not inserted in the formula and therefore the formula is not complete. :mad:
     
  7. ph1l

    ph1l

    I think the code is trying to define methods like BatSetup, ButterflyConfirm, etc. From my very limited knowledge of EasyLanguage, I don't see anything that looks like an error with those method definitions. Perhaps user-defined methods like NearestFib, ratio, and oo_iff need to have their definitions in the code before being used? For example, you could try the attached harmonic_patterns3.txt which has NearestFib, ratio, and oo_iff defined before BatSetup.