# Announcement

No announcement yet.

# Partner 728x90

## Comment

The link you sent me is about bollinger bands which I am not sure how it applies to what I want.
The following code is what I currently use to high light an area.

if(ToTime(Time[0]) >= 83000 && ToTime(Time[0]) <= 83500)
{BackColor = Color.PaleTurquoise;
DrawText("my tag3", "Warning", 0, High[0]+TickSize*10, Color.Black) ;
}
Instead of doing the whole area, I want the colored area to be between the high and lows of the prescribed period. Thanks

## Comment

Do you want your chart to be similar to that indicator that I sent? In other words, have a colored area between two plots? Or are you OK with plotting rectangles to color in an area.

## Comment

I was hoping to use another piece of code that used something instead of BackColor that plotted a background color from the times indicated in the code but only stretched from the highs to the lows of the period. An example is the snap I posted earlier.(Which was done using a manual box.)

## Comment

Can you also recheck the link you sent as I am not sure how it relates to what I am talking about?

## Comment

Apologies, I believe we are having a misunderstanding here.

This image : http://www.ninjatrader.com/support/f...kid=350&size=0 has colors between the upper and lower bollinger band. You mentioned coloring only between the highs and lows, as such I am wondering if you wanted to color similar to these bollinger bands, but between your high and low. I.e. instead of using squares, have the chart change color between two plots for example.

## Comment

Sorry.When I say highs and lows I mean a coloured box between the two times indicated and stretching from the highest high to the lowest low for the period.

## Comment

Here is how you can get the highest high and lowest low over a period set to PeriodValue.

Code:
```int highesthigh_index = HighestBar(High,PeriodValue);
int lowestlow_index = LowestBar(Low,PeriodValue);

double highesthigh = High[highesthigh_index];
double lowestlow = Low[lowestlow_index];```
From here, you can draw them using either DrawRectangle command :

DrawRectangle(string tag, bool autoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color, Color areaColor, int areaOpacity)

DrawRectangle(string tag, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, Color areaColor, int areaOpacity)

If you are trying to do this between 8:30 and 8:35, I would suggest translating the "PeriodValue" to reflect this time range, and have your indicator calculate at 8:35.

What sort of chart are you wanting to use this indicator on?

## Comment

Thank you. I was initially looking at using it on 5 min, range and renko charts.

## Comment

It should work just fine on these charts, however please note that with time independent charts such as renko or range charts they wont have the same amount of time per bar, so it may be a little difficult to sync it exactly to a time. Anyway, please let me know if I may assist further.

• # Latest Posts

Topics Statistics Last Post
Started by bmccoard, Today, 06:48 PM
0 responses
5 views
0 likes
Last Post
Started by omololu, Today, 05:10 PM
0 responses
9 views
0 likes
Last Post
by omololu

Started by fut_practic, Today, 05:01 PM
0 responses
7 views
0 likes
Last Post
Started by persoguillermo, Today, 04:38 PM
0 responses
4 views
0 likes
Last Post
Started by localappleseed, Today, 09:59 AM
1 response
20 views
0 likes
Last Post
Working...
X