Value Chart free

by qualitiedx2 in category Other at 24/05/2012
Description

This is the famous value timing indicator

Value Chart

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//    Please use the  Feedback  tab to provide us with your suggestions about cAlgo s API.
//
// -------------------------------------------------------------------------------

using System;
using cAlgo.API;
using cAlgo.API.Indicators;


namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
    public class ValueChart : Indicator
    {
        [Parameter(DefaultValue = 5)]
        public int Period { get; set; }
        
  
        
        [Output("UpCandle", IsHistogram = true,  Color = Colors.Green)]
        public IndicatorDataSeries UpCandle { get; set; }  
        
        [Output("UpCandleBack", IsHistogram = true,  Color = Colors.Black)]
        public IndicatorDataSeries UpCandleBack { get; set; }
        
        [Output("UpShadow", IsHistogram = true,  Color = Colors.Green)]
        public IndicatorDataSeries UpShadow { get; set; }
        
        [Output("DownCandle", IsHistogram = true,  Color = Colors.Red)]
        public IndicatorDataSeries DownCandle { get; set; }  
        
        
        [Output("DownCandleBack", IsHistogram = true,  Color = Colors.Black)]
        public IndicatorDataSeries DownCandleBack { get; set; }
        
        [Output("DownShadow", IsHistogram = true,  Color = Colors.Red)]
        public IndicatorDataSeries DownShadow { get; set; }
        
        
        [Output("ShadowBack", IsHistogram = true,  Color = Colors.Black)]
        public IndicatorDataSeries ShadowBack { get; set; }
        
       
        [Output("UpNiveau", Color = Colors.White, LineStyle = LineStyle.LinesDots)]
        public IndicatorDataSeries UpNiveau { get; set; }
        
        [Output("DownNiveau", Color = Colors.White , LineStyle = LineStyle.LinesDots)]
        public IndicatorDataSeries DownNiveau { get; set; }
        
        [Output("UpNiveau2", Color = Colors.White, LineStyle = LineStyle.LinesDots)]
        public IndicatorDataSeries UpNiveau2 { get; set; }
        
        [Output("DownNiveau2", Color = Colors.White,  LineStyle = LineStyle.LinesDots)]
        public IndicatorDataSeries DownNiveau2 { get; set; }
        
        // Local Variable
        private IndicatorDataSeries Range;   
        private IndicatorDataSeries _Avalue;
        
        private IndicatorDataSeries MiddleRange;
        private MovingAverage MovRange;
        private MovingAverage _Bvalue;


        protected override void Initialize()
        {
            // Initialize and create nested indicators
            Range       = CreateDataSeries();
            _Avalue     = CreateDataSeries();
            MiddleRange = CreateDataSeries();
            
            // Initialize the Monving Average
            MovRange = Indicators.MovingAverage(Range, Period, MovingAverageType.Simple);
            _Bvalue  = Indicators.MovingAverage(MiddleRange, Period, MovingAverageType.Simple);
            
        }

        public override void Calculate(int index)
        {
            /** Create a defaut value **/
            UpCandle[index]       = 0.0;
            UpCandleBack[index]   = 0.0;
            UpShadow[index]       = 0.0;
            DownCandle[index]     = 0.0;
            DownCandleBack[index] = 0.0;
            DownShadow[index]     = 0.0;
            ShadowBack[index]     = 0.0;
            
            /*********/
            Range[index] = MarketSeries.High[index]-MarketSeries.Low[index];
            MovRange.Calculate(index);
            
            ///
            _Avalue[index] = 0.2*MovRange.Result[index];
            
            ///
            MiddleRange[index]  =  (MarketSeries.High[index]+MarketSeries.Low[index])/2;
            _Bvalue.Calculate(index);
            
            DownNiveau[index]  = 7.0;
            UpNiveau[index]    = 23.0;
            DownNiveau2[index] = 9.0;
            UpNiveau2[index]   = 21.0;
            
            if(MarketSeries.Close[index]>MarketSeries.Open[index])
                {
            		UpCandle[index] = 15+((MarketSeries.Close[index]-_Bvalue.Result[index])/_Avalue[index]);
            		UpCandleBack[index] = 15+((MarketSeries.Open[index]-_Bvalue.Result[index])/_Avalue[index]);
            		UpShadow[index] =  15+((MarketSeries.High[index]-_Bvalue.Result[index])/_Avalue[index]);
            	}
            else
				{
					DownCandle[index] = 15+((MarketSeries.Open[index]-_Bvalue.Result[index])/_Avalue[index]);
            		DownCandleBack[index] = 15+((MarketSeries.Close[index]-_Bvalue.Result[index])/_Avalue[index]);
            		DownShadow[index] =  15+((MarketSeries.High[index]-_Bvalue.Result[index])/_Avalue[index]);
				}
           
            ShadowBack[index] =  15+((MarketSeries.Low[index]-_Bvalue.Result[index])/_Avalue[index]);           
                    
        }
    }
}
Comments

traderfx - May 06, 2013 @ 10:17

Looks interesting. Does anyone know how to use this?

Pipwizard - July 11, 2013 @ 16:11

This indicator does not display properly, instead of displaying candles as shown in your screenshot it is just displaying straight vertical lines.

adaled - July 16, 2013 @ 14:58

Which parameters? I tried it by using the default and it works. what are you doing exactly?

Pipwizard - July 24, 2013 @ 16:53

Hard to explain but it just shows lines and not candles, I took a snapshot of it hopefully it will show in this post.

reggytrades - March 13, 2014 @ 06:28

Same problem here as Pipwizard.

provafx05 - October 23, 2017 @ 16:44

Dear qualitiedx2, you can realize the dynamic version of value chart? 

provafx05 - October 23, 2017 @ 16:58

Can you make the dynamic version of value chart? 

5