/*[[ Name := Heikin-Ashi_MOD Author := tom112@Aborigen Link := tom112@mail.wplus.net Separate Window := No First Color := Blue First Draw Type := Histogram First Symbol := 217 Use Second Data := Yes Second Color := Red Second Draw Type := Histogram Second Symbol := 218 ]]*/ Input : CompBars(8), NRRASCH(300); Vars : CurrentBar(0), Movhadiffco(0), Value1(0), Value2(0), Max1(0),Min1(0),Max2(0),Min2(0), cnt(0); Arrays: haOpen[132000](0), haClose[132000](0); SetLoopCount(0); For CurrentBar = NRRASCH downto 0 Begin haClose[CurrentBar] = (H[CurrentBar]+ O[CurrentBar] + L[CurrentBar] + C[CurrentBar])/4; //haClose[CurrentBar+1] = (H[CurrentBar+1]+ O[CurrentBar+1] + L[CurrentBar+1] + C[CurrentBar+1])/4; if CurrentBar = NRRASCH then haOpen[CurrentBar+1]=O[CurrentBar+1]; //else haOpen[CurrentBar+1]=haOpen[CurrentBar]; haOpen[CurrentBar] = (haOpen[CurrentBar+1] + haClose[CurrentBar+1])/2; if haClose[CurrentBar] < haOpen[CurrentBar] then { Value1 = L[CurrentBar]; Value2 = H[CurrentBar]; }; if haClose[CurrentBar] > haOpen[CurrentBar] then { Value2 = L[CurrentBar]; Value1 = H[CurrentBar];}; //if CurrentBar= Min1 and haClose[CurrentBar] <= Max2 and haClose[CurrentBar] >= Min2 then Begin if haClose[CurrentBar+cnt] < haOpen[CurrentBar+cnt] then { Value1 = L[CurrentBar]; Value2 = H[CurrentBar];}; if haClose[CurrentBar+cnt] > haOpen[CurrentBar+cnt] then { Value2 = L[CurrentBar]; Value1 = H[CurrentBar];}; end; end; //end; SetIndexValue(CurrentBar, Value1); SetIndexValue2(CurrentBar, Value2); End;