網(wǎng)站建設qianhaiyouseo是什么職位的簡稱
指標名稱:成交量分布指標
版本:MT4 ver. 1.32
之前發(fā)布的市場分布圖不少朋友反饋不錯,希望獲得其它版本。
這個版本只有MT4的,MT5可以看之前版本,鏈接:
-
“市場分布圖”,精準把握價格動向 +更直觀了解市場 ?MT4/5免費公式!
市場分布圖,也叫成交量分布指標,也有人叫它:訂單流指標,但其實這個和訂單流還是有區(qū)別的,盡管很像。但用法類似,都可以研究研究。
下面,我們來看看市場分布圖第二版本,和之前發(fā)布的市場分布圖類似,但是表現(xiàn)形式不一樣,并且這個版本有兩個版本,其中一個帶箭頭提示。
帶箭頭提示的版本如下:
這兩個版本,我都放在一起,大家慢慢學習研究。
參數(shù):
部分代碼展示:
//+------------------------------------------------------------------+
//| 市場分布圖第二版.mq4 |
//| Copyright ? 2009-2024, www.QChaos.com |
//| https://www.qchaos.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 量化混沌, www.qchaos.com"
#property link "https://www.qchaos.com"
#property version "1.32"#property description "---------------------------------------------"
#property description "EA、指標公式分享"
#property description "EA、指標編寫業(yè)務承接"
#property description "---------------------------------------------"#property description "---------------------------------------------"#property indicator_chart_window#define PRICEIDX 0
#define TPOIDX 1
#define VOLIDX 2//---extern vars
extern int LookBack = 6;
extern bool UseVolumeProfile = true;
extern string ProfileTimeframeInfo = "use D, W, or M";
extern string ProfileTimeframe = "D";
extern int DayStartHour = 0;
extern double VATPOPercent = 70.0;
extern int TickSize = 1;
extern int ExtendedPocLines = 5;extern string spr0 = "on/off settings..";
extern bool ShowPriceHistogram = true;
extern bool ShowValueArea = true;
extern bool ShowVAHVALLines = true;
extern bool ShowOpenCloseArrow = true;extern string spr1 = "design & colors..";
extern double VolAmplitudePercent = 40.0;
extern int HistoHeight = 2;
extern color HistoColor1 = C'55,100,135';
extern color HistoColor2 = C'45,90,125';
extern color OpenColor = DarkGreen;
extern color CloseColor = Peru;
extern color POCColor = Peru;
extern color VirginPOCColor = Yellow;
extern color VAColor = C'16,16,16';
extern color VALinesColor = C'64,64,64';
extern color InfoColor = Lime;extern string spr2 = "Profile Data.............";
extern int DailyProfileDataTf = 30;
extern int WeeklyProfileDataTf = 60;
extern int MonthlyProfileDataTf = 240;//---global vars
string gsPref = "qc.mp.";
double fpoint, gdOneTick, gdHistoRange;
int fdigits, giStep, giProfileTf = PERIOD_D1, giDataTf = 0;//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{ giDataTf = Period(); //defaultif (Point == 0.001 || Point == 0.00001) { fpoint = Point*10; fdigits = Digits - 1; }else { fpoint = Point; fdigits = Digits; } if (ProfileTimeframe == "M" ) {gsPref = gsPref + "2_0_" + ProfileTimeframe + "_"; giProfileTf = PERIOD_MN1; HistoHeight = MathMax(HistoHeight, 8);giDataTf = MonthlyProfileDataTf;} else if (ProfileTimeframe == "W" ){gsPref = gsPref + "3_0_" + ProfileTimeframe + "_"; giProfileTf = PERIOD_W1; HistoHeight = MathMax(HistoHeight, 3);giDataTf = WeeklyProfileDataTf;}else //default D1{gsPref = gsPref + "4_0_" + ProfileTimeframe + "_"; giProfileTf = PERIOD_D1;HistoHeight = MathMax(HistoHeight, 1);giDataTf = DailyProfileDataTf;}//----HistoHeight = MathMax(HistoHeight, TickSize);gdOneTick = TickSize/(MathPow(10,fdigits));gdHistoRange = HistoHeight/(MathPow(10,fdigits)); giStep = HistoHeight;return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{delObjs();return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{if ( !isOK() ) return(0);LookBack = MathMin( LookBack, iBarShift(NULL, giProfileTf, Time[Bars-1]) - 1 );LookBack = MathMin( LookBack, iBarShift(NULL, giProfileTf, iTime(NULL, giDataTf, iBars(NULL, giDataTf) - 1)) );int ibarproftf = 0, endbarproftf = 0; //---create all profile on startup/new tfsrc bar//---and then only update the last tfsrc profileif ( newBarProfileTf() ) { delObjs(); endbarproftf = LookBack-1; } double apricestep[][3] // [ 3-->{price, count tpo, count vol} ], hh, ll // profile, maxvol, vah // Value Area High, val // Value Area Low, totaltpo // Total TPO, totalvol; // Total Voldatetime dtproftf;int startbar // startbar on giDataTf, endbar // endbar on giDataTf, countps, vahidx, validx , maxtpo, maxtpoidx, maxvolidx; //---main loop --> day by day, week by week, month by month... for (ibarproftf = endbarproftf; ibarproftf >= 0; ibarproftf--) {ArrayResize(apricestep, 0);getStartAndEndBar(ibarproftf, startbar, endbar); if (startbar == -1) continue;getHHLL(startbar, endbar, hh, ll);getPriceTPO ( startbar, endbar, hh, ll, apricestep, countps, maxtpo, maxtpoidx, totaltpo, maxvol, maxvolidx, totalvol ); //continue; drawPriceHistoAndPOCLines ( startbar, endbar, ibarproftf, countps, apricestep, maxtpo, maxtpoidx, maxvol, maxvolidx );//continue;getValueArea ( countps, apricestep, maxtpo, maxtpoidx, totaltpo, maxvol, maxvolidx, totalvol, vah, vahidx, val, validx ); //continue;drawValueArea ( startbar, endbar, ibarproftf, countps, apricestep, vah, vahidx, val, validx );}//end for (ibartf = endbartf; ibartf >= 0; ibartf--) //update time ExtendedPocLines if (newBar()) {for (int i=1; i<=ExtendedPocLines; i++){ObjectSet(gsPref + "#" + i +".1.1.poc", OBJPROP_TIME2, Time[0] + 10*Period()*60 ); ObjectSet(gsPref + "#" + i +".1.0.poc.price", OBJPROP_TIME1, Time[0] + 13*Period()*60 );} }