{ EB_Osc Eichberger Bands - Normalized Oscillator (C)Copyright, 2014, B.Eichberger from Professional Software Solutions, pss@pobox.com This program remains the exclusive property of B. EICHBERGER and may not be sold, used, copied, displayed or modified without the written consent of B. EICHBERGER } Input: Lookback(40), Width(100), ExtendType(1); Vars: nBar(0), nNormPerH(0), nNormPerL(0), nNormPerC(0), nShift(0), idxStart(50), lookbackMax(150), lookbackUse(0), idxBase(0), Counter(0), txtID(Symbol + "_I" + numtostr(BarInterval,0) + "_T" + numtostr(BarType,0) + "_EBOsc"), txtDiag("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxXX"), retEB(0); Array: float arrValIn[50](0), float arrValOut[1000](0); DefineDLLFunc: "C:\Database\PSS_EB\PSS_EB.DLL", int , "PSS_EB", LPSTR,LPFLOAT,LPFLOAT,LPSTR; nBar = BarNumber; lookbackUse = Lookback; IF lookbackUse > lookbackMax THEN lookbackUse = lookbackMax; nShift = lookbackUse/2; arrValIn[0] = Date data1; arrValIn[1] = Time data1; arrValIn[2] = Open data1; arrValIn[3] = High data1; arrValIn[4] = Low data1; arrValIn[5] = Close data1; arrValIn[6] = UpTicks data1; arrValIn[7] = BarNumber data1; arrValIn[8] = BarInterval data1; arrValIn[9] = BarType data1; arrValIn[10]= DownTicks data1; arrValIn[11]= CustomerID; arrValIn[12]= lookbackUse; arrValIn[13]= Width; arrValIn[14]= 1; arrValIn[15]= ExtendType; arrValIn[16]= 0; retEB = PSS_EB(txtID,&arrValIn[0],&arrValOut[0],txtDiag); {====== PROCESS ERRORS ===============================================} IF retEB < -100 THEN RaiseRunTimeError(txtDiag); if retEB >= 0 THEN BEGIN nNormPerH = arrValOut[13]; nNormPerL = arrValOut[14]; nNormPerC = (nNormPerH + nNormPerL)/2; Plot1[nShift](nNormPerH, "NormH" ); Plot2[nShift](nNormPerL, "NormL" ); Plot3[nShift](nNormPerC, "NormC" ); Plot4(0, "Zero" ) ; Plot5(100, "UpperLimit") ; Plot6(-100, "LowerLimit"); //draw extension envelope if retEB > 0 then begin For Counter = 1 To nShift Begin idxBase = idxStart+((Counter-1)*6); nNormPerH = arrValOut[idxBase+3]; nNormPerL = arrValOut[idxBase+4]; Plot1[nShift-Counter](nNormPerH,"NormH"); Plot2[nShift-Counter](nNormPerL,"NormL"); nNormPerC = (nNormPerH + nNormPerL)/2; Plot3[nShift-Counter](nNormPerC, "NormC" ); End; end; end;