Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (opm), 778 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 1
Page 2 of 25 1 2 3 4 24 25
Re: Lapsa's very own thread [Re: Lapsa] #483974
08/21/21 14:58
08/21/21 14:58
Joined: Aug 2021
Posts: 237
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

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.


Code

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);
}

[Linked Image]

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
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

Joined: Aug 2021
Posts: 237
I like this one:


Code
#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);	
}


Quote

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


[Linked Image]



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] #483991
08/24/21 00:22
08/24/21 00:22
Joined: Aug 2021
Posts: 237
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

Joined: Aug 2021
Posts: 237
Quote

If the commission is a percentage of the trade value, enter the negative percent value, f.i. -0.25 for 0.25%.
The commission is then automatically calculated from the percentage using the formula Commission = -Percent/100 * Price / LotAmount * PIPCost / PIP.

Re: Lapsa's very own thread [Re: Lapsa] #484004
08/25/21 23:04
08/25/21 23:04
Joined: Aug 2021
Posts: 237
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

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
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

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
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

Joined: Aug 2021
Posts: 237
Quote

the angle is a mostly useless parameter, although held in high esteem by Gann believers.


^_^

Re: Lapsa's very own thread [Re: Lapsa] #484057
09/02/21 13:40
09/02/21 13:40
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Read this, especially "Gann Magic":
https://financial-hacker.com/seventeen-popular-trade-strategies-that-i-dont-really-understand/

William Gallacher had a few words to say about Gann in Winner Take All as well.

Re: Lapsa's very own thread [Re: Lapsa] #484066
09/02/21 19:29
09/02/21 19:29
Joined: Aug 2021
Posts: 237
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

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
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

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.

Quote

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
L
Lapsa Offline OP
Member
Lapsa  Offline OP
Member
L

Joined: Aug 2021
Posts: 237
Perceptron experiments were fun although not quite the direction I would like to take.

I don't find:

Quote

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.
Page 2 of 25 1 2 3 4 24 25

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1