|
Re: Lapsa's very own thread
[Re: Lapsa]
#483974
08/21/21 14:58
08/21/21 14:58
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
Ehler's "Dominant Cycle Measured by Zero Crossings of the Band-Pass Filter"Not 100% sure I got it right. Might be, might be not. Looks believable.
var rad(var degrees) { return degrees*PI/180; }
var rcos(var degrees) { return cos(rad(degrees)); }
var rsin(var degrees) { return sin(rad(degrees)); }
var DCBandPass(var* Close, var Period, var Bandwidth)
{
var alpha2;
var* HP = series(0, 3);
var gamma1;
var alpha1;
var beta1;
var* BP = series(0, 3);
var* Peak = series(0, 2);
var* Real = series(0, 3);
var* counter = series(0, 2);
var* DC = series(0, 2);
alpha2 = (
rcos(.25*Bandwidth*360 / Period) +
rsin(.25*Bandwidth*360 / Period) - 1
) / rcos(.25*Bandwidth*360 / Period);
HP[0] = (1 + alpha2 / 2)*(Close[0] - Close[1]) +
(1- alpha2)*HP[1];
beta1 = rcos(360 / Period);
gamma1 = 1 / rcos(360*Bandwidth / Period);
alpha1 = gamma1 - sqrt(gamma1*gamma1 - 1);
BP[0] = .5*(1 - alpha1)*(HP[0] - HP[2]) +
beta1*(1 + alpha1)*BP[1] - alpha1*BP[2];
Peak[0] = .991*Peak[1];
if (abs(BP[0]) > Peak[0]) Peak[0] = abs(BP[0]);
if (Peak[0] != 0) Real[0] = BP[0] / Peak[0];
DC[0] = DC[1];
if (DC[0] < 6) DC[0] = 6;
counter[0] = counter[1] + 1;
if (crossOver(Real, 0) || crossUnder(Real, 0)) {
DC[0] = 2*counter[0];
if (2*counter[0] > 1.25*DC[1]) {
DC[0] = 1.25*DC[1];
}
if (2*counter[0] < .8*DC[1]) {
DC[0] = .8*DC[1];
}
counter[0] = 0;
}
return DC[0];
}
function run()
{
set(PLOTNOW);
BarPeriod = 1;
LookBack = 300;
StartDate = 20210810;
EndDate = 20210816;
vars closes = series(priceClose());
var dc = DCBandPass(closes, 20, .7);
var ht_dc = HTDcPeriod(closes);
var sma = SMA(closes, dc);
var ht_sma = SMA(closes, ht_dc);
plot("BPDC SMA", sma, MAIN, RED);
plot("HTDC SMA", ht_sma, MAIN, BLACK);
plot("BP DC", dc, NEW, RED);
plot("HT DC", ht_dc, END, BLACK);
}
Last edited by Lapsa; 08/21/21 15:03.
|
|
|
Re: Lapsa's very own thread
[Re: Lapsa]
#483982
08/23/21 03:32
08/23/21 03:32
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
I like this one:
#include <profile.c>
var rad(var degrees) { return degrees*PI/180; }
var rcos(var degrees) { return cos(rad(degrees)); }
var rsin(var degrees) { return sin(rad(degrees)); }
var DecyclerOscillator(var* Close, var HPPeriod1, var HPPeriod2)
{
return HighPass2(Close, HPPeriod2) - HighPass2(Close, HPPeriod1);
}
var EvenBetterSinewave(vars Close, var HPLength, SSFLength)
{
var Wave;
var Pwr;
var* HP = series(HighPass1(Close, HPLength), 2);
if (HP[0] == 0) HP[0] = 1;
var* Filt = series(Smooth(HP, SSFLength), 3);
Wave = SMA(Filt, 3);
Pwr = (Filt[0]*Filt[0] + Filt[1]*Filt[1] + Filt[2]*Filt[2]) / 3;
return Wave / sqrt(Pwr);
}
function run()
{
set(PLOTNOW|PARAMETERS|PRELOAD);
BarPeriod = 1;
LookBack = 2000;
StartDate = 20210701;
EndDate = 20210816;
Capital = 2000;
Lots = 1;
LotAmount = 5;
Amount = 0;
MaxLong = 5;
MaxShort = 5;
vars closes = series(priceClose());
var close = closes[0];
//var* smooth = series(Smooth(closes, 8));
//var zma = ZMA(closes, 9);
//var szma = ZMA(smooth, 6);
//var osc = DecyclerOscillator(closes, 5, 9);
//var ebsw = EvenBetterSinewave(closes, 4, 8);
var ebsw = EvenBetterSinewave(closes, 4, 7);
var stoch = StochEhlers(closes, 22, 152, 11);
var* stochS = series(stoch);
if (
ebsw > .02
&& stoch < .8
&& rising(stochS)
) enterLong();
if (
ebsw < -.91
&& stoch > .2
&& falling(stochS)
) enterShort();
//if (osc < 0) exitLong();
//if (osc > 0) exitShort();
// plot("ZMA", zma, MAIN, DARKBLUE);
// plot("SZMA", szma, MAIN, CYAN);
//if (osc > 0) osc = .5; else osc = -.5;
plot("EBSW", ebsw, NEW, CYAN);
plot("Stoch", stoch, NEW, MAGENTA);
//plot("Decycler", osc, NEW, ORANGE);
// plot("EBSW", ebsw, NEW, BLACK);
}
Monte Carlo Analysis... Median AR 381% Win 1800$ MI 1213$ DD 1573$ Capital 2504$ Trades 3236 Win 47.3% Avg +5.6p Bars 60 CAGR 17866.37% PF 1.12 SR 0.00 UI 0% R2 1.00
Simple setup. Plenty of room for improvements. High signal count. Almost manageable drawdown. Scalable. Fast feedback. Reasonably consistent. Magical numbers ain't that magical.
|
|
|
Re: Lapsa's very own thread
[Re: Lapsa]
#484004
08/25/21 23:04
08/25/21 23:04
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
44 HP & 120 SSF on EBSW.
22 HP sort of workable.
I have given up on lower periods.
Unsure about upper bound. Perhaps something at days & weeks scale.
Ain't interested - screws up feedback cycle too much.
P.s. Tether printer goes brrrrrrrrr
Last edited by Lapsa; 08/25/21 23:09.
|
|
|
Re: Lapsa's very own thread
[Re: Lapsa]
#484008
08/26/21 23:44
08/26/21 23:44
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
Incremental strategy development per month.
Last edited by Lapsa; 08/26/21 23:45.
|
|
|
Re: Lapsa's very own thread
[Re: Lapsa]
#484056
09/02/21 09:51
09/02/21 09:51
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
the angle is a mostly useless parameter, although held in high esteem by Gann believers.
^_^
|
|
|
Re: Lapsa's very own thread
[Re: Lapsa]
#484066
09/02/21 19:29
09/02/21 19:29
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
Already enjoyed that article. Sharing similar sentiment.
`Winner takes all` seems like a good read. Have seen that title before.
Thanks.
Last edited by Lapsa; 09/04/21 08:41.
|
|
|
Re: Lapsa's very own thread
[Re: Lapsa]
#484087
09/04/21 01:08
09/04/21 01:08
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
Think I've given up on thoroughly understanding what Sharpe ratio means, how it's affected and why should I care. Sharpe Ratio = (r_x — R_f)/stdDev(r_x)
aka big numbers good, small numbers bad That's about it.
Last edited by Lapsa; 09/04/21 01:30.
|
|
|
Re: Lapsa's very own thread
[Re: Lapsa]
#484088
09/04/21 01:28
09/04/21 01:28
|
Joined: Aug 2021
Posts: 237
Lapsa
OP
Member
|
OP
Member
Joined: Aug 2021
Posts: 237
|
Perceptron experiments were fun although not quite the direction I would like to take. I don't find: Sig[0]*723 - Sig[1]*123 - Sig[2]*542 > your_mom
meaningful. It's justified, even useful - but not particularly meaningful. For me - such loss of clarity is unacceptable. Similarly - I find Deep Learning repulsive. Someday, maybe, likely I will change my mind. Who knows...
Last edited by Lapsa; 09/04/21 01:29.
|
|
|
|