Can we plot heikinashi and bar on same chart

rvlv

Active Member
#1
hi friends
here is a metatrader based chart.
pipspring.

Can we have a code for similar plot-please



--------------------------------------------------------------------------------------------------------
//here is what I tried
//This is AFL of Heikin-Ashi(Koma-Ashi)with Moving Average.

//It's smoothly Heikin-Ashi derivative indicator,
//AND prevent to collapse a graph for first bars.

//----
//TOBY
//http://tobysoft.net/

//Formula:
/*
Heikin-Ashi(Koma-Ashi) with Moving Average Type
*/
SetChartOptions(2, chartWrapTitle);

// Calculate Moving Average
MAPeriod = Param("MA Period", 15, 1, 100);
MAOpen = EMA(Open, MAPeriod);
MAHigh = EMA(High, MAPeriod);
MALow = EMA(Low, MAPeriod);
MAClose = EMA(Close, MAPeriod);

HaClose = (MAOpen + MAHigh + MALow + MAClose) / 4;
HaOpen = AMA(Ref(HaClose, -1), 0.5);

// for graph collapse
for(i = 0; i <= MAPeriod; i++) HaClose = Null;
/*
// same
// HaOpen = (Ref(HaOpen, -1) + Ref(HaClose, -1)) / 2;
HaOpen[ 0 ] = HaClose[ 0 ];
for(i = 1; i < BarCount; i++) {
HaOpen = (HaOpen[i - 1] + HaClose[i - 1]) / 2;
}
*/

HaHigh = Max(MAHigh, Max(HaClose, HaOpen));
HaLow = Min(MALow, Min(HaClose, HaOpen));

// outs comments
"BarIndex = " + BarIndex();
"Open = " + Open;
"High = " + High;
"Low = " + Low;
"Close = "+ Close;
"HaOpen = " + HaOpen;
"HaHigh = " + HaHigh;
"HaLow = " + HaLow;
"HaClose = "+ HaClose;

// Plot graphs
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} HaOpen %g, HaHigh %g,
HaLow %g, HaClose %g (%.1f%%) {{VALUES}}",
HaOpen, HaHigh, HaLow, HaClose, SelectedValue(ROC( HaClose, 1))));
PlotOHLC(HaOpen, HaHigh, HaLow, HaClose, _DEFAULT_NAME(), ParamColor("Color",colorBlack), styleCandle);

//==========================================
//normal heikin ashi
HaClose =EMA((O+H+L+C)/4,3);

HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );

HaHigh = Max( H, Max( HaClose, HaOpen ) );

HaLow = Min( L, Min( HaClose, HaOpen ) );

PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), colorBlack,styleCandle | styleNoLabel );
 
Last edited:

rvlv

Active Member
#3
Hariom ji

Thank you for the useful hint.

It is way beyond my idea.

will try.
just reproducing chart from the link you suggested for others to see.
It looks different from ordinary indicators i know.
regards
 
#4
ok i think i have it for amibroker , please give ur yahoo or gtalk id if u have so i can share afl there , i know uploading but thts a tiring process
 

prst

Well-Known Member
#6
There is a indicator ha delta based on heiken ashi . This can b useful with candlesticks
 

Similar threads