I am running MultiCharts64 Version 15.0 Release (Build 26125).
The indicator is a Smoothed Heikin Ashi PaintBar Study.
I cannot find one that is written for MC so I am trying to
compile one that was written for TS hoping that it is compatible.
Or if anyone knows of this indicator that is written for MC, unfortunately I cannot find it on this site.
The code is shown below. Any help would be appreciated.
Code: Select all
{ Heikin Ashi PaintBarStudy Heikin-Ashi technique for visualization of trend }
inputs: PreSmooth(6), PreSmoothType(2), PostSmooth(2), PostSmoothType(3), GradientPeriod(25), Width(2), UpColor(RGB(0,255,125)),DnColor(RGB(255,125,0));
vars:
haClose(0),haOpen(0),haHigh(0), haLow(0),
smClose(0),smOpen(0),smHigh(0), smLow(0),
lwClose(0),lwOpen(0),lwHigh(0), lwLow(0),
colorb(0),floatingMax(0), floatingMin(0);
//
//
//
//
//
smOpen = _gaverage(O,PreSmooth,PreSmoothType);
smClose = _gaverage(C,PreSmooth,PreSmoothType);
smHigh = _gaverage(H,PreSmooth,PreSmoothType);
smLow = _gaverage(L,PreSmooth,PreSmoothType);
//
//
//
//
//
if BarNumber = 1 then
begin
haOpen = smOpen;
haClose = (smOpen+smClose+smHigh+smLow)/4;
haHigh = MaxList( smHigh, haOpen, haClose);
haLow = MinList( smLow, haOpen, haClose);
end;
if BarNumber > 1 then
begin
haClose = (smOpen+smClose+smHigh+smLow)/4;
haOpen = (haOpen[1] + haClose[1])/2 ;
haHigh = MaxList(smHigh, haOpen, haClose);
haLow = MinList(smLow, haOpen, haClose);
lwClose = _gaverage(haClose,PostSmooth,PostSmoothType);
lwOpen = _gaverage(haOpen ,PostSmooth,PostSmoothType);
lwHigh = _gaverage(haHigh ,PostSmooth,PostSmoothType);
lwLow = _gaverage(haLow ,PostSmooth,PostSmoothType);
value3 = (lwClose+lwOpen+lwHigh+lwLow)/4;
floatingMax = value3;
floatingMin = value3;
for value1 = 0 to GradientPeriod-1 begin
If floatingMax < value3[value1] then floatingMax = value3[value1];
If floatingMin > value3[value1] then floatingMin = value3[value1];
end;
colorb = GradientColor(value3, floatingMin , floatingMax,DnColor ,UpColor);
plot1(lwOpen ,"Open"); Setplotcolor(1,colorb);
plot2(lwClose,"Close"); Setplotcolor(2,colorb);
plot3(lwHigh ,"High"); Setplotcolor(3,colorb);
plot4(lwLow ,"Low"); Setplotcolor(4,colorb);
end;