# Transparent Rectangle

Does anybody have a completed script that automatically draws a transparent rectangle on a chart? Im new to optima but have a scripting past- just need something to reference to get me going as I need to highlight the opening range every day on my chart.

Hi Edward,

Adding a rectangle with scripting is not really possible. It is kind of as you can use mouse points etc but we would need to know what you are trying to acheive to be able to suggest a solution.

A new tool, which will come in Optuma 1.6 (due end of Q2) is a Support Resistance Finder, this tool uses swing charts to identify major turning points and then draws a zone from the turning points to the end of the chart. You can choose how many levels to show above and below the current price.

All the best

Mathew

I figured out a solution using show plot. Here is code to make an opening range transparent rectangle every day (using 1st bar of the day high/low values. i.e. 5 min chart = 5 min OR). Code also includes a dotted line for the OR_Mid level. Mark Fisher’s ACD levels are easy to add to script via plots for Vh + ACD_Level and Vl - ACD_Level

//Specify Open Bar for each day
V1 = BARDATE();
V2 = V1 - V1[1];
V3 = V2 > 0.1;

//Find High Value of Open Bar
Vh = VALUEWHEN(High(),V3);
Vl = VALUEWHEN(Low(),V3);
Vm = (Vh + Vl) * .5;

// Plot the Hi, Low and Mid (Mid is plotted first so you can uncheck “make visible” on plots 2 and 3 so lines won’t display)
Plot1= Vm;
Plot1.Plotstyle = Dot;
Plot1.Color = Olive;
//plot1.FillTransparency = 50;
Plot2 = Vh;
Plot2.Color = Green;
Plot3 = Vl;
Plot3.Color = Green;
Plot4 = Shade(Plot2, Plot3, DOWNCOLOUR=Green, UPCOLOUR=Green, SHADEALPHA=15);

That is a very nice solution. Well done!