PL question  [SOLVED]

Questions about MultiCharts and user contributed studies.
designer01
Posts: 80
Joined: 02 Feb 2010

PL question

Postby designer01 » 16 Dec 2012

What would be an PL snipett for this frase:

Buy if CCI value crosses above +50
and CCI value has been below +50 for the last 100 bars minimun. (could be more than 100)

The last portion I'm not sure how to express.

In other words CCI value must never have been above 50 for the last 100 (or an X input amount of my choice) minimun. See screenshot attached.

Thanks in advance.
Attachments
CCI-STRATEGY.jpg
(259.94 KiB) Downloaded 272 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: PL question

Postby TJ » 16 Dec 2012

What would be an PL snipett for this frase:

Buy if CCI value crosses above +50
and CCI value has been below +50 for the last 100 bars minimun. (could be more than 100)

The last portion I'm not sure how to express.

In other words CCI value must never have been above 50 for the last 100 (or an X input amount of my choice) minimun. See screenshot attached.

Thanks in advance.
you can rephrase (re-think) this line

CCI value has been below +50 for the last 100 bars minimun.

to

the highest CCI value of the previous 100 bars, has been lower than 50.

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: PL question

Postby sptrader » 16 Dec 2012

I think he is looking for something like:

Code: Select all

if highest(CCI(14)[1],100) <= 49 and CCI(14) crosses above 50 then buy next bar at market;

designer01
Posts: 80
Joined: 02 Feb 2010

Re: PL question  [SOLVED]

Postby designer01 » 16 Dec 2012

Ok thank you both
highest
was the function/expression I was looking for...


Return to “MultiCharts”