Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Indicator Question #456321
11/18/15 15:43
11/18/15 15:43
Joined: Nov 2015
Posts: 2
NC
F
flomo Offline OP
Guest
flomo  Offline OP
Guest
F

Joined: Nov 2015
Posts: 2
NC
Hello,

I am attempting to convert an indicator built in pine-script (Tradingview) into C-Lite. However, currently facing some errors, would be great if anyone could assist!

Indicator link: https://www.tradingview.com/v/pT7lglYP/

Below is my C-Lite coding attempt.

var T3_CCI()
{

var b = 0.618;
var Threshold = 0;
var b2 = b*b;
var b3 = b2*b;
var c1 = -b3;
var c2 = (3*(b2 + b3));
var c3 = -3*(2*b2 + b + b3);
var c4 = (1 + 3*b + b3 +3*b2);
var nr = 1 + 0.5*(5 - 1);
var w1 = 2 / (nr + 1);
var w2 = 1 - w1;

var xcci = CCI(14);
vars e1=series(), e2=series(), e3=series(), e4=series(), e5=series(), e6=series();
e1 = w1*xcci + w2*e1[1];
e2 = w1*e1 + w2*e2[1];
e3 = w1*e2 + w2*e3[1];
e4 = w1*e3 + w2*e4[1];
e5 = w1*e4 + w2*e5[1];
e6 = w1*e5 + w2*e6[1];

return c1*e6 + c2*e5 + c3*e4 + c4*e3;

}

Thanks!

Re: Indicator Question [Re: flomo] #456324
11/18/15 17:17
11/18/15 17:17
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
You have defined the "e1" etc. as series, so it's e1[0] when you want the last element of the array. e2[0] = w1*e1[0] + w2*e2[1];, etc.

Re: Indicator Question [Re: Petra] #456360
11/20/15 03:33
11/20/15 03:33
Joined: Nov 2015
Posts: 2
NC
F
flomo Offline OP
Guest
flomo  Offline OP
Guest
F

Joined: Nov 2015
Posts: 2
NC
Thank you!

CrossOver/CrossUnder problems with exact match of the border [Re: flomo] #456418
11/22/15 02:22
11/22/15 02:22
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Playing with this indicator I accidently found a fact that is revealed in the attached picture. Zorro apparently has a problem to recognize a CrossOver/CrossUnder if there is a value of exactly the border (here: 0) in between which is the case within the magenta circles in the T3_CCI window.

Attached Files
Zorro_CrossX_Problem.jpg (15 downloads)
Re: CrossOver/CrossUnder problems with exact match of the border [Re: Sphin] #456426
11/22/15 14:22
11/22/15 14:22
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
I guess I know where the problem is. Zorro cannot know at the moment the value matches the border if the next value is under or over the border, but this is decisive for facing a crossing or a 'pull back' (see picture: the first circle depicts a crossing, the second a pull back; in both situations the value matches exactly the border). I must admit that I don't have a solution for this, maybe in case of a crossing the next bar after the match of the border can be set vicarious as the crossing point? To neglect the crossing completely seems not so good because it is often a point where some action should take place. Better later than never?

Attached Files
Re: CrossOver/CrossUnder problems with exact match of the border [Re: Sphin] #456443
11/23/15 02:15
11/23/15 02:15
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline
User
GPEngine  Offline
User
G

Joined: Sep 2013
Posts: 504
California
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=53376&Number=444528#top "peak() is baffled by flat-topped peaks. also affects crossover/u"

Re: CrossOver/CrossUnder problems with exact match of the border [Re: GPEngine] #456457
11/23/15 18:15
11/23/15 18:15
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
This was the thread I was searching for, I remembered that there was one but I could not find it. Thanks. It might be more reliable to write own code for those tasks than to miss signals in critical moments.

Re: CrossOver/CrossUnder problems with exact match of the border [Re: Sphin] #463164
11/19/16 04:46
11/19/16 04:46
Joined: Oct 2016
Posts: 4
NJ
S
sw1800 Offline
Guest
sw1800  Offline
Guest
S

Joined: Oct 2016
Posts: 4
NJ
I am wondering if this issue has been fixed in the new versions ?


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