September 18, 2019

Summary

  • We take a closer look at Eric Hoyle’s momentum strategy and begin to convert to EasyLanguage
  • We take a quick look at a investment portfolio model using Sharp ratio to optimize allocation

Starting point for EasyLanguage conversion. (Note: if you don’t write code or you don’t have TradeStation, this is just a bonus and not required to benefit from our looking into this strategy)

{Incomplete 9/18/2019}
Inputs:
ATRlookback(30),
FastMA(20),
SlowMA(50);
Vars:
ATR(0),
fast(0),
slow(0),
size(0);
ATR = avgtruerange(atrlookback);
fast = average(c,fastma);
slow = average(c,slowma);
size = 2000/atr;
{entry}
If (c > o and c > ((H-L) * .7 + L) or C > H[1])
And fast > fast[1]
And fast[1] > fast[2]
And (slow > slow[1] or slow - slow[3] > (ATR * -.12))
And c < fast + (ATR * 2.5) And C < slow + (ATR * 3.5) And (C > fast or c > slow)
And fast < (slow + (ATR *2.5))
Then buy this bar close;
If marketposition = 1 then begin
sell next bar entryprice + (ATR * 2) limit;
Sell next bar entryprice - (ATR * 3) stop;
end;
Collapse