Registered User Joined: 12/16/2004 Posts: 9
|
Hi... so I'm trying to add my own indicator, which basically is a Bollinger Band based on the range of the day (H-L) instead of the Close of the day. I found a formula for Bollinger bands and have adjusted it to suit my needs, but am having problems, most of which probably come from the complexity. In order to track this over the last 30 days, the whole thing comes to a ridiculous amount of code, which is made simpler by making separate PCF's initially, but the final PCF or Indicator has to contain all of the code. By breaking it into parts, I have tested the syntax, but then when i do something simple such as adding 2 of the parts, the syntax does not check out anymore...
So, i have a few questions:
1) Is there ANY sort of variable capabilities in the coding for PCF's so that I don't have to make it re-calculate the same numbers hundreds of times (i.e. L + ((H-L)/2) )? 2) Is there ANY sort of looping function in the code for PCF's? 3) Is there a simpler way of doing this than programming the whole thing from scratch?
All help is much appreciated...
-Jonathan
|

 Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Do you want to bands around the CENTER of the daily range or HALF of the daily range?
- Craig Here to Help!
|
Registered User Joined: 12/16/2004 Posts: 9
|
Around the Center of the range
|

 Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
(H-L)/2 is HALF the range.
(H+L)/2 is the center of the range.
Try this:
Add a CUSTOM INDICATOR with the following formula:
(H+L)/2
Be sure to select the PRICE SCALE option.
You can now EDIT your chart template and ADD Bollinger Bands to THAT custom indicator. I believe this is what you want.
Here are some videos to review:
Plotting Custom Indicators with Examples
Adding, removing and saving indicators to a chart template
- Craig Here to Help!
|