//+--------------------------------------------------------------------+ //| Copyright: (C) 2014, Miroslav Popov - All rights reserved! | //| Website: http://forexsb.com/ | //| Support: http://forexsb.com/forum/ | //| License: Proprietary under the following circumstances: | //| | //| This code is a part of Forex Strategy Builder. It is free for | //| use as an integral part of Forex Strategy Builder. | //| One can modify it in order to improve the code or to fit it for | //| personal use. This code or any part of it cannot be used in | //| another applications without a permission. Contact information | //| cannot be changed. | //| | //| NO LIABILITY FOR CONSEQUENTIAL DAMAGES | //| | //| In no event shall the author be liable for any damages whatsoever | //| (including, without limitation, incidental, direct, indirect and | //| consequential damages, damages for loss of business profits, | //| business interruption, loss of business information, or other | //| pecuniary loss) arising out of the use or inability to use this | //| product, even if advised of the possibility of such damages. | //+--------------------------------------------------------------------+ #property copyright "Copyright 2014, Miroslav Popov" #property link "http://forexsb.com" #property version "1.00" #property strict #include #include //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ class CandleCodeCrossover : public Indicator { public: CandleCodeCrossover(SlotTypes slotType) { SlotType=slotType; IndicatorName="CandleCode Crossover"; WarningMessage = ""; IsAllowLTF = true; ExecTime = ExecutionTime_DuringTheBar; IsSeparateChart = true; IsDiscreteValues = false; IsDeafultGroupAll = false; } virtual void Calculate(DataSet &dataSet); }; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void CandleCodeCrossover::Calculate(DataSet &dataSet) { Data=GetPointer(dataSet); // Reading the parameters //BasePrice basePrice = (BasePrice)ListParam[2].Index; int BBlength=(int)NumParam[0].Value; int Average =(int)NumParam[3].Value; double Deviations=NumParam[2].Value; double dLevel= NumParam[1].Value; MAMethod maMethod =(MAMethod)ListParam[3].Index; int iPrvs=CheckParam[0].Checked ? 1 : 0; // Calculation int iFirstBar=BBlength+2; double Body[]; ArrayResize(Body,Data.Bars); ArrayInitialize(Body,0); double UpperShadow[]; ArrayResize(UpperShadow,Data.Bars); ArrayInitialize(UpperShadow,0); double LowerShadow[]; ArrayResize(LowerShadow,Data.Bars); ArrayInitialize(LowerShadow,0); double adCandleCode[]; ArrayResize(adCandleCode,Data.Bars); ArrayInitialize(adCandleCode,0); double CandleCodeAverage[];ArrayResize(CandleCodeAverage,Data.Bars); ArrayInitialize(CandleCodeAverage,0); double BodyHi = 0; double BodyLo = 0; double ThBot_Body = 0; double ThTop_Body = 0; double ThBot_Ushd = 0; double ThTop_Ushd = 0; double ThBot_Lshd = 0; double ThTop_Lshd = 0; double ColorCode= 0; double BodyCode = 0; double UshdCode = 0; double LshdCode = 0; for(int iBar=iFirstBar; iBar=Data.Open[iBar]) { ColorCode=64; BodyCode=48; if(Body[iBar]