I want to be able to plot signal bars one above the other over the chart formatted as follows:
Upper bar:
If EMA(7) > SMA(20) then Upper Bar is BLUE, upper value = (greater of (EMA(7) and Upper Bollinger Band BB(15,1,1), lower value = SMA(20).
If EMA(7) < SMA(20) AND EMA(7) > Lower Bollinger bar BB(15,1,1) then Upper Bar is RED, upper value = Upper Bollinger Bar (BB915,1,1), lower value = EMA(7)
If EMA(7) < SMA(20) AND EMA(7) < Lower Bollinger bar BB(15,1,1) then Upper Bar is RED, upper value = Upper Bollinger Bar (BB915,1,1), lower value = Lower Bollinger bar BB(15,1,1)
Lower Bar:
If EMA(7) > SMA(20) then Lower Bar is YELLOW, upper value = SMA(20), lower value is Lower Bollinger Band BB(15,1,1)
If EMA(7) < SMA(20) AND EMA(7) > Lower Bolinger Band BB(15,1,1) then Lower Bar is YELLOW upper value= EMA(7), Lower value = Lower Bollinger Band BB(15,1,1)
If EMA(7) < SMA(20) AND EMA(7) < Lower Bolinger Band BB(15,1,1) then Lower Bar is RED upper value =Lower Bollinger Band BB(15,1,1) , Lower value =EMA(7)
The upper and lower values are easy to calculate, I just can't find a way to plot them on the Charts.
Also I would want to have the time periods as variables for ease of optimising a system.