I have a problem overlaying a candlestick plot generated by a combination of plot1, plot2, plot3 and plot4 over a bar chart generated by plot5 and plot6. One has to make sure the plot types for these are respectively: Bar High, Bar Low, Left Tick, Right Tick, Bar High and Bar Low. I also set the thickness of the bars formed by plot5 and plot6 to 9. What I see is the shadows of the candlesticks (aka the tails) disappear behind the bar chart but the bodies are in front. This is despite making sure I plot the bar plot first prior to the candlestick plot, although it doesn't appear to make any difference. Is there something else I need to do, or is this a bug? The study is shown below.
variables:
colorc(darkgreen), myh(0), myl(0), myo(0), myc(0), intrabarpersist nb(0);
if nb = 0 then myh = 3500;
if currentbar > nb then begin
nb = currentbar;
myh = myh+5;
myl = myh-20;
myo = myl+5;
myc = myh-5;
end;
//PlotPaintBar(myh,myl,myo,myc,"",colorc,default,1);
plot5(3700,"High2",cyan,default,9);
plot6(3500,"Low2",cyan,default,9);
plot1(myh,"High",colorc);
plot2(myl,"Low",colorc);
plot3(myo,"Open",colorc);
plot4(myc,"Close",colorc);
Disappearing candlestick shadows
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Thanks Marina. Which way will it be fixed? Will the whole candle be on top or the bars will be on top? What would be nice is one could select the order from withing the study. In other words, the plotn function has an option that says "infront" or "behind"; where "infront" means plot the indicator in front of anything else and "behind" means it plots it behind anything else. Failing this, the default option is it plots behind. That way, the PlotPaintBar candlestick like indicator will always be in front since that would be typically the first one plotted in a study. However, as I understand it, the current behavior is all subsequent plots are in front. SO, another approach is to make an exception for PlotPainBar and make sure that one is always in front. The same must be done if one uses plot1,2,3,4 combination (to display custom the labels in the hint window). A far better approach is to create a synthetic symbol from a study and treat that as if it's being sourced from the database. That way, one could set the properties of the indicator similar to a normal symbol, such as chart type. Some properties would not be relevant so they can be grayed out.