Category Other  Published on 25/10/2013

Mijo Delta Volume Market Profile

Description

Allows traders to analyze the volume at each price in volume histogram indicator.

Market Structure is found from the Profile graphic. Trading logic develops from learning who is doing what in the market, i.e. by understanding the market forces (the Congestion Report illustrates one such force). Time validates price (price over time = value), and time regulates opportunity (short time-frame trader vs longer time-frame trader ). 

Logic creates the framework for trading, the strategy; time generates the signal; and structure provides the confirmation. 

 Show_Delta_Volume: if true then sum of ask - bid @ price else show only current ask & bid @ price

Sum Volume: sum ask + bid volume 

Ask Volume: sum only ask volume 

Bid Volume:  sum only bid volume 

Buyers & Sellers: sum (ask + bid) from middle to high price  -  sum (ask + bid) from middle to low price

Cumulative Volume: sum (Ask Volume - Bid Volume)

Fair Value Volume: Highest ask or bid volume in current indicator

Fair Value Price: Highest ask or bid volume in current indicator only convert to price

VWAP:  volume-weighted average price 

From Pending to entry Ask Bid @ Price !?!

Good Luck & Have Fun :-)

In Download button is V 1.0


V 1.1

// -------------------------------------------------------------------------------
//
//    Mijo Delta Volume Market Profile  V 1.1                                        //
//
// -------------------------------------------------------------------------------

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

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC)]
    public class MijoDeltaVolumeMarketProfile : Indicator
    {
        [Parameter(DefaultValue = true)]
        public bool Show_Delta_Volume { get; set; }
        
        [Parameter(DefaultValue = true)]
        public bool Reset_Chart_On_New_Bar { get; set; }
        
        
        [Parameter(DefaultValue = false)]
        public bool Reverz_BuyersAndSellers { get; set; }
        
        [Parameter(DefaultValue = false)]
        public bool Reverz_CumulativeVolume { get; set; }
        
        [Parameter(DefaultValue = false)]
        public bool Reverz_FairValueVolume { get; set; }
        
        [Parameter(DefaultValue = false)]
        public bool Reverz_FairValuePrice { get; set; }
        
        [Parameter(DefaultValue = false)]
        public bool Reverz_VWAPPrice { get; set; }
        
        
        [Parameter(DefaultValue = 1)]
        public int ShiftRightText { get; set; }
        
        [Output("BidEntries", Color = Colors.Blue, PlotType = PlotType.Histogram, Thickness = 5)]
        public IndicatorDataSeries BidResult { get; set; }

        [Output("AskEntries", Color = Colors.Red, PlotType = PlotType.Histogram, Thickness = 5)]
        public IndicatorDataSeries AskResult { get; set; }

        MarketDepth _marketDepth;

        private int _askNo;
        private int _bidNo;
        private int index = 0;
        private int old_index = 0;
        private int old_day = 0;
        private int old_time = 0;
        private int current_time = 0;
        private int start_time = 0;
        private double today_high =0;
        private double today_low = 999999;
        private double today_bid = 0;
        private double total_pv = 0;
        private double total_pt = 0;
        private int lot_size = 100000;
        private double ask_volume = 0;
        private double bid_volume = 0;
        private double total_volume = 0;
        private double old_askbid_middle = 0;
        private int array_value_index = 1000000;
        private double[] aVolume = new double[1000000];
        private double previous_vwap_price = 0;
        private double previous_middle_price = 0;
        private double previous_fairvalue_price = 0;
        private double previous_fairvalue_volume = 0;
        private double previous_cumulative_volume = 0;
        private double previous_highlow_range_volume = 0;
        private const VerticalAlignment vAlignAskBid = VerticalAlignment.Top;
        private const HorizontalAlignment hAlignAskBid = HorizontalAlignment.Center;
        private const VerticalAlignment vAlignText = VerticalAlignment.Top;
        private const HorizontalAlignment hAlignText = HorizontalAlignment.Right;
        
        protected override void Initialize()
        {
            //Global Init
            for (var s = 0; s < array_value_index; s++)
            {
                aVolume[s] = 0;
            }
            today_bid = Symbol.Bid;
            old_askbid_middle = ((Symbol.Ask + Symbol.Bid)/2);
            _marketDepth = MarketData.GetMarketDepth(Symbol);
            index = MarketSeries.Close.Count - 1;
            old_day = MarketSeries.OpenTime[index].DayOfYear;
            start_time = MarketSeries.OpenTime[index].Year * MarketSeries.OpenTime[index].Day * MarketSeries.OpenTime[index].Hour * MarketSeries.OpenTime[index].Millisecond;
            
            //Cycle
            _marketDepth.Updated += Calc_And_Show_Chart;

        }

        void Calc_And_Show_Chart()
        {
            //Variable
            _askNo = 0;
            _bidNo = 0;            
            int set_position = 0;
            double fair_value = 0;
            double total_time = 0;
            double vwap_price = 0;
            double twap_price = 0;
            int fair_value_index = 0;
            double vwap_price_low = 0;
            double vwap_price_high = 0;
            double fairvalue_price = 0;
            double fairvalue_volume = 0;
            double cumulative_volume = 0;
            double Check_Bid_Volume = 0;
            double Check_Ask_Volume = 0;
            double high_range_volume = 0;
            double low_range_volume = 0;
            double highlow_range_volume = 0;
            double symbol_point = Symbol.PointSize;
            int new_index = MarketSeries.Close.Count - 1;
            int CurrentDay = MarketSeries.OpenTime[new_index].DayOfYear;
            /*            
            var marketSeries1440 = MarketData.GetSeries(TimeFrame.Daily);
            int DailyTimeFrameCount = marketSeries1440.Close.Count - 1;
            double today_high = marketSeries1440.High[DailyTimeFrameCount];
            double today_low = marketSeries1440.Low[DailyTimeFrameCount];
            double today_bid = marketSeries1440.Open[DailyTimeFrameCount];
            */
            
            foreach (var entry in _marketDepth.AskEntries)
            {
                if(entry.Price > today_high)
                {
                    today_high = entry.Price;
                }
            }
            
            foreach (var entry in _marketDepth.BidEntries)
            {
                if(entry.Price < today_low)
                {
                    today_low = entry.Price;
                }
            }
            
            double range = ((today_high - today_low) / symbol_point);
            int middle_of_range = (int)Math.Round(range / 2);
            int middle_of_array = array_value_index / 2;
            int start_set_ask = middle_of_array + (int)Math.Round(((Symbol.Ask - today_bid) / symbol_point));
            int start_set_bid = middle_of_array + (int)Math.Round(((Symbol.Bid - today_bid) / symbol_point));
            int start_volume_index = middle_of_array + (int)Math.Round(((today_low - today_bid) / symbol_point));
            int start_index = (new_index - (int)range);
            int high_ask_value_index = 0;
            int low_bid_value_index = 0;
            int ask_value_index = 0;
            int bid_value_index = 0;
            double middle_price = ((today_high + today_low)/2);
            current_time = MarketSeries.OpenTime[new_index].Year * MarketSeries.OpenTime[new_index].Day * MarketSeries.OpenTime[new_index].Hour * MarketSeries.OpenTime[new_index].Millisecond;
            
            //Clear Indicator chart
            for (var i = new_index; i > 0; i--)
            {
                AskResult[i] = 0;
                BidResult[i] = 0;
            }
            
            //Calc Array
                
            foreach (var entry in _marketDepth.AskEntries)
            {
                double entry_ask_volume = (entry.Volume / lot_size);
                if (Show_Delta_Volume == true)
                {
                    aVolume[start_set_ask + _askNo] = aVolume[start_set_ask + _askNo] + entry_ask_volume;
                }
                else
                {
                    aVolume[start_set_ask + _askNo] = entry_ask_volume;
                }
                vwap_price_high = entry.Price;
                Check_Ask_Volume = Check_Ask_Volume + entry_ask_volume;
                _askNo++;
            }
            
            foreach (var entry in _marketDepth.BidEntries)
            {
                double entry_bid_volume = (entry.Volume / lot_size);
                if (Show_Delta_Volume == true)
                {
                    aVolume[start_set_bid - _bidNo] = aVolume[start_set_bid - _bidNo] - entry_bid_volume;
                }
                else
                {
                    aVolume[start_set_bid - _bidNo] = (entry_bid_volume * (-1));

                }
                Check_Bid_Volume = Check_Bid_Volume + entry_bid_volume;
                vwap_price_low = entry.Price;
                _bidNo++;
            }

            //Indicator Chart
            if (Check_Ask_Volume <= 0)
            {
                ChartObjects.DrawText("No_Ask_Volume", "No Ask Pending Volume", ((((start_index + new_index) / 2) + new_index) / 2), 0, vAlignAskBid, hAlignAskBid, Colors.Magenta);
            }
            else
            {
                ChartObjects.RemoveObject("No_Ask_Volume");
            }
            if (Check_Bid_Volume <= 0)
            {
                ChartObjects.DrawText("No_Bid_Volume", "No Bid Pending Volume", ((((start_index + new_index) / 2) + start_index) / 2), 0, vAlignAskBid, hAlignAskBid, Colors.Magenta);
            }
            else
            {
                ChartObjects.RemoveObject("No_Bid_Volume");
            }
            
            if (Check_Ask_Volume > 0 && Check_Bid_Volume > 0)
            {
                for (int c = start_index; c < new_index; c++)
                {
                    double volume = aVolume[start_volume_index];
                    
                    if(start_volume_index > middle_of_array)
                    {
                        highlow_range_volume = highlow_range_volume + Math.Abs(volume);
                    }
                    else
                    {
                        highlow_range_volume = highlow_range_volume - Math.Abs(volume);
                    }
                
                    if (volume > 0)
                    {
                        AskResult[c] = volume;
                        BidResult[c] = 0;
                    }
                    else
                    {
                        if (volume < 0)
                        {
                            AskResult[c] = 0;
                            BidResult[c] = (volume * (-1));
                        }
                        else
                        {
                            AskResult[c] = 0;
                            BidResult[c] = 0;
                        }
                    }
                    if (Math.Abs(volume) > fair_value)
                    {
                        fair_value_index = c;
                        fair_value = Math.Abs(volume);
                        fairvalue_volume = volume;
                    }
                    start_volume_index++;
                }
            }

            //Calc for Object Chart Text
            high_ask_value_index = start_index + (int)((vwap_price_high - today_low) / symbol_point);
            low_bid_value_index = start_index + (int)((vwap_price_low - today_low) / symbol_point);
            ask_value_index = start_index + (int)((Symbol.Ask - today_low) / symbol_point);
            bid_value_index = start_index + (int)((Symbol.Bid - today_low) / symbol_point);
            
            ask_volume = ask_volume + Check_Ask_Volume;
            bid_volume = bid_volume + Check_Bid_Volume;
            total_volume = ask_volume + bid_volume;
            set_position = (int)Math.Round(fair_value / 10);
            cumulative_volume = bid_volume - ask_volume;
            fairvalue_price = today_low + ((fair_value_index - start_index)*symbol_point);
            //VWAP
            total_pv += (Check_Ask_Volume + Check_Bid_Volume) * ((vwap_price_high + vwap_price_low + ((Symbol.Bid + Symbol.Ask)/2)) /3);
            vwap_price = total_pv / total_volume;
            //TWAP i dont create to work calc in miliseconds to calc diference betwen update time
            /*if(old_time > 0 && old_askbid_middle > 0)
            {
                total_pt += (current_time - old_time) * ((vwap_price_high + vwap_price_low + old_askbid_middle + ((Symbol.Bid + Symbol.Ask)/2)) /4);
                total_time = current_time - start_time;
                twap_price = total_pt / total_time;
            }
            old_askbid_middle = ((Symbol.Bid + Symbol.Ask)/2);
            old_time = current_time;*/
            /*if(current_time > old_time)
            {*/
                total_pt += (current_time - old_time) * ((MarketSeries.Open[new_index-1] + MarketSeries.High[new_index-1] + MarketSeries.Low[new_index-1] + MarketSeries.Close[new_index-1]) /4);
                total_time = current_time - start_time;
                if(total_time > 0)
                {
                    twap_price = total_pt / total_time;
                }
                else
                {
                    twap_price = 0;
                }
            //}
            old_time = current_time;
            
            //Reverz Colors
            if(Reverz_BuyersAndSellers == true)
            {
                highlow_range_volume = highlow_range_volume * (-1);
            }
            if(Reverz_CumulativeVolume == true)
            {
                cumulative_volume = cumulative_volume * (-1);
            }
            if(Reverz_FairValueVolume == true)
            {
                fairvalue_volume = fairvalue_volume * (-1);
            }
        
            //Indicator Object Chart Line
            ChartObjects.DrawVerticalLine("High", new_index, Colors.Magenta, 4, LineStyle.Solid);
            ChartObjects.DrawVerticalLine("Low", start_index, Colors.Green, 4, LineStyle.Solid);
            //ChartObjects.DrawVerticalLine("Middle", ((start_index + new_index) / 2), Colors.PapayaWhip, 1, LineStyle.Solid);
            //ChartObjects.DrawVerticalLine("FairValue", fair_value_index, Colors.Yellow, 3, LineStyle.Solid);
            ChartObjects.DrawVerticalLine("High Ask", high_ask_value_index, Colors.Yellow, 3, LineStyle.Solid);
            ChartObjects.DrawVerticalLine("Low Bid", low_bid_value_index, Colors.Yellow, 3, LineStyle.Solid);
            ChartObjects.DrawVerticalLine("Ask", ask_value_index, Colors.WhiteSmoke, 2, LineStyle.Solid);
            ChartObjects.DrawVerticalLine("Bid", bid_value_index, Colors.WhiteSmoke, 2, LineStyle.Solid);
            
            //Indicator Object Chart Text
            
            /*ChartObjects.DrawText("Sum_Volume", "Sum Volume "+total_volume, new_index+10, fair_value, vAlignText, hAlignText, Colors.DimGray);
            ChartObjects.DrawText("Ask_Volume", "Ask Volume "+ask_volume, new_index+10, (fair_value-set_position), vAlignText, hAlignText, Colors.DimGray);
            ChartObjects.DrawText("Bid_Volume", "Bid Volume "+bid_volume, new_index+10, (fair_value-(set_position*2)), vAlignText, hAlignText, Colors.DimGray);
            //ChartObjects.DrawText("TWAP_Price", "TWAP Price @ "+twap_price.ToString("0.#####"), new_index+10, (fair_value-(set_position*7)), vAlignText, hAlignText, Colors.DimGray);            
            ChartObjects.DrawText("High_Price", "High Price @ "+today_high, new_index+10, (fair_value-(set_position*8)), vAlignText, hAlignText, Colors.DimGray);
            ChartObjects.DrawText("Middle_Price", "Middle Price @ "+middle_price, new_index+10, (fair_value-(set_position*9)), vAlignText, hAlignText, Colors.DimGray);
            ChartObjects.DrawText("Low_Price", "Low Price @ "+today_low, new_index+10, (fair_value-(set_position*10)), vAlignText, hAlignText, Colors.DimGray);*/
            
            //Current
            if(highlow_range_volume < 0)
            {
                ChartObjects.DrawText("MiddleRangeVolume", "Buyers & Sellers "+highlow_range_volume, new_index+ShiftRightText, fair_value, vAlignText, hAlignText, Colors.RoyalBlue);
            }
            else
            {
                if(highlow_range_volume > 0)
                {
                    ChartObjects.DrawText("MiddleRangeVolume", "Buyers & Sellers "+highlow_range_volume, new_index+ShiftRightText, fair_value, vAlignText, hAlignText, Colors.Red);
                }
                else
                {
                    ChartObjects.DrawText("MiddleRangeVolume", "Buyers & Sellers "+highlow_range_volume, new_index+ShiftRightText, fair_value, vAlignText, hAlignText, Colors.DimGray);
                }
            }
            
            if(cumulative_volume < 0)
            {
                ChartObjects.DrawText("Cumulative_Volume", "Cumulative Volume "+cumulative_volume, new_index+ShiftRightText, (fair_value-set_position), vAlignText, hAlignText, Colors.RoyalBlue);
            }
            else
            {
                if(cumulative_volume > 0)
                {
                    ChartObjects.DrawText("Cumulative_Volume", "Cumulative Volume "+cumulative_volume, new_index+ShiftRightText, (fair_value-set_position), vAlignText, hAlignText, Colors.Red);
                }
                else
                {
                    ChartObjects.DrawText("Cumulative_Volume", "Cumulative Volume "+cumulative_volume, new_index+ShiftRightText, (fair_value-set_position), vAlignText, hAlignText, Colors.DimGray);
                }
            }
            if(fairvalue_volume < 0)
            {
                ChartObjects.DrawText("FairValue_Volume", "Fair Value Volume "+fairvalue_volume, new_index+ShiftRightText, (fair_value-(set_position*2)), vAlignText, hAlignText, Colors.RoyalBlue);
            }
            else
            {
                if(fairvalue_volume > 0)
                {
                    ChartObjects.DrawText("FairValue_Volume", "Fair Value Volume "+fairvalue_volume, new_index+ShiftRightText, (fair_value-(set_position*2)), vAlignText, hAlignText, Colors.Red);
                }
                else
                {
                    ChartObjects.DrawText("FairValue_Volume", "Fair Value Volume "+fairvalue_volume, new_index+ShiftRightText, (fair_value-(set_position*2)), vAlignText, hAlignText, Colors.DimGray);
                }
            }
            if(fairvalue_price < vwap_price)
            {
                if(Reverz_FairValuePrice == true)
                {
                    ChartObjects.DrawText("FairValue_Price", "Fair Value Price @ "+fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*3)), vAlignText, hAlignText, Colors.Red);
                }
                else
                {
                    ChartObjects.DrawText("FairValue_Price", "Fair Value Price @ "+fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*3)), vAlignText, hAlignText, Colors.RoyalBlue);
                }
            }
            else
            {
                if(fairvalue_price > vwap_price)
                {
                    if(Reverz_FairValuePrice == true)
                    {
                        ChartObjects.DrawText("FairValue_Price", "Fair Value Price @ "+fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*3)), vAlignText, hAlignText, Colors.RoyalBlue);
                    }
                    else
                    {
                        ChartObjects.DrawText("FairValue_Price", "Fair Value Price @ "+fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*3)), vAlignText, hAlignText, Colors.Red);
                    }
                }
                else
                {
                    ChartObjects.DrawText("FairValue_Price", "Fair Value Price @ "+fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*3)), vAlignText, hAlignText, Colors.DimGray);
                }
            }
            
            if(vwap_price > middle_price)
            {
                if(Reverz_VWAPPrice  == true)
                {
                    ChartObjects.DrawText("VWAP_Price", "VWAP Price @ "+vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*4)), vAlignText, hAlignText, Colors.Red);
                }
                else
                {
                    ChartObjects.DrawText("VWAP_Price", "VWAP Price @ "+vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*4)), vAlignText, hAlignText, Colors.RoyalBlue);
                }
            }
            else
            {
                if(vwap_price < middle_price)
                {
                    if(Reverz_VWAPPrice  == true)
                    {
                        ChartObjects.DrawText("VWAP_Price", "VWAP Price @ "+vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*4)), vAlignText, hAlignText, Colors.RoyalBlue);
                    }
                    else
                    {
                        ChartObjects.DrawText("VWAP_Price", "VWAP Price @ "+vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*4)), vAlignText, hAlignText, Colors.Red);
                    }
                }
                else
                {
                    ChartObjects.DrawText("VWAP_Price", "VWAP Price @ "+vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*4)), vAlignText, hAlignText, Colors.DimGray);
                }
            }
            
            //Previous
            if(Reset_Chart_On_New_Bar == true)
            {
                ChartObjects.DrawText("Previous_Bar", "Previous Bar", new_index+ShiftRightText, (fair_value-(set_position*5)), vAlignText, hAlignText, Colors.Yellow);
                if(previous_highlow_range_volume < 0)
                {
                    ChartObjects.DrawText("Previous_MiddleRangeVolume", "Buyers & Sellers "+previous_highlow_range_volume, new_index+ShiftRightText, (fair_value-(set_position*6)), vAlignText, hAlignText, Colors.RoyalBlue);
                }
                else
                {
                    if(previous_highlow_range_volume > 0)
                    {
                        ChartObjects.DrawText("Previous_MiddleRangeVolume", "Buyers & Sellers "+previous_highlow_range_volume, new_index+ShiftRightText, (fair_value-(set_position*6)), vAlignText, hAlignText, Colors.Red);
                    }
                    else
                    {
                        ChartObjects.DrawText("Previous_MiddleRangeVolume", "Buyers & Sellers "+previous_highlow_range_volume, new_index+ShiftRightText, (fair_value-(set_position*6)), vAlignText, hAlignText, Colors.DimGray);
                    }
                }
                
                if(previous_cumulative_volume < 0)
                {
                    ChartObjects.DrawText("Previous_Cumulative_Volume", "Cumulative Volume "+previous_cumulative_volume, new_index+ShiftRightText, (fair_value-(set_position*7)), vAlignText, hAlignText, Colors.RoyalBlue);
                }
                else
                {
                    if(previous_cumulative_volume > 0)
                    {
                        ChartObjects.DrawText("Previous_Cumulative_Volume", "Cumulative Volume "+previous_cumulative_volume, new_index+ShiftRightText, (fair_value-(set_position*7)), vAlignText, hAlignText, Colors.Red);
                    }
                    else
                    {
                        ChartObjects.DrawText("Previous_Cumulative_Volume", "Cumulative Volume "+previous_cumulative_volume, new_index+ShiftRightText, (fair_value-(set_position*7)), vAlignText, hAlignText, Colors.DimGray);
                    }
                }
                if(previous_fairvalue_volume < 0)
                {
                    ChartObjects.DrawText("Previous_FairValue_Volume", "Fair Value Volume "+previous_fairvalue_volume, new_index+ShiftRightText, (fair_value-(set_position*8)), vAlignText, hAlignText, Colors.RoyalBlue);
                }
                else
                {
                    if(previous_fairvalue_volume > 0)
                    {
                        ChartObjects.DrawText("Previous_FairValue_Volume", "Fair Value Volume "+previous_fairvalue_volume, new_index+ShiftRightText, (fair_value-(set_position*8)), vAlignText, hAlignText, Colors.Red);
                    }
                    else
                    {
                        ChartObjects.DrawText("Previous_FairValue_Volume", "Fair Value Volume "+previous_fairvalue_volume, new_index+ShiftRightText, (fair_value-(set_position*8)), vAlignText, hAlignText, Colors.DimGray);
                    }
                }
                if(previous_fairvalue_price < previous_vwap_price)
                {
                    if(Reverz_FairValuePrice == true)
                    {
                        ChartObjects.DrawText("Previous_FairValue_Price", "Fair Value Price @ "+previous_fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*9)), vAlignText, hAlignText, Colors.Red);
                    }
                    else
                    {
                        ChartObjects.DrawText("Previous_FairValue_Price", "Fair Value Price @ "+previous_fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*9)), vAlignText, hAlignText, Colors.RoyalBlue);
                    }
                }
                else
                {
                    if(previous_fairvalue_price > previous_vwap_price)
                    {
                        if(Reverz_FairValuePrice == true)
                        {
                            ChartObjects.DrawText("Previous_FairValue_Price", "Fair Value Price @ "+previous_fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*9)), vAlignText, hAlignText, Colors.RoyalBlue);
                        }
                        else
                        {
                            ChartObjects.DrawText("Previous_FairValue_Price", "Fair Value Price @ "+previous_fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*9)), vAlignText, hAlignText, Colors.Red);
                        }
                    }
                    else
                    {
                        ChartObjects.DrawText("Previous_FairValue_Price", "Fair Value Price @ "+previous_fairvalue_price, new_index+ShiftRightText, (fair_value-(set_position*9)), vAlignText, hAlignText, Colors.DimGray);
                    }
                }
                
                if(previous_vwap_price > previous_middle_price)
                {
                    if(Reverz_VWAPPrice  == true)
                    {
                        ChartObjects.DrawText("Previous_VWAP_Price", "VWAP Price @ "+previous_vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*10)), vAlignText, hAlignText, Colors.Red);
                    }
                    else
                    {
                        ChartObjects.DrawText("Previous_VWAP_Price", "VWAP Price @ "+previous_vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*10)), vAlignText, hAlignText, Colors.RoyalBlue);
                    }                        
                }
                else
                {
                    if(previous_vwap_price < previous_middle_price)
                    {
                        if(Reverz_VWAPPrice  == true)
                        {
                            ChartObjects.DrawText("Previous_VWAP_Price", "VWAP Price @ "+previous_vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*10)), vAlignText, hAlignText, Colors.RoyalBlue);
                        }
                        else
                        {
                            ChartObjects.DrawText("Previous_VWAP_Price", "VWAP Price @ "+previous_vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*10)), vAlignText, hAlignText, Colors.Red);
                        }
                    }
                    else
                    {
                        ChartObjects.DrawText("Previous_VWAP_Price", "VWAP Price @ "+previous_vwap_price.ToString("0.#####"), new_index+ShiftRightText, (fair_value-(set_position*10)), vAlignText, hAlignText, Colors.DimGray);
                    }
                }
                
                //Global Init Preious Value
                if (new_index != index)
                {
                    index = new_index;
                    for (var i = 0; i < array_value_index; i++)
                    {
                        aVolume[i] = 0;
                    }
                    today_high =0;
                    today_low = 999999;
                    today_bid = Symbol.Bid;
                    previous_vwap_price = vwap_price;
                    previous_middle_price = middle_price;
                    previous_fairvalue_price = fairvalue_price;
                    previous_fairvalue_volume = fairvalue_volume;
                    previous_cumulative_volume = cumulative_volume;
                    previous_highlow_range_volume = highlow_range_volume;
                }
            }
        }
        public override void Calculate(int index)
        {
        }
    }
}

 


V 1.0

 


/

MI
mijo212

Joined on 12.10.2013

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Mijo Delta Volume Market Profile.algo
  • Rating: 3.33
  • Installs: 8489
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
RI

Hi, I have downloaded it but it show nothing

https://i.ibb.co/0rNNtGL/Screen-Shot-20200524232503.png

Like this

cTrader 3.7

Thanks

DI
Diim · 4 years ago

Oops i mean throw :-)

DI
Diim · 4 years ago

Wow, very interesting, I looked and analyze a lot and I like it very much. But I can only guess how you actually use it at work. Mijo, can you please through some ideas for it?
I didn't see you on ctrader for a while, did you start to use another platform?

IB
iburakbirer · 9 years ago

@mijo212 Hi, thanks for this great indicator.
 

I have an idea for your indicator. Would you like to test price groups instead of every price? I mean now it shows every volume for 5digits prices right? I believe it would be more meaningfull if we could see price ranges. like for 10 pips instead of 1 pip maybe?

Best,

MI
mijo212 · 10 years ago

sorry roxy2014 the platform is after so many months more changes so that the indicator should be full remake

MA
MarketProst · 10 years ago

Hi guys! Please explain how to use it.

RO
roxy2014 · 10 years ago

image of error below

http://tenkofx.ctrader.com/images/screens/ftKnn.png

http://tenkofx.ctrader.com/c/ftKnn

RO
roxy2014 · 10 years ago

Operating on M1 timeframe with following Error.  

When I use your indicator , the volume histogram is not under current price, like your Image. My histogram is scaled to the left, therefore when I watch current Price, I don't see the histogram. I have to scroll back in time to see the current histogram. 

 

Can you add a Scale Shirt to solve problem or tell me how to fix? 

MI
mijo212 · 11 years ago

thx jtrader. please specify what you want i don't understand what you want & when i can, then i add this logic to indicator, ok ? :-)

JT
jtrader · 11 years ago

Great work Mijo!

Can you modify it so you only look at a specific range. Maybe by adding vertical lines defining the period start and period end? Might make it easier to identify the market maker cycle?