Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi G
Here's an indicator that should do what you want. I've added Mean Price and Weighted Close to the Typical Price that you asked for. The default time frame is set to quarterly (3 months), but the indicator can also plot daily, weekly, fortnightly, or 1, 2, 4, 6 or 12 monthly time frames. You will need the Forum DLL; it's available from this website, is 188KB in size and will need renaming as "Forum.dll" (unless you choose to change my indicator to match the name of the download). Making a copy and renaming it seems to me to be the best way to go.
The timing module has been deleted as it is proprietary code and not available in the public domain. Nevertheless I will get the complete formula to you as soon as I have an assurance that you will not disclose the timing module to anyone. You can email me at rlarsen@quik.co.nz.
Roy
{Multi-Frame D+ Pivot}
{Uses Equis Forum DLL}
{Roy Larsen, 2015, 23/2/15}
{User settings}
N:=Input("Multi-Frame D+ Pivot Price",0,0,0);
R:=Input("Price, 1=Mean 2=Typical 3=Weighted Close",1,3,2);
J:=Input("Months/Frame, 0=Weekly 5=Bi-weekly 10=Daily",0,12,0);
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1);
G:=Input("End-of-Frame Offset in Days, 0-13",0,13,0);
{D+ Timing}
{This section of code has been deleted}
{Frame prices (H, L and C)}
B:=HighestSince(1,M+(Z=1),H);
Y:=LowestSince(1,M+(Z=1),L);
B:=ValueWhen(1,J,If(J=1,B,ValueWhen(2-G,1,B)));
Y:=ValueWhen(1,J,If(J=1,Y,ValueWhen(2-G,1,Y)));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
{Calculate/plot Pivot Price}
U:=(B+Y)/2; { Mean }
X:=(B+Y+K)/3; { Typical }
Z:=(B+Y+2*K)/4; { Weighted }
If(R=1,U,If(R=2,X,Z));
{end}
|