HHV bar values Open and Close

Please, I need to know values O,C, of this bar H10 = HHV(High, 20); because I need to know if that bar is UP bar or DOWN bar. Will anybody help me please?


You seem to have found HHV function in AmiBroker function reference guide. Have you not seen HHVBars there just one row later?

BTW, How to create your own exploration

/// @link https://forum.amibroker.com/t/hhv-bar-values-open-and-close/9409/1
/// by fxshrat@gmail.com
period = 20;

HH = HHV(H, period);
HHbars = HHVBars(H, period);

HH_Open = Ref(O, -HHbars);
HH_Close = Ref(C, -HHbars);

Is_HHV = H == HH;

HH_IsBullish = HH_Close > HH_Open;
HH_IsBearish = ! HH_IsBullish;

Filter = 1;
// Or use
//Filter = (HH_IsBullish OR HH_IsBearish) AND Is_HHV;

AddColumn( HH, "HHV"+period, 1.2);
AddColumn( HH_Open, "HH_Open", 1.2);
AddColumn( HH_Close, "HH_Close", 1.2);
AddColumn( IIf(HH_IsBullish, 'T', 'F'), "HH_IsBullish", formatChar, colorLightGrey, IIf(HH_IsBullish, colorDarkGreen, -1) );
AddColumn( IIf(HH_IsBearish, 'T', 'F'), "HH_IsBearish", formatchar, colorLightGrey, IIf(HH_IsBearish, colorDarkGreen, -1) );


1 Like

Thank you very much. It is exactly what I needed!