Tears In The Profile

An idea on how you can plot approximate support and resistance levels based on the presence of larger step-downs.

Picture shows with lighting highlights the brown support lines based on the last 2 day’s profile (96x 30 mins) where the stepdifference was greater than 6.

It may be worth placing more permanent lines over those levels for over time the sample would cease including those areas.

Use it as a helper with preparing for the day.

double start=iOpen(symbol,30,market_profile_length);
double step = FSize*10*Point/8;
    for (i=market_profile_length; i>=0; i--)  
      for (j=30; j>=0; j--) { 
         if (High[i]>start+j*step && Low[i]<start+j*step) mpu[j]++;
         if (High[i]>start-j*step && Low[i]<start-j*step) mpd[j]++;
   }

  for (i=30; i>=0; i--) { 
      if (mpu[i]>0) { ObjectCreate("Qxt 7"+DoubleToStr(i), OBJ_TEXT, 0, Time[0], start+i*step+.0002); 
                     ObjectSetText("Qxt 7"+DoubleToStr(i), "       "+IntegerToString(NormalizeDouble(mpu[i],4),1), 12, "Arial Black", indicator_color3);
                        
                        if (MathAbs(mpu[i]-mpu[i+1])>stepdifference){
                                    ObjectCreate(0,"Qxt5_1"+DoubleToStr(i),OBJ_TREND,0,Time[10],start+i*step+.0002-17*Point,Time[1],start+i*step+.0002-17*Point);
                                    ObjectSetInteger(0,"Qxt5_1"+DoubleToStr(i),OBJPROP_RAY_RIGHT,false);
                                    ObjectSet("Qxt5_1"+DoubleToStr(i),OBJPROP_COLOR,Brown);
                                    ObjectSet("Qxt5_1"+DoubleToStr(i),OBJPROP_WIDTH, 2);}
                                    
                     }
      if (mpd[i]>0) { ObjectCreate("Qxt 9"+DoubleToStr(i), OBJ_TEXT, 0, Time[0], start-i*step+.0002); 
                     ObjectSetText("Qxt 9"+DoubleToStr(i), "      "+IntegerToString(NormalizeDouble(mpd[i],4),1), 12, "Arial Black", indicator_color3);
                     
                             if (MathAbs(mpd[i]-mpd[i+1])>stepdifference){
                                    ObjectCreate(0,"Qxt5_1"+DoubleToStr(i),OBJ_TREND,0,Time[10],start-i*step+.0002-34*Point,Time[1],start-i*step+.0002-34*Point);
                                    ObjectSetInteger(0,"Qxt5_1"+DoubleToStr(i),OBJPROP_RAY_RIGHT,false);
                                    ObjectSet("Qxt5_1"+DoubleToStr(i),OBJPROP_COLOR,Brown);
                                    ObjectSet("Qxt5_1"+DoubleToStr(i),OBJPROP_WIDTH, 2);}

                     }
       }

(Taken from the MQL4 Code, “99-Lines”)