![Afbeelding](https://www.tradestation.com/Discussions/DATA/2003109222847_MidPoint_Pivots.jpg)
in bovenstaande grafiek zien we een intraday chart die aan de hand van de vorige dag ( Open, High, Low, Close ) pivotpoints berekent ?n automatisch toevoegd in de intraday chart.
dat is net wat handiger dan het manueel toevoegen van de horizontale lijnen
![Laughing :lol:](./images/smilies/icon_lol.gif)
is er iemand die deze EL-code werkend krijgt in vesticode?
hier alvast de code :
=====================================
{
midPoint_Pivots
Floor Pivots including all the Mid-Points
written by
deMicron (Oct. 09, 2003)
{R3,R2R3,R2,R1R2,R1,PPR1,PP,R1S1,PPS1,S1,S1S2,S2,S2S3,S3}
}
{
PivotType = 1 [PP = (YesterdaysHigh + YesterdaysLow + YesterdaysOpen) / 3]
PivotType = 2 [PP = (YesterdaysHigh + YesterdaysLow + (TodaysOpen x 2)) / 4]
R1 = (PP x 2) - YesterdaysLow
S1 = (PP x 2) - YesterdaysHigh
R2 = PP + R1 - S1
S2 = PP - R1 + S1
R3 = PP + R2 - S2
S3 = PP - R2 + S2
}
Inputs:
PivotType(1), {PivotsType:1, Standard, PivotType: 2: Woodies}
PivotLinecolor(DarkBlue),
PivotStyle(Tool_Dotted),
PivotTextColor(Blue);
Variables:
PP(0),
R1(0), R2(0), R3(0), R1R2(0), R2R3(0),
S1(0), S2(0), S3(0), S1S2(0), S2S3(0),
PPR1(0), PPS1(0), R1S1(0),
CTIME(0), maxpts(14); {14 levels of Pivots}
Variables: count(0);
Arrays: PivotLevel[14](0),
LineID[14](0),
TEXTID[14](0),
TextSTR[14]("");
CTIME = SessionEndTime(1,3);
If ((Date <> Date[1])) then
{and (BarType < 2)) then}
Begin
If (PivotType = 2) then
PP = (CloseD(1) + LowD(1) + 2*LowD(1)) / 4
else
PP = (HighD(1) + LowD(1) + CloseD(1)) / 3;
R1 = 2*PP - LowD(1);
S1 = 2*PP - HighD(1);
R2 = PP - S1 + R1;
S2 = PP - R1 + S1;
R3 = PP - S2 + R2;
S3 = PP - R2 + S2;
{Mid Points}
PPR1 = (PP+R1)/2;
R1R2 = (R1+R2)/2;
R2R3 = (R2+R3)/2;
PPS1 = (PP+S1)/2;
S1S2 = (S1+S2)/2;
S2S3 = (S2+S3)/2;
R1S1 = (R1+S1)/2;
PivotLevel[1] = R3;
PivotLevel[2] = R2R3;
PivotLevel[3] = R2;
PivotLevel[4] = R1R2;
PivotLevel[5] = R1;
PivotLevel[6] = PPR1;
PivotLevel[7] = PP;
PivotLevel[8] = R1S1;
PivotLevel[9] = PPS1;
PivotLevel[10] = S1;
PivotLevel[11] = S1S2;
PivotLevel[12] = S2;
PivotLevel[13] = S2S3;
PivotLevel[14] = S3;
TEXTSTR[1] = "R3";
TEXTSTR[2] = "R2R3";
TEXTSTR[3] = "R2";
TEXTSTR[4] = "R1R2";
TEXTSTR[5] = "R1";
TEXTSTR[6] = "PPR1";
TEXTSTR[7] = "PP";
TEXTSTR[8]= "R1S1";
TEXTSTR[9] = "PPS1";
TEXTSTR[10] = "S1";
TEXTSTR[11] = "S1S2";
TEXTSTR[12] = "S2";
TEXTSTR[13] = "S2S3";
TEXTSTR[14] = "S3";
For Count = 1 to maxpts
Begin
LineID[Count] = TL_New( Date, Time, PivotLevel[count], Date, CTime, PivotLevel[count]);
if (count = 7) then {ACTUAL PIVOT}
begin
TL_SetColor(LineID[Count], RED);
TL_SetStyle(LineID[Count], TOOL_DASHED);
end
else
begin
TL_SetColor(LineID[Count], PivotLineColor );
TL_SetStyle(LineID[Count], PivotStyle);
end;
IF DATE = CURRENTDATE THEN
TL_SetExtRight(LineID[Count], true );
{ TextID[Count] = Text_New(Date, CurrentTime, PivotLevel[Count],TEXTSTR[count]+ ":"+"("+NumToStr(PivotLevel[Count], 2 )+")");}
TextID[Count] = Text_New(Date, Time, PivotLevel[Count],TEXTSTR[count]+ ":"+ NumToStr(PivotLevel[Count],2));
Text_SetStyle(TextID[Count], 1, 1 );
Text_SetColor(TextID[Count], PivotTextColor );
End;
End;
Bedankt
Predictor Stick