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.
PL question [SOLVED]
-
- Posts: 80
- Joined: 02 Feb 2010
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: PL question
you can rephrase (re-think) this lineWhat 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.
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.
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: PL question
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;
-
- Posts: 80
- Joined: 02 Feb 2010