Gamestudio Links
Zorro Links
Newest Posts
AssetsSP50.csv
by oldflatop. 04/19/21 10:21
Experience with Dukascopy plugin
by Hajoha. 04/19/21 09:11
OANDA-US No Balance Showing
by nullantechamber. 04/18/21 10:24
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/17/21 15:55
Script Template
by DdlV. 04/17/21 15:07
Sierra Chart Plugin
by AndrewAMD. 04/16/21 13:21
AUM Magazine
Latest Screens
Hecknex World
Scheherazade's Journey
Paradox Vector
The Space Between
Who's Online Now
9 registered members (AndrewAMD, oldflatop, AdamWu, Dooley, 3run, Hajoha, Quad, 2 invisible), 400 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
nayan, taygeezy, dadbean, VizTra, simonkrebs
18629 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: 2
Southampton
B
Bennycjones Offline OP
Guest
Bennycjones  Offline OP
Guest
B

Joined: Apr 2021
Posts: 2
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: 2
Southampton
B
Bennycjones Offline OP
Guest
Bennycjones  Offline OP
Guest
B

Joined: Apr 2021
Posts: 2
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