Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 11/18/2017 Posts: 56
|
Hi Bruce,
I tried to plot trend indicator on the chart. I used the following formula but it is returning error.
0/ABS( (H + L + O + C)/4 < ((XAVGH6 + XAVGL6 + XAVGO6 + XAVGC6)/4) and (H + L + O + C)/4 < ((XAVGH12 + XAVGL12 + XAVGO12 + XAVGC12)/4) and (H + L + O + C)/4 < ((XAVGH18 + XAVGL18 + XAVGO18 + XAVGC18)/4) and (H + L + O + C)/4 < ((XAVGH24 + XAVGL24 + XAVGO24 + XAVGC24)/4) and (H + L + O + C)/4 < ((XAVGH30 + XAVGL30 + XAVGO30 + XAVGC30)/4))
Any change needed?
Thanks
|
|
Platinum Customer
Joined: 6/30/2014 Posts: 60
|
There is nothing wrong with the code, it is a function returning numerical answers. So when you save it, it will be saved as an indicator formular (used for plotting or used as numerical answers on a column).
Happy Trading
|
|
Registered User Joined: 11/18/2017 Posts: 56
|
Hi,
It is not working on graph or as an indicator formula. Getting error message as "divide by 0"
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The formula is designed to intentionally return a division by zero error when the following is false.
(H + L + O + C)/4 < ((XAVGH6 + XAVGL6 + XAVGO6 + XAVGC6)/4) and (H + L + O + C)/4 < ((XAVGH12 + XAVGL12 + XAVGO12 + XAVGC12)/4) and (H + L + O + C)/4 < ((XAVGH18 + XAVGL18 + XAVGO18 + XAVGC18)/4) and (H + L + O + C)/4 < ((XAVGH24 + XAVGL24 + XAVGO24 + XAVGC24)/4) and (H + L + O + C)/4 < ((XAVGH30 + XAVGL30 + XAVGO30 + XAVGC30)/4)
The formula just returns zero when the above formula is true. It does this so a dot gets plotted when true and nothing gets plotted when false when used as a Custom PCF Indicator set to use the Dots Plot Style.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/18/2017 Posts: 56
|
Thanks Bruce
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |