viewtopic.php?f=1&t=46647
Due to the width of footprint bars, a standard candle width does not produce a good visual experience.
Here's a study that solve that issue.
Take notice that you need to add a second data series (Cumulative Delta) to achieve this.
You need also to set the open and close style as bar high and bar low respectively.
There's also a label showing the difference between the highest and lowest delta so we can keep track.
Code: Select all
// 02-06-2014
// Delta Bars for Volume Delta charts
// Add Cumulative Delta bars as second data series, UNCHECK *BREAK ON SESSION* option
// Make the study based on the Cumulative Delta series
// http://www.multicharts.com/discussion/viewtopic.php?f=5&t=46652
Input:
CandleUpColor (rgb(32,43,57)),
CandleDnColor (rgb(70,34,22)),
CandleWickColor (rgb(30,30,30)),
CandleBodyWidth (80),
CandleWickWidth (5),
ShowLabel (true),
LabelFont ("consolas"),
LabelColor (rgb(40,40,40)),
LabelSize (8),
ShiftLabel (4);
variables:
myhighdelta (0),
mylowdelta (0),
myclosedelta (0),
diff (0),
diffTXT (-1);
once begin
if ShowLabel = true then begin
diffTXT = text_new_self_dt(datetime, myclosedelta, "");
text_setfontname(diffTXT, LabelFont);
text_setsize(diffTXT, LabelSize);
text_setcolor(diffTXT, LabelColor);
text_setstyle(diffTXT, 0, 1);
text_lock(diffTXT, true);
end;
end;
Plot99(0, "zero");
myclosedelta = close - close[1];
myhighdelta = high - close[1];
mylowdelta = low - close[1];
if myclosedelta > 0 then begin
diff = myhighdelta - myclosedelta;
text_setstring(diffTXT, spaces(ShiftLabel) + "___" + "-" + numtostr(diff, 0));
end
else begin
diff = myclosedelta - mylowdelta;
text_setstring(diffTXT, spaces(ShiftLabel) + "___" + "+" + numtostr(diff, 0));
end;
text_setlocation_dt(diffTXT, datetime, myclosedelta);
plot1(myhighdelta, "high", CandleWickColor);
plot2(mylowdelta, "low", CandleWickColor);
plot3(0, "open");
plot4(myclosedelta, "close");
if Close - Close[1] >= 0 then begin
SetPlotColor(3, CandleUpColor);
SetPlotColor(4,CandleUpColor);
end
else begin
SetPlotColor(3, CandleDnColor);
SetPlotColor(4,CandleDnColor);
end;
SetPlotWidth(1,CandleWickWidth);
SetPlotWidth(2,CandleWickWidth);
SetPlotWidth(3,CandleBodyWidth);
SetPlotWidth(4,CandleBodyWidth);