3-Bar System by Larry Williams: from ProRealtime to EasyLanguage

Discussion in 'Strategy Building' started by Shax, Mar 28, 2020.

  1. Shax

    Shax

    Hi,

    I found in my archive the Trading System: 3-Bar System by Larry Williams, but it's for ProRealtime, if someone could turn it into EasyLanguage, so you could test it in the various Markets.

    Thank you in advance.

    Explanation: Total Price is the average value between open, high, low and close: (O+H+L+C)/4

    The author suggests the following values based on the tests carried out:

    mal=Average[17](low)
    mah=Average[17](high)

    trnd=LinearRegressionSlope[12](TotalPrice)

    Code:

    // 3-Bar System long (simple)
    *
    mal=Average[3](low)
    mah=Average[3](high)
    *
    trnd=LinearRegressionSlope[3](TotalPrice)
    *
    c1=(trnd[1]>0)
    c2=(trnd[1]<0)
    *
    IF NOT LongOnMarket AND c1 THEN
    BUY 1 CONTRACTS AT mal[1] limit
    ENDIF
    *
    If LongOnMarket and c2 THEN
    SELL AT mah[1] limit
    ENDIF

    // 3-Bar System short simple
    *
    mal=Average[3](low)
    mah=Average[3](high)
    *
    trnd=LinearRegressionSlope[3](TotalPrice)
    *
    c1=(trnd[1]>0)
    c2=(trnd[1]<0)
    *
    IF NOT ShortOnMarket AND c2 THEN
    Sellshort 1 CONTRACTS AT mah[1] limit
    ENDIF
    *
    If ShortOnMarket and c1 THEN
    EXITSHORT AT mal[1] limit

    ENDIF
     
  2. tommcginnis

    tommcginnis

    :banghead:
    And you're going to put real money on this?
    Without computing it yourself?

    And if (when) it doesn't work perfectly -- right out of the box -- are you going to trash it and declare Larry Williams a fool and a charlatan? ("Yes.")

    If you're not willing to get some computational dirt under your fingernails, then you deserve to fail. Period. :wtf:
     
  3. Shax

    Shax

    I just want to test and verify with Tradestation whether this T.S. is interesting or not, without judging Larry Williams, because many Trading Systems work better in some Markets than others.

    I thank in advance if someone can turn this T.S. into Easylanguage.
     
  4. Daniel.a

    Daniel.a

    I mean, kind of harsh, unless you just want to be rude, no? is this not the path we all has gone trough? or at least most of us when you start the algo trading route, you read, you test, your torture your data, backtest incorrectly and change until it works, then turn on live, then fail.... then you learn from the pain and then you perhaps succeed..... developer or not, we all create our unique path to success. Mine since 10 years back has been to employ developers to finalise my ideas, and use my own process to validate work so i can trust the functionality before production... But, i dont think anyone deserve to fail... its a path that we all have to walk trough, and we all fail in the beginning.
     
    931 and NQurious like this.
  5. This should get you started. It's untested, something to get you stared in your research. Formatting get's hosed when pasting code.

    { Larry Williams Three Bar System - TS Conversion, Untested. }
    Inputs:
    AvgPeriod(17),
    LRSlopePeriod(12);

    Variables:
    TotalPrice(0),
    Trend(0),
    MAL(0),
    MAH(0),
    C1(false),
    C2(false);

    { calcs }
    TotalPrice = (O+H++L+C) / 4;
    MAL = Average(Low, AvgPeriod);
    MAH = Average(High, AvgPeriod);
    Trend = LinearRegSlope(TotalPrice, LRSlopePeriod);
    C1 = Trend[1] > 0;
    C2 = Trend[1] < 0;

    { long entry logic }
    If MarketPosition = 0 and C1 then
    Buy ("LE") next bar at MAL[1] Limit;

    { short entry logic }
    If MarketPosition = 0 and C2 then
    SellShort ("SE") next bar at MAH[1] Limit;

    { exits }
    If MarketPosition = 1 and C2 then
    Sell ("LX") next bar at MAH[1] Limit;

    If MarketPosition = -1 and C1 then
    BuyToCover ("SX") next bar at MAL[1] Limit;
     
    Shax likes this.
  6. tommcginnis

    tommcginnis

    I think your criticism is fair, though not quite right.

    Over the opening months of 2020, I have just read way too many posts begging for ET responses to fix bad trades or to program code or to provide The Perfect Indicator -- all the while evidencing absolutely no homework themselves -- not so much as the most minor google-search, phone-call to broker, *anything*. These people take *zero* responsibility for their trading future -- and so *that's* the background I brought to reading this poster's first post to ET. So is your criticism a fair one? Absolutely: I painted that First Post Irresponsibility onto this poster, without any further evidence.

    But then I followed their url over to Futures.io, and found this "Take my snippet of code and open all doors for me" pattern is a regular practice by this poster. Ugh. o_O

    (It was also an eye-opener, too: I have not taken stock of "trading resources" on the web for maybe 10 years?? [That pre-dates futures.io as "futures.io" I think -- I don't remember the old url...] In any event, it's certainly an eye-opener. It looks like a whole new crop of "experts" are out there, posting up the same old CRAP with a different title on a post-hoc chart. :banghead: Maddening. :mad: Disheartening. :( )

    So, yeah: mind your risk; calculate *intimately*; be responsible. :wtf:
    If you need help? Do ask. :thumbsup::thumbsup::thumbsup:
    But if you haven't done some homework, then a blunt email will be the least of your worries: the market (the real world) does not care at all.

    :cool:

    Mr. Market sez...

    [​IMG]
     
    Last edited: Mar 29, 2020
  7. Futures.io was BigMikes. Started as a blog, then added the forum, and more recently the name change.
     
  8. Daniel.a

    Daniel.a


    Makes sense man, i agree with you... People expecting to be handed the solution without making any effort , those people i dont have much for.... i was just reacting to the deserve to fail part :) ... anyway, enjoy Sunday and the amazing markets we have now .. cheers
     
    tommcginnis likes this.
  9. ph1l

    ph1l

    TradingGuy likes this.
  10. Shax

    Shax

    For TradingGuy: Thanks and...you have a PM.
     
    #10     Apr 3, 2020