The Flow Method and Market Profile

Hi segul can u again upload ur notes on MP as 4shared i m not getting the pdf can u upload them again as i m interested pls do the needfull hope to hear soon regards
 
Hi, xyte,

Your post No. 113 MP alf for amibroker has the following error can u rectify the same pls and correct it and post the afl again for intraday error as follows

procedure PlotLine(x1, y1, x2, y2, Color)

{

GfxSelectPen(Color, 1, 0);

GfxPolyline(x1, y1, x2, y2)
--------------------------^

GfxPolyline: number of arguments must be even




Hope to hear soon
regards
 
Please note that this one will work only on intraday data.

Also ensure that tick size is set to 1 in the symbol - information { click on the symbol menu in amibroker then select tick size - default 0 - change to 1 }

The limitation of this program is that it plots MP data for the last 3 days only and is sort of skewed to the left. You'll grasp what I say when you apply it on any intraday chart.
 

ag_fx

Well-Known Member
There is some good amount of educational material available on the CBOT's website regarding the market profile. One can follow this link to reach there.



http://www.cbot.com/cbot/pub/page/0,3181,1184,00.html


Alex, if you can include this link in your first post, it might benefit anyone getting introduced to MP. Or may be u can link this post in your master first post as you feel correct.

Happy Trading

Ankit
 

orderflow13

Well-Known Member
There is some good amount of educational material available on the CBOT's website regarding the market profile. One can follow this link to reach there.



http://www.cbot.com/cbot/pub/page/0,3181,1184,00.html


Alex, if you can include this link in your first post, it might benefit anyone getting introduced to MP. Or may be u can link this post in your master first post as you feel correct.

Happy Trading

Ankit
Thanks Ankit, will do so
 
Xyte i read your reply thanks and did as u told me but its the same error


procedure PlotLine(x1, y1, x2, y2, Color)

{

GfxSelectPen(Color, 1, 0);

GfxPolyline(x1, y1, x2, y2)
--------------------------^

GfxPolyline: number of arguments must be even


pls get the number of arguments must be even the GfxPolyline(.......) we get the error

pls rectify the same

regards
 
Segul i had pasted your afl for MP in Amibroker and today during the Mkts just was tracking Reliance stock but i could not get the screen as u have posted in this thread can u upload a new afl for amibroker where i can get the similar screen as u have posted in this thread of yours

hope to hear soon

regards
 

milind

Active Member
I am using following afl for market profile.

Code:
_SECTION_BEGIN("MarketProfile");
//------------------------------------------------------------------------------
//
//  Formula Name:    Market Profile 
//
// Use with 5/15min chart
// Originial - From AFL library
// Edited by - Milind

//Market Profile


Den = Param("Density", 1, 0.25, 100, 0.25); // Resolution in terms of $
IBBars = Param("Initial Balance Bars", 2, 0, 5, 1);
EnIB = Param("Show Initial Balance", 1, 0, 1, 1);
EnMP = Param("Show Market Profile", 1, 0, 2, 1);

PlotOHLC(O,H,L,C,"Price",colorDarkGreen,styleBar);

BarsInDay = BarsSince(Day() != Ref(Day(), -1));
Bot = TimeFrameGetPrice("L", inDaily, 0);
Top = TimeFrameGetPrice("H", inDaily, 0);
Vol = TimeFrameGetPrice("V", inDaily, 0);
POC = H - H;
VAL = H - H;
VAH = H - H;
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];
if (LAveRange < 1) {Den = 0.05;}
else if (LAveRange < 10) {Den = 0.25;}
else if (LAveRange < 20) {Den = 0.5;}
else if (LAveRange < 100) {Den = 1;}
else if (LAveRange < 500) {Den = 5;}
else {Den = 1;}

// Initialization
baseX = 0;
baseY = floor(Bot[0]/Den)*Den;
relTodayRange = 0;
firstVisBar = Status("firstvisiblebar");
lastVisBar = Status("lastvisiblebar");

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;
    }
  }

  if (EnMP == 2) {
    for (j=0; j<= relTodayRange; j++) {
      if (L[i] <= baseY+j*Den AND H[i] >= baseY+j*Den) {
	PlotText(StrExtract("A,B,C,D,E,F,G,H,I,J,K,L,M,N",
                 BarsInDay[i]), baseX+x[j], baseY+j*Den, colorBlack);
        x[j]++;
      }
    }
  }
  else if (EnMP == 1) {
    for (j=0; j<= relTodayRange; j++) {
      if (L[i] <= baseY+j*Den AND H[i] >= baseY+j*Den) {
	line = LineArray(baseX, baseY+j*Den, baseX+x[j]+1, baseY+j*Den);
	Plot(line,"",ParamColor("Color", colorGold), styleLine+styleDots);
        x[j]++;
      }
    }
  }  

  // Draw Initial Balance after 11am bar is complete
  if (BarsInDay[i] == IBBars+1 AND EnIB == 1) {
    Line1 = LineArray(i-2, curtop[i-1],i+10, curtop[i-1],0,True);
    Plot(Line1,"",colorBlue,styleLine+styleDashed);
    Line1 = LineArray(i-2, curbot[i-1],i+10, curbot[i-1],0,True);
    Plot(Line1,"",colorBlue,styleLine+styleDashed);
  }

  // Examine x[j]
  if ((i < BarCount - 1 AND BarsInDay[i+1] == 0) OR i == BarCount-1) {
    maxXj = 0;
    for (j=0; j<= relTodayRange; j++) {
      if (maxXj < x[j]) {maxXj = x[j]; maxj = j;}
    }
    for (k=i-BarsInDay[i];k<=i;k++) {
      POC[k] = baseY+Maxj*Den;
    }
    Line1 = LineArray(baseX, baseY+maxj*Den, i, baseY+maxj*Den,0,True);
    Plot(Line1,"",colorDarkBlue,styleLine+styleThick);
  }
}

Plot(POC,"POC",colorBlack,styleLine);
_SECTION_END();
 
Thanks Milind for the alf but i m getting the following error while i run scan and backtest in amibroker :-

lastVisBar = Status("lastvisiblebar");



for (j=0; j <= 100; j++) {

x[j]
-----^

Error 10.
Subscript out of range.
You must not access array elements outside 0..(BarCount-1) range.
 

milind

Active Member
I use it only to view chart, not scan/backtest.

Thanks Milind for the alf but i m getting the following error while i run scan and backtest in amibroker :-

lastVisBar = Status("lastvisiblebar");



for (j=0; j <= 100; j++) {

x[j]
-----^

Error 10.
Subscript out of range.
You must not access array elements outside 0..(BarCount-1) range.
 

Similar threads