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: Feb 02 2010
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
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: Apr 09 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
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: Feb 02 2010
Ok thank you both
was the function/expression I was looking for...highest