Profile Picture

How to draw an indicator band (custom formula)?

Posted By DrKoch 6 Years Ago
Message
Posted Monday January 17 2011
How can I draw a band on a chat where the upper and lower lines are given by an arbitrary indicator (aka UserSeries)?



www.finantic.de

Our Trading System at C2: Topaz
Posted Monday January 17 2011
Are you looking to create an indicator to accomplish this or do you simply want to use the chart objects? With chart objects, you have access to the Points and can add/remove/update the points of the band based on any values.

DrKoch (1/17/2011)
How can I draw a band on a chat where the upper and lower lines are given by an arbitrary indicator (aka UserSeries)?
Posted Monday January 17 2011
I am happy to use chart objects but can't seem to find the right class to start with...


www.finantic.de

Our Trading System at C2: Topaz
Posted Monday January 17 2011
It's always good to post some stupid question in this forum.
Before I do so I search for hours to be sure I don't ask something obvious.
Shortly after the post is published I stumble over the solution:

Inside MySymbolSCript.Startup() you say
FillIndicatorRegion(user1, user2, color);

simple.


www.finantic.de

Our Trading System at C2: Topaz
Posted Monday January 17 2011
.... but is does not work as advertised.
I have three User series:
greenUpper, greenCenter, greenLower
redUpper, redCenter, redLower

as soon as I use FillIndicatorRegion()
my other series lose their colors and widths...
... very confusing ...

any advices?

(This is 2010 build 30)


www.finantic.de

Our Trading System at C2: Topaz
Posted Tuesday January 18 2011
FillIndicatorRegion shade an area between two indicators. For example, it is easier to visualize the area between two Bollinger Bands (upper and lower) or any other set of indicators that are always parallel to one another. That doesn't sound like what you're after.

If you're calling this in start up though, the coordinates may be wrong. Check out the sample IndicatorShade and see if that works but it sounds like you want something more like what is in the sample ColorBar, perhaps?
Posted Wednesday January 19 2011
Hi Bill,
I took the IndicatorShade sample and added three lines of code. (I wanted a blue center line):

public class MySymbolScript : MySymbolScriptBase
{
   // Construct upper and lower Bollinger bands using 21 periods and
   // a standard deviation of 2.
   BollingerBandUpper BBU = new BollingerBandUpper(21, 2);
   BollingerBandLower BBL = new BollingerBandLower(21, 2);
   SMA sma = new SMA(4); // added
   
   public override void Startup()
   {
      //   Perform initialization here.
      
      sma.SetInputs(Close); // added
      sma.ChartSettings.Color = Color.Blue;// added
      
      BBU.SetInputs(Close);
      BBU.ChartSettings.Color = Color.Red;

      BBL.SetInputs(Close);
      BBL.ChartSettings.Color = Color.Red;
      
      // Shades the area in between the lower and upper bands.
      FillIndicatorRegion(BBL, BBU, Color.DarkGray);
   }
}


Try this with and without FillIndicator ...


www.finantic.de

Our Trading System at C2: Topaz
Posted Tuesday January 25 2011
Any thoughts?

THIS IS A BUG REPORT!


www.finantic.de

Our Trading System at C2: Topaz
Posted Thursday January 27 2011
Thanks for the bug report Smile It will be fixed in the next build.

Daniel
Posted Sunday February 06 2011
Guys I think this is the problem I reported to Bill via email on 20 Nov 2008. It was assigned Incident #1266.
I just tested it in Build 27 and it's still a problem.

I would find this feature extremely useful if it worked.

thanks and regards


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems