Volume POC in signal

Questions about MultiCharts and user contributed studies.
monexx
Posts: 87
Joined: 20 Feb 2014
Has thanked: 26 times
Been thanked: 7 times

Volume POC in signal

Postby monexx » 10 Apr 2014

Hello,
does anyone know how to create a signal example:
high of bar crosses VPOC?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Volume POC in signal

Postby Andrew MultiCharts » 10 Apr 2014

Hello monexx,

If you are referring to the POC level displayed in prebuilt Volume Profile tool in MultiCharts, such script could be created only in MultiCharts .NET, regular MC with EasyLanguage/PowerLanguage cannot access the data used for Volume Profile/Volume Delta/Cumulative Delta.

Unfortunately we don't have any examples for MC .NET that would help you to reach your goal, though we could develop it for you on paid basis. Drop us an email to support@multicharts.com if you are interested.

monexx
Posts: 87
Joined: 20 Feb 2014
Has thanked: 26 times
Been thanked: 7 times

Re: Volume POC in signal

Postby monexx » 11 Apr 2014

Hello monexx,

If you are referring to the POC level displayed in prebuilt Volume Profile tool in MultiCharts, such script could be created only in MultiCharts .NET, regular MC with EasyLanguage/PowerLanguage cannot access the data used for Volume Profile/Volume Delta/Cumulative Delta.

Unfortunately we don't have any examples for MC .NET that would help you to reach your goal, though we could develop it for you on paid basis. Drop us an email to support@multicharts.com if you are interested.

Thank you for the offer but so far I think in the dimension of EasyLanguage.
It's a shame that such a possibility is not in EasyLanguage.

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: Volume POC in signal

Postby MAtricks » 15 Apr 2014

There are tools out there. Check the "other EL forum" :)

monexx
Posts: 87
Joined: 20 Feb 2014
Has thanked: 26 times
Been thanked: 7 times

Re: Volume POC in signal

Postby monexx » 16 Apr 2014

I found POC function but could not do that compile: :-)

// function: POC
//
// http://www.tradersxchange.com


vars: PriceBin(.50),
TimeBin(0),
Unit4Accum(0),
TypAccum(0),
BegTime1(0),
BegTime2(0),
BegTime3(0),
DoHoriz(True),
Perc4VA(70),
LineSize(1);
{Begin Comment Out for Signal}

vars:
PointRight(True),{If set false then display will point to left }

Smooth(00), {Angle adjustment for VA projection--range -2>+2 }

BegDate(0);{Date on which to start analysis. 0=All }
{this is used to limit the number of analyses that are }
{made and may be necessary -- particularly in TS7/8... }
{to keep "infinite loop" error from occurring. }



{must replace Vars: with in the word INPUT: here for an indicator}

vars:
OnlyLast(true), {Annotate last caclulated values ONLY--AnotHLCP=True also}

AnotHLCP(true), {Annotate the VAHigh, VALow, and CP values on chart }

OnlyHist(false), {Do not make MP for current day until next day. }

DoChan(False), {Draw a channel from VA extremes to next set of extremes }

PlotOpen(True); {Plot open of current analysis -- green dotted line }


Vars: OpenOfDay(0), Is24Hour(Sess1EndTime<=Un ionSess1StartTime),
LowBox(0), DateKnt(0), HKnt(0),
ATR21(AvgTrueRange(21)),
Bin4Price(Iff(PriceBin>AT R21/20,ATR21/20,Iff(PriceBin<ATR21/50,ATR21/50,PriceBin))),
LowValue(LowBox*Bin4Price ), IPass(0),
Bin4Time(AbsValue(IntPort ion(TimeBin))),
ShiftIt((AbsValue(TimeBin )-Bin4Time)*100),
HighValue(H),TotalKnt(0),
HoldBar(CurrentBar), HoldAdd(0), OldHoldBar(0), KeepBar(0);
Vars: TimeBeg1(Iff(BegTime1<25, IntPortion(BegTime1)*100+ FracPortion(BegTime1)*60, BegTime1)),
TimeBeg2(Iff(BegTime2<25, IntPortion(BegTime2)*100+ FracPortion(BegTime2)*60, BegTime2)),
TimeBeg3(Iff(BegTime3<25, IntPortion(BegTime3)*100+ FracPortion(BegTime3)*60, BegTime3));
Vars: VAHigh(0), VALow(0), MaxValue(0), MaxIndex(0), SumValue(0);
Vars: VAHighValue(h), VALowValue(l),VAPivot(c),
VAPerc(Iff(Perc4VA>0,Perc 4VA/100,.7)),
CurrentMin(TimeToMinutes( time)), EntryP(0);
Vars: VAHighOld(0), VAHighNew(0),
VALowOld(0), VALowNew(0),
VABarOld(0), VABarNew(0),
VADateOld(0), VADateNew(0),
VATimeOld(0), VATimeNew(0),
DnCount(0), UpCount(0), LBOC(FALSE), NewDate(0),
HandlHi(-1), HandlLo(-1), HandlCP(-1),
CanBuy(false),CanSell(fal se),DoInit(True);

{Begin comment out for Indicator
Vars: LossMaxPts(LossMax/BigPointValue),
TakProfPts(TakProf/BigPointValue);
End comment out for Indicator}

Vars: ATR21Val(0), MP(0),
StopHH(0), StopLL(0), EnterBar(0),
MaxCont(0), NCont(0), HoldDate(Date-1);
Vars: PDPtrn(0);


Vars: MaxKnt(15000), Direct(0), DoKnt(0);
Arrays: PriceKnt[15000](0), HoldKnt[15000](0), Handl[15000](0);


If DoInit then begin
DoInit=False;
Value1=AvgTrueRange(21)/10;
If PriceBin=0 then Bin4Price=Value1
else Bin4Price=PriceBin;

LowBox = Round(L/Bin4Price,0);
End;

LBOC = LastBarOnChart;
If Date<>Date[1] and TimeBin=0 then NewDate=Date;


{For system remove I_}
If MP<>MP[1] then begin
EntryP=O;
EnterBar=CurrentBar;
StopHH=H;
StopLL=L;
End;

If Date>=BegDate then begin



If (TimeBin>0 and Unit4Accum>0) then begin
Condition1=false;
Condition3=false;
If Unit4Accum=1 then If Date[ShiftIt]<>Date[ShiftIt+1] then DoKnt=DoKnt+1;
If Unit4Accum=2 then If DayOfWeek(date[ShiftIt])<DayOfWeek(Date[ShiftIt+1]) then DoKnt=DoKnt+1;
If Unit4Accum=3 then If Month(Date) <>Month(Date[1]) then DoKnt=DoKnt+1;
If Unit4Accum=4 then begin
For Value1 = 0 to 3 begin
Value2=Value1*3+1;
If Month(Date)=Value2 and Month(Date[1])<>Value2 then DoKnt=DoKnt+1;
End;
End;
If Unit4Accum=5 then begin
DoKnt=0;

Value0=AbsValue(IntPortio n(Direct));
If Sign(Direct)<>Sign(Direct[1]) or LBOC then begin
Condition1=True;
Condition3=Condition1;
If Direct[1]=0 then begin
HoldBar=CurrentBar-Value0;
HoldAdd=HoldBar-OldHoldBar;
End
Else begin
If LBOC and Sign(Direct)=Sign(Direct[1]) then begin
If LBOC[1]=FALSE THEN OldHoldBar=HoldBar;
HoldBar=CurrentBar;
Value0=0;
End
Else begin
OldHoldBar=HoldBar;
HoldBar=CurrentBar-Value0;
End;

Value2=Highest(H[Value0],HoldBar-OldHoldBar+1);
Value3=Lowest (L[Value0],HoldBar-OldHoldBar+1);
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
HoldAdd=HoldBar-OldHoldBar;
LowBox =0;
While TotalKnt<8 begin
Bin4Price=Bin4Price/2;
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
LowBox =0;
End;
For Value1 = LowBox to TotalKnt begin
Value3=Value1 * Bin4Price + LowValue;
PriceKnt[Value1]=0;
For Value4 = CurrentBar-HoldBar to CurrentBar-OldHoldBar+1 begin
If Value3<=H[Value4] and Value3>=L[Value4] then PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
End;
End;
End;
End;
If DoKnt>=TimeBin then begin
Condition1=True;
Condition3=Condition1;
DoKnt=0;
End;
End
Else begin
Condition1=false;
Condition3=false;
If TimeBin>0 then begin
If TimeBeg1=0
then CurrentMin=TimeToMinutes( time)-TimeToMinutes(Sess1FirstB arTime)
else CurrentMin=TimeToMinutes( time)-TimeToMinutes(TimeBeg1);
If CurrentMin<0 then CurrentMin=CurrentMin+Tim eToMinutes(2359)+1;
If CurrentMin<0 then CurrentMin=CurrentMin+24* 60;
Condition1=Mod(CurrentMin ,TimeBin)<Mod(CurrentMin[1],TimeBin);
Condition3=Condition1;
End
Else begin
If TimeBin<0 then begin
If ShiftIt>Bin4Time then ShiftIt=Mod(ShiftIt,Bin4T ime);
Condition1=Mod(CurrentBar-ShiftIt,Bin4Time)=0;
Condition3=Condition1;
End
Else begin
If DataCompression>1 then begin
If ShiftIt>13 then ShiftIt=0;
Condition1=Mod(CurrentBar-ShiftIt,13)=0;
Condition3=Condition1;
End
Else Begin
Condition9=(Date<>Date[1] and Is24Hour=False) or (Is24Hour and Time>=Sess1StartTime and Time[1]<=Sess1EndTime);
If TimeBeg1>0 then if Time>=TimeBeg1 and (Time[1]<TimeBeg1 or Condition9) and TimeBin=0 then Condition1=True;
If TimeBeg2>0 then if Time>=TimeBeg2 and Time[1]<TimeBeg2 and TimeBin=0 then Condition1=True;
If TimeBeg3>0 then if Time>=TimeBeg3 and Time[1]<TimeBeg3 and TimeBin=0 then Condition1=True;
If TimeBeg1=0 then if TimeBin=0 and Condition9 or (LBOC and time>=Addtime(Sess1EndTim e,-5)) then Condition1=True;
Condition3=Condition1;
End;
End;
End;
End;
If LBOC=True and CurrentBar<>KeepBar and (OnlyHist=False or Time=Sess1EndTime) or TimeBin>9998 then Condition1=True;

If Condition1 then begin

If Condition1 or CurrentBar=1 then begin
CanBuy=True;
CanSell=True;
DateKnt=DateKnt+1;
If LBOC=False or Condition3 then OpenOfDay=Open;
End;

If LBOC=True and LBOC[1]=False and Unit4Accum<>5 then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;

If TotalKnt>1 and DateKnt>1 then begin
MaxValue=-99999;
SumValue=0;
{Find the max value and sum up the price occupancies}
Value99=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If Value4>0 then Value99=Value1;
SumValue=SumValue+Value4;
If Value4>=MaxValue then begin
MaxIndex=Value1;
MaxValue=Value4;
End;
End;
{Find all alike and setup CP at middle}
Value2=0;
For Value1=0 to TotalKnt begin
If PriceKnt[Value1]=MaxValue then Value2=Value2+1;
End;
If Value2>1 then MaxIndex=MaxIndex-IntPortion(Value2/2);

{Now find the Value Area (70% of total counts)}
VAHigh=MaxIndex;
VALow =MaxIndex;
Value9=PriceKnt[MaxIndex];
Value10=0;
While Value9<=IntPortion(SumVal ue*VAPerc) begin
Value10=Value10+1;
If MaxIndex-Value10>=0 and Value9<=IntPortion(SumVal ue*VAPerc) then begin
VALow =MaxIndex-Value10;
Value9=Value9+PriceKnt[VALow];
End;
If Value10+MaxIndex<=Value99 and Value9<=IntPortion(SumVal ue*VAPerc) then begin
VAHigh=MaxIndex+Value10;
Value9=Value9+PriceKnt[VAHigh];
End;
End;

VAHighValue=LowValue+VAHi gh *Bin4Price;
VALowValue =LowValue+VALow *Bin4Price;
VAPivot =LowValue+MaxIndex*Bin4Pr ice;
Value1=0;
VAHighOld=VAHighNew; VAHighNew=VAHighValue[Value1];
VALowOld=VALowNew; VALowNew=VALowValue[Value1];
VADateOld=VADateNew; VADateNew=Date[Value1];
VATimeOld=VATimeNew; VATimeNew=Time[Value1];
VABarOld=VABarNew; VABarNew=CurrentBar;

If TotalKnt>0 then PDPtrn=MaxIndex/TotalKnt
else PDPtrn=0;
PDPtrn=Round(PDPtrn*4,0);

If DateKnt>2 then begin

Value2=LowValue;
If PointRight then Value6=CurrentBar-HoldBar+HoldAdd
else Value6=HoldAdd;

{Now plot the data and highlight VA}
If DateKnt>3 then begin

If LBOC then begin
for Value1=0 to TotalKnt begin
If Handl[Value1]<>0 then begin
TL_Delete(Handl[Value1]);
Handl[Value1]=0;
End;
End;
End;


HKnt=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If PointRight then If HoldBar-HoldAdd+Value4>CurrentBar then Value4=Value6;
If Value4>0 and Value5<MaxKnt then begin
If DoHoriz then begin
{Value2=(LowBox+Value1)*B in4Price;}
If PointRight
Then Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6-Value4],time[Value6-Value4],Value2)
Else Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6+Value4],time[Value6+Value4],Value2);
Value7=Blue;
If LBOC then Handl[Value1]=Value5;
If Value1<VALow then value7=red;
If Value1>VAHigh then value7=yellow;
If Value1=MaxIndex then value7=Red;
Value7=TL_SetAll(Value5, Value7, LineSize, 3, False, false);
End;
If AnotHLCP then begin
If (OnlyLast and LBOC) or (OnlyLast=False) or (OnlyHIst) then begin
If PointRight then Value30=-Value4 else Value30=0;
If Value1=VALow then begin
If HandlLo>=0 then Text_Delete(HandlLo);
HandlLo=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlLo,0,2 );
End;
If Value1=VAHigh then begin
If HandlHi>=0 then Text_Delete(HandlHi);
HandlHi=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlHi,0,2 );
End;
If Value1=MaxIndex then begin
If HandlCP>=0 then Text_Delete(HandlCP);
HandlCP=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )+"--"+NumToStr(PDPtrn,0)) ;
Text_SetStyle(HandlCP,0,2 );
End;
End;
End;
End;
Value2=Value2+Bin4Price;
End;

If DoChan and Value5<4500 then begin
Value3=TL_NEW(VADateOld,V ATimeOld,VAHighOld,VADate New,VATimeNew,VAHighNew);
Value4=TL_NEW(VADateOld,V ATimeOld,VALowOld, VADateNew,VATimeNew,VALow New);
Value7=TL_SetAll(Value3, blue, LineSize, 3, False, false);
Value7=TL_SetAll(Value4, red , LineSize, 3, False, false);
End;
End;


Condition5=True;
If TimeBin<>0 then begin
If (TypAccum>210000 and Date[1]=TypAccum) then Condition5=False;
If (TypAccum=-2 and Date[1]=CurrentDate) then Condition5=False;
If (TypAccum=-1 and Time<>Sess1StartTime+BarI nterval) then Condition5=False;
End;
If LBOC=False then begin
If Condition5 then begin
For Value1=0 to 2000 begin
PriceKnt[Value1]=0;
End;
TotalKnt=0;
LowBox =Round(Low/Bin4Price,0);
LowValue=LowBox*Bin4Price ;
End;
If Unit4Accum<>5 then HoldBar =CurrentBar;
IPASS=Time;
End;
End;
End;
If LBOC then KeepBar=CurrentBar;
End;

If DateKnt>1 then begin

If DateKnt>3 and VAHighValue<>0 and VALowValue<>0 then begin

If Smooth=0 then begin
Value17=VAHighNew;
Value18=VALowNew;
End
Else begin
If Condition1 then begin
Value15=(VAHighNew-VAHighOld+VALowNew-VALowOld)*0.5/(VABarNew-VABarOld);
Value19=.5/(VABarNew-VABarOld);
End;
Value14=(CurrentBar-VABarNew);
Value16=Value15*Value14*S mooth*(1-Value14*Value19);
Value17=VAHighNew+Value16 ;
Value18=VALowNew +Value16;
End;


{Remove right brace for SIGNAL -- add for INDICATOR}
If LBOC then begin
Value2=-MaxBarsForward;
Value3=-1;
{If KeepBar=0 then OpenOfDay=C;}
If Smooth=0 then begin


End;
End
else begin
Value27=Value17;
Value28=Value18;
Value29=VAPivot;
Value2=0;
Value3=0;
If Unit4Accum=5 then Value3=Value6;
End;



End;
If HandlHi>-1 then begin
Text_SetLocation(HandlHi, Date,Time,Value17);
Text_SetLocation(HandlCP, Date,Time,VAPivot{Value29 });
Text_SetLocation(HandlLo, Date,Time,Value18);
End;

End;

End;



If Condition3 and (OnlyLast=False) then begin
HandlHi=(-1); HandlLo=(-1); HandlCP=(-1);
End;

If DateKnt>1 and (LBOC=False or LBOC[1]=True) then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;



{end date loop}




poc=vapivot;

tekram
Posts: 96
Joined: 26 May 2009
Has thanked: 6 times
Been thanked: 18 times

Re: Volume POC in signal

Postby tekram » 17 Apr 2014

I found POC function but could not do that compile: :-)
Just import the ELD from the original source. It runs ok in TS but it won't display properly in MC, although the POC function should still work. Someone who likes to play with MC trendlines can try to fix it for MC.
http://www.traderslaboratory.com/forums ... eld-6.html

BTW, VP (volume) is not MP. The distribution is distinctly different; VP is tick base and MP is time base. The attached picture compares the +MarketProfile indicator (from the above eld) to VP by Solidus under TS 9.0. The Solidus indicator is OOEL and runs only under TS 9.0 and above.
MP_traderlabo_3109_TL_setall_%2BMARKETPROFILE.ELD
(26.83 KiB) Downloaded 644 times
Image
Attachments
SolidusPVHvspMarketProfile.gif
(30.81 KiB) Downloaded 1297 times

monexx
Posts: 87
Joined: 20 Feb 2014
Has thanked: 26 times
Been thanked: 7 times

Re: Volume POC in signal

Postby monexx » 24 Apr 2014

I found POC function but could not do that compile: :-)
Just import the ELD from the original source. It runs ok in TS but it won't display properly in MC, although the POC function should still work. Someone who likes to play with MC trendlines can try to fix it for MC.
http://www.traderslaboratory.com/forums ... eld-6.html

BTW, VP (volume) is not MP. The distribution is distinctly different; VP is tick base and MP is time base. The attached picture compares the +MarketProfile indicator (from the above eld) to VP by Solidus under TS 9.0. The Solidus indicator is OOEL and runs only under TS 9.0 and above.
MP_traderlabo_3109_TL_setall_%2BMARKETPROFILE.ELD
Image
Of course you're right :-)

monexx
Posts: 87
Joined: 20 Feb 2014
Has thanked: 26 times
Been thanked: 7 times

Re: Volume POC in signal

Postby monexx » 29 May 2014

Hello,
Does anyone fix this code so that it can be displayed on the chart?

Code: Select all

// VPOC



Input:
Style(3), POClineColor(white),
ColorPOC(yellow), ATRlength(10),
ShowPOCs(True),
MPDate(currentdate);


Var:
TodaysPOCTL(0),
back(0),
InputStyle(0),
UpperLimit(300),
PtrOffset(0),
PricePlot(0),
HighestToday(0),
Flag(0),
Ptr(0),
POC(0),
POCptr(0),
POCValue(0),
Adjust(0);

If Style>0 and Style<1 then InputStyle=Style else InputStyle=3;


Array:
MP[301](0);



If date<>date[1] then begin
If TodaysPOCTL<>0 then value8=TL_delete(TodaysPOCTL);
TodaysPOCTL=0;
For value1 = 0 to UpperLimit-1 begin
MP[value1]=0;

End;
value4=open;
If value4*2<>intportion(value4*2) then value4=value4+.25;
PtrOffset=value4-(UpperLimit/4);
HighestToday=0;
end;

Value3=low;
If value3*2<>intportion(value3*2) then value3=value3+.25;
While value3>=low and value3<=high begin
Value2=intportion((Value3-PtrOffset)*2);

If value2>0 and value2<UpperLimit then begin
MP[Value2]=MP[Value2]+1;
{Show MP if required}
If MPDate=date or MPDate=0 then begin
end;
If MP[Value2]>HighestToday then BEgin
HighestToday=MP[Value2];
POCValue=value3;

end;

end;

value3=value3+0.5;
end;


If time=sess1EndTime and date<> currentdate then begin
If ( date=JulianToDate(DateToJulian(currentdate)-1)) or ((dayofweek(currentdate)=Monday and date=JulianToDate(DateToJulian(currentdate)-3)) )
then TL_SetStyle(value8, 1) else value7=TL_SetStyle(value8, InputStyle);
plot12(pocvalue);

end;

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: Volume POC in signal

Postby bomberone1 » 29 Jul 2022

It is not working.
NOT SOLVED

I have found this:

https://www.abctradinggroup.com/portfol ... indicator/


Return to “MultiCharts”