Volume Profile and Market Profile a new wave of market picture

Discussion in 'Advanced Trading Strategies' started by XRAY27, Aug 4, 2016.

Thread Status:
Not open for further replies.
  1. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
    Just presenting today's Nifty Fut 30 mins chart with some of the terms discussed in post #10 marked on the chart

    As the Range has expanded beyond 1st hour so range extension can also be seen today i'e market passed the high of first hour high (9.15 to 10.15)

    [​IMG]
     
    Last edited: Aug 5, 2016
    Vipul_84, sreperu, bpr and 17 others like this.
  2. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
    Main factor which separates market profile from other classical TA is the time factor and MP charts are usually constructed on TIME AND PRICE,Lets see what is price and time with relation to market ,

    When market opens @ 9.15, with in first 30 mins we see and move there after a pause and at last a surge or plunge at flag end of the day (or)

    We have a second scenario where market moves in the opening section and whole day it remains in that range…

    This time factor is main for short term players (intraday) and not much important for longer time frame traders (now on words Other time frame traders(OTF) - swing and positional traders) why ?? since there position is more depended on price where as day traders are dependent on both TIME as well as PRICE

    As this time factor advantage is there for large player they are the deciding factor and day traders has to follow them for gains

    Market profile terminology calls this time and price as TPO (TIME PRICE OPPORTUNITY)
     
    Last edited: Aug 6, 2016
  3. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
    TPO – TPO or Time Price Opportunity is the basic building block of Market Profile. Each and every letter in the chart represents a TPO. Which in turn represents a point of time where the market touches a price. Each consecutive letter denotes a 30min period of Market Activity. In our example as shown below the letter ‘A’ represents how the price traded for the first 30min. Letter ‘B’ represents next 30min of activity. And Letter ‘C’ and ‘D’ represents subsequent market activity details and so on.

    [​IMG]

    Source:Marketcalls
     
    Vipul_84, sreperu, niceman and 22 others like this.
  4. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
    Image from Amibroker representing TPO's

    [​IMG]

    Below is the Amibroker (AFL)

    Code:
    _SECTION_BEGIN("MarketProfile");
    SetChartOptions(0,chartShowArrows|chartShowDates);
    //------------------------------------------------------------------------------
    //
    //  Formula Name:    Market Profile 
    //
    // Use with 5/15min chart
    // Originial - From AFL library
    // Edited by - Milind / KAKA
    // AFL Modified by Rajandran- code works good in 5min, 15min, 30min timeframe
    // Code is Compatible with Amibroker 5.8 and above
    // Letter A now repeats for first 30 min, Letter B next 30 min so on
    // Multiple Repeating Alphabets Horizontally to be fixed in 5min and 15min
    
    //Market Profile 9/12/2009
    
    PlotOHLC(Ref(O,-1),Ref(H,-1),Ref(L,-1),Ref(C,-1),"Price",colorblack,stylenoline);
    _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g", Ref(O,-1), Ref(H,-1), Ref(L,-1), Ref(C,-1) ));
    
    
    EnMP2= ParamList("MarketProfile","Letters|Solid|Lines");
    styleLines = ParamStyle("Style", styleLine, maskAll);
    
    Type=ParamList("Type","Price Profile|Volume Profile");
    Period= ParamList("Base","Hourly|Daily|Weekly|Monthly",1);
    
    
    Den = Param("Density", 3, 0.25, 100, 0.25); // Resolution in terms of $
    percent=Param("Value Area", 70, 1, 100, 1);
    ViewTPOCount= ParamToggle("Show TPO Count", "No|Yes",1);
    ViewPOC = ParamToggle("Show POC", "No|Yes",1);
    ViewVALVAH = ParamToggle("Show VAL VAH Line", "No|Yes",1);
    Viewfill = ParamToggle("Show VA Fill", "No|Yes",1);
    Colorpoc=ParamColor("Color POC", colorYellow);
    Colorfill=ParamColor("Color Fill", ColorRGB(20,40,60));
    
    
    EnIB = ParamToggle("Show Initial Balance", "Yes|No");
    IBBars = Param("Initial Balance Bars", 2, 0, 10, 1);
    
    if(Period=="Daily"){
    BarsInDay = BarsSince(Day() != Ref(Day(), -1));
    Bot = TimeFrameGetPrice("L", inDaily, 0);
    Top = TimeFrameGetPrice("H", inDaily, 0);
    Vol = TimeFrameGetPrice("V", inDaily, 0);
    }
    
    if(Period=="Hourly"){
    BarsInDay = BarsSince(Minute() != Ref(Minute(), -1));
    Bot = TimeFrameGetPrice("L", in5Minute, 0);
    Top = TimeFrameGetPrice("H", in5Minute, 0);
    Vol = TimeFrameGetPrice("V", in5Minute, 0);
    }
    
    if(Period=="Weekly"){
    BarsInDay = BarsSince(DayOfWeek() < Ref( DayOfWeek(), -1 ));
    Bot = TimeFrameGetPrice("L", inWeekly, 0);
    Top = TimeFrameGetPrice("H", inWeekly, 0);
    Vol = TimeFrameGetPrice("V", inWeekly, 0);
    }
    
    if(Period=="Monthly" ){
    BarsInDay = BarsSince(Month() != Ref(Month(), -1));
    Bot = TimeFrameGetPrice("L", inMonthly, 0);
    Top = TimeFrameGetPrice("H", inMonthly, 0);
    Vol = TimeFrameGetPrice("V", inMonthly, 0);
    }
    
    CurTop = HHV(H,BarsInDay+1);
    Curbot = LLV(L,BarsInDay+1);
    Range = Highest(Top-Bot);
    TodayRange = Top - Bot;
    
    AveRange = Sum(Top-Bot,30)/30;
    LAveRange = AveRange[BarCount-1];
    
    // Initialization
    baseX = 0;
    baseY = floor(Bot[0]/Den)*Den;
    relTodayRange = 0;
    firstVisBar = Status("firstvisiblebar");
    lastVisBar = Status("lastvisiblebar");
    
    D=.0005;
    total=0;
    totaldn=0;
    totalup=0;
    shiftup=0;
    shiftdn=0;
    startr=0;
    
    for (j=0; j <= 100; j++) {
      x[j] = 0;
    }
    
    i0 = 0;
    i1 = 0;
    for (i=0; i<BarCount; i++) {
      if (BarsInDay[i] == 0 AND i < firstVisBar) {
        i0 = i;
      }
      if (BarsInDay[i] == 0 AND i >= lastVisBar) {
        i1 = i;
      }
    }
    
    i1 = BarCount-1;
    for (i=i0; i<=i1; i++) {
      if (BarsInDay[i] == 0) {
        baseX = i;
        baseY = floor(Bot[i]/Den)*Den;
        maxY = floor(Top[i]/Den)*Den;
        relTodayRange = (maxY-baseY)/Den;
    
        for (j=0; j <= relTodayRange; j++) {
          x[j] = 0;
        }
      }
    	
    	range_x=lastVisBar-firstVisBar;
    	spread = Param("X Space", 112, 1, 200, 1);
    	tpl = Param("Time Per Letter (mins)", 30, 1, 360, 1);
    	Intervalmin=Interval()/60;
    	flt =Param("First Letter (Bars)", 1, 1, 60, 1);
    	teb=ParamToggle("To Each Bar","No|Yes");
    	Color=Param("Color Threshold",20,1,50,1);
    	stopg=0;
    	stopr=0;
    	new=0;
    	
    	Voloumeunit=Vol[i]/LastValue(BarsInDay);
    
    
      if (EnMP2 == "Letters") {
        for (j=0; j<= relTodayRange; j++) {
          if (L[i] <= baseY+j*Den AND H[i] >= baseY+j*Den) {
            PlotTextSetFont("", "Arial", 6, BarCount-1, Close[ BarCount - 3 ], colorGreen, colorDefault, -20 ); 
            PlotTextSetFont("C", "Arial", 40, 100, 100, colorGreen, colorDefault, -20 ); 
    		PlotText(StrExtract(" A , B , C , D , E , F , G , H ,  I  , J , K , L , M , N , O , P , Q , R , S , T , U , V , W , X , Y , Z, a , b , c , d , e , f , g , h , i , j , k , L , m , n ,o , p , q , r , s , t , u , v , w , x , y , z ",
    		IIf(BarsInDay[i]<flt,0,floor(BarsInDay[i]/(tpl/Intervalmin))-0)), baseX+IIf(teb==1,BarsInDay[i],x[j]*(range_x/spread)), baseY+j*Den, 
    		colorWhite,ColorHSB(10+((floor(BarsInDay[i]/(tpl/Intervalmin)))*Color),160,140));
           x[j]++;
    	PlotTextSetFont("", "Arial", 10, BarCount-1, Close[ BarCount - 3 ], colorGreen, colorDefault, -20 ); 
          }
        }
      }
    	
      else if (EnMP2 == "Lines" OR EnMP2 == "Solid") {
        for (j=0; j<= relTodayRange; j++) {
         if (L[i] <= baseY+j*Den AND H[i] >= baseY+j*Den) {
    		if(Type=="Price Profile"){x[j]=x[j]+1;}
    		else if(Type=="Volume Profile"){x[j]=x[j]+round(V[i]/Voloumeunit);}
     	
    	   }
        }
      }  
    
      // Draw Initial Balance after 11am bar is complete
      if (BarsInDay[i] == IBBars AND EnIB == 0) {
        Line1 = LineArray(i-2, curtop[i-1],i+7, curtop[i-1],0,True);
        Plot(Line1,"",colorLightGrey,styleLine+styleDashed|styleNoRescale);
        Line1 = LineArray(i-2, curbot[i-1],i+7, curbot[i-1],0,True);
        Plot(Line1,"",colorLightGrey,styleLine+styleDashed|styleNoRescale);
      }
    
      // Examine x[j]
      if ((i < BarCount - 1 AND BarsInDay[i+1] == 0) OR i == BarCount-1) {
        maxXj = 0;
    	maxj = 0;
        for (j=0; j<= relTodayRange; j++) {
          if (maxXj < x[j]) {maxXj = x[j]; maxj = j; StaticVarSet("Maxj",j); new=j;
    	  }
        }
    	for ( n = 1; n <= relTodayRange; n++ ) {
           total[n]=x[n]+total[n-1];
            }
    	Value_area=(total[relTodayRange]*percent)/100;
    
    	for ( a = 1; a <= relTodayRange; a++ )
    	 {
    		if(Maxj-a>0 AND Maxj+a<relTodayRange)
    		{
    			if(MaxXj+total[Maxj+a]-total[Maxj]+total[Maxj-1]-total[Maxj-(a+1)]>=Value_area) {shiftup=a; shiftdn=a; break;}
    	 	}	
    		else if(Maxj-a<1 ) 
    		{
    			if(MaxXj+total[Maxj+a]-total[Maxj]+total[Maxj-1]>=Value_area){shiftup=a; shiftdn=maxj-1; break;}		
       		}
    		else if(Maxj+a>relTodayRange ) 
    		{
    			if(MaxXj+total[relTodayRange]-total[Maxj]+total[Maxj-1]-total[Maxj-(a+1)] >=Value_area){shiftup=relTodayRange-maxj; shiftdn=a; break;}		
       		}
    	 }
    
    	Vah = LineArray(baseX, baseY+(maxj+shiftup)*Den, i, baseY+(maxj+shiftup)*Den,0,True);
    	Val = LineArray(baseX, baseY+(maxj-shiftdn)*Den, i, baseY+(maxj-shiftdn)*Den,0,True);
    	poc = LineArray(baseX, baseY+maxj*Den, i, baseY+maxj*Den,0,True);
    	if(ViewVALVAH==1){Plot(Vah,"",ParamColor("Color_VA",  colorLightBlue),styleLine|styleNoRescale);
    	Plot(Val,"",ParamColor("Color_VA",  colorLightBlue),styleLine|styleNoRescale);}
    	if(ViewPOC==1){Plot(poc,"",Colorpoc,styleLine|styleNoRescale);}
    	PlotText(""+(baseY+(maxj+shiftup)*Den),i-5,baseY+(maxj+shiftup)*Den,colorWhite);
    	PlotText(""+(baseY+(maxj-shiftdn)*Den),i-5,baseY+(maxj-shiftdn)*Den,colorWhite);
    	if(ViewTPOCount==1){PlotText(""+total[maxj],basex,bot[i]-(Top[i]-bot[i])*0.05,ParamColor("Color_VAL", colorLavender));
    	PlotText(""+(total[relTodayRange]-total[maxj]),basex,Top[i]+(Top[i]*0.0005),ParamColor("Color_VAH", colorLavender));}
    
    
    
    	if(ViewPOC==1){PlotText(""+(baseY+maxj*Den),i-5,baseY+maxj*Den,Colorpoc);}
      }
    	
    	if (i < BarCount - 1 AND BarsInDay[i+1] == 0 OR i == BarCount-1) {
    	
    	  for  (p = 1; p < relTodayRange+1; p++){
    	  line = LineArray(baseX, baseY+p*Den, baseX+x[p], baseY+p*Den);
    	  line2 = LineArray(baseX, baseY+(p-1)*Den, baseX+x[p-1], baseY+(p-1)*Den);
    
          if (EnMP2 == "Solid")
    	  {
    	  PlotOHLC( Line,  Line,  Line2, Line2, "",IIf(p>(maxj+shiftup),ParamColor("Color_VAH",  colorLavender),IIf(p<=(maxj+shiftup)AND p>(maxj-shiftdn),ParamColor("Color_VA", colorLightBlue),ParamColor("Color_VAL", colorLavender))) ,styleCloud|styleNoRescale|styleNoLabel);
    	  }
    	  if (EnMP2 == "Lines") 
    	  {
         Plot(line,"",IIf(p>(maxj+shiftup),ParamColor("Color_VAH", colorLavender),IIf(p<=(maxj+shiftup)AND p>(maxj-shiftdn),ParamColor("Color_VA", colorLightBlue),ParamColor("Color_VAL",  colorLavender))) , styleLines|styleNoLabel);
         }
     	
       }
    	 if(Viewfill==1){PlotOHLC(Vah,Vah,Val,Val,"",Colorfill,styleCloud|styleNoRescale|styleNoLabel);}
    
     } 
    }
    
    
    _SECTION_END();
    
    _SECTION_BEGIN("Gradient Backfill");
    SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 0,0,0 )),
    
    ParamColor("BgBottom", ColorRGB( 0,0,0 )),ParamColor("titleblock",ColorRGB( 192,192,192 ))); 
    _SECTION_END();
     
    Last edited by a moderator: Aug 6, 2016
  5. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
    Developing Point of Control(DPOC): It is the Point Of Control which is forming for the current day of trading i.e POC forming in the current section of 5th AUG is DPOC and 4th Aug is POC

    Below is the Small setup for Intraday trading based on DP concept of POC

    Step 1 : Note down the POC of Previous day (in 30min HTF)

    Step 2 : Note down the High and Low of Previous day

    Step 3 :Mark them on the current chart as DP (Decision points) and trade them with simple price action
     
    Last edited: Aug 6, 2016
  6. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
    Just posting the image of simple setup discussed in post #25

    4th Aug NF FUT basing on POC,PDH,PDL of 3rd Aug

    [​IMG]

    Morning candle Opened between the previous day high and low and pierced the POC basing on this conclusion:

    PDL and PDH will act as support and resistance and POC can be used as trade anchor for the day

    Hope i have made members understand the basic concepts ,please do post your queries if any..

    i'm not good in teaching :(just presenting my understanding in best possible way :D
     
    Vipul_84, nac, justliving and 18 others like this.
  7. rip07

    rip07 Well-Known Member

    Joined:
    May 9, 2016
    Messages:
    243
    Likes Received:
    561
    Trophy Points:
    93
    X-ray bro!! You are an excellent teacher, from your threads any newbie like me can learn a lot. It is very difficult concept if somebody just refer books, but you are explaining in very easy words. Thanks a lot bahi!!

    Thanks
    rip07
     
  8. Purushotham

    Purushotham Well-Known Member

    Joined:
    Nov 22, 2012
    Messages:
    383
    Likes Received:
    444
    Trophy Points:
    63
    Location:
    Hyderabad, TELANGANA.
  9. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
    Thanks a lot bro !!! If this thread benefits a single follower ,then i can feel happy :) ,it took me 4 months for understanding basics with 4 hours a day study :rolleyes:

    As a D and S trader MP and VP are best weapons for my trading (swing/positional)
     
    Vipul_84, augubhai, candle and 8 others like this.
  10. XRAY27

    XRAY27 Well-Known Member

    Joined:
    Apr 4, 2007
    Messages:
    6,196
    Likes Received:
    24,253
    Trophy Points:
    113
Thread Status:
Not open for further replies.

Share This Page