Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, wandaluciaia, 1 invisible), 798 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Indicators - #482807
04/01/21 01:25
04/01/21 01:25
Joined: Apr 2021
Posts: 10
Southampton
B
Bennycjones Offline OP
Newbie
Bennycjones  Offline OP
Newbie
B

Joined: Apr 2021
Posts: 10
Southampton
Hey guys -

Really loving Zorro so far.

Still a bit of a noob to coding, but thought I'd contribute where I can. Been transposing some indicators from tradingview. Any new ones I'll post here for your pleasure...

I cannot promise they are all perfect, but I will check them before I post them. However, on the brightside, most of them probably couldn't be too much worse...

anyways.. first one for you. QQE. Feel free to make the code much better. This is basically just two RSI's for all the hype it gets.

//default smoothing factor 5. Default len = 14.
var QQEF(var * src, var len, var smooth)
{

vars RSI = series(RSI(src, len));
vars RSII = series(EMA(RSI, smooth));

return RSII[0];
}
var QQES(var * src, var len, var smooth)
{

vars RSI = series(RSI(src, len));
vars RSII = series(EMA(RSI, smooth));
var tr = abs(RSII[0] - RSII[1]);
var wwalpha = (1/len);
var wwMI = wwalpha * tr + (1 - wwalpha);
vars WwMII = series(wwMI);
var WWMI = WwMII[0] * WwMII[1];
var atrrsi = wwalpha*WWMI + (1-wwalpha);
vars Atrrsi = series(atrrsi);
var ATRRSI = Atrrsi[0] * Atrrsi[1];

var QUP = RSII[0] + ATRRSI * 4.236;
var QDN = RSII[0] - ATRRSI * 4.236;

vars QQES = series(0.00);


QQES[0] = QQES[1];

if (QUP < QQES[1])
QQES[0] = QUP;
if (RSII[0] > QQES[1] && RSII[1] < QQES[1])
QQES[0] = QDN;
if (QDN > QQES[1])
QQES[0] = QDN;
if (RSII[0] < QQES[1] && RSII[1] > QQES[1])
QQES[0] = QUP;



return QQES[0];
}

Last edited by Bennycjones; 04/01/21 01:29.
Re: Indicators - [Re: Bennycjones] #482836
04/04/21 00:31
04/04/21 00:31
Joined: Apr 2021
Posts: 10
Southampton
B
Bennycjones Offline OP
Newbie
Bennycjones  Offline OP
Newbie
B

Joined: Apr 2021
Posts: 10
Southampton
Ehlers swiss army knife.





var Ehlers_swiss_army_knife(int type, vars src, var len)
{
//Variables....
var pi = 2 * asin(1);
var c0 = 1;
var c1 = 0;
var b0 = 1;
var b1 = 0;
var b2 = 0;
var a1 = 0;
var a2 = 0;
var alpha = 0;
var beta = 0;
var gamma = 0;
var cycle = 2 * pi / len;






switch(type){

//ehlers EMA
case 1:
alpha = (cos(cycle) + sin(cycle) - 1) / cos(cycle);
b0 = alpha;
a1 = 1 - alpha;
//Gaussian
case 2:
beta = 2.415 * (1 - cos(cycle));
alpha = -beta + sqrt((beta * beta) + (2 * beta));
c0 = alpha * alpha;
a1 = 2 * (1 - alpha);
a2 = -(1 - alpha) * (1 - alpha);
//butterworth
case 3:
beta = 2.415 * (1 - cos(cycle));
alpha = -beta + sqrt((beta * beta) + (2 * beta));
c0 = alpha * alpha / 4;
b1 = 2;
b2 = 1;
a1 = 2 * (1 - alpha);
a2 = -(1 - alpha) * (1 - alpha);
//Bandstop...
case 4:
beta = cos(cycle);
gamma = 1 / cos(cycle*2*0.1); // delta default to 0.1. Acceptable delta -- 0.05<d<0.5
alpha = gamma - sqrt((gamma * gamma) - 1);
c0 = (1 + alpha) / 2;
b1 = -2 * beta;
b2 = 1;
a1 = beta * (1 + alpha);
a2 = -alpha;
//plain old sma
case 5:
c1 = 1 / len;
b0 = 1 / len;
a1 = 1;
//exponential
case 6:
alpha = 2/(len+1);
b0 = alpha;
a1 = 1 - alpha;
case 7:
alpha = 1 / len;
b0 = alpha;
a1 = 1 - alpha;
}
vars output = series(src[0]);

output[0] = (c0 * ((b0 * src[0]) + (b1 * src[1]) + (b2 * src[2]))) + (a1 * output[1]) + (a2 * output[2]) - (c1 * src[len]);




return output[0];

}


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