NexusFi: Find Your Edge


Home Menu

 





Pivot Lines


Discussion in MultiCharts

Updated
    1. trending_up 1,051 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 1 attachments




 
Search this Thread

Pivot Lines

  #1 (permalink)
flerte
São Borja/RS/Brasil
 
Posts: 1 since Oct 2017
Thanks Given: 0
Thanks Received: 0

Dear, could anyone help?

I am a beginner and I can not hit the formula, the PPivot bars do not follow when prices move to the right. They stay static without moving.


Code:


Inputs:
StartCalcTime (0000),
EndCalcTime (2359),
PlaceTextRight (true),
PlotatDateChange (true),
PlotToDateEnd (true),
IgnoreWeekends (true),
TLSize (1),
TLStyle (1),
PivColor (yellow),
R1Color (red),
R2Color (red),
R3Color (red),
S1Color (green),
S2Color (green),
S3Color (green);

Variables:
Monday2Friday (false),
RR1 (0),
RR2 (0),
RR3 (0),
SS1 (0),
SS2 (0),
SS3 (0),
PP (0),
RR1TL (0),
RR2TL (0),
RR3TL (0),
SS1TL (0),
SS2TL (0),
SS3TL (0),
PPTL (0),
DayHi (-999999),
DayLo (+999999),
HaveTLs (false),
StartTime (0),
EndTime (0),
R1Txt (0),
R2Txt (0),
R3Txt (0),
S1Txt (0),
S2Txt (0),
S3Txt (0),
PPTxt (0),
SessClose (0),
TextStyleHoriz (1), //0: To the right of the bar specified for the text object
//1: To the left of the bar specified for the text object
//2: Centered on the bar specified for the text object
TextStyleVert (2); //0: Beneath the price specified for the text object
//1: Above the price specified for the text object
//2: Centered on the specified price location of the text object
if BarType <= 1 or BarType >= 5 then
begin

If IgnoreWeekends then begin
If DayOfWeek(Date) >= Monday and DayOfWeek(Date) <= Friday then
Monday2Friday = true
else
Monday2Friday = false;
end
else begin
Monday2Friday = true;
end;
´
If Monday2Friday then begin

If Date <> Date[1] then begin
If PlaceTextRight then
TextStyleVert = 1;

If PlotatDateChange then
StartTime = Time
else
StartTime = StartCalcTime;

EndTime = Time[1];

PP = (DayHi + DayLo + SessClose[1])/3 ;
RR1 = PP * 2 - DayLo;
RR2 = PP + DayHi - DayLo;
RR3 = RR2 + DayHi - DayLo;
SS1 = PP * 2 - DayHi;
SS2 = PP - DayHi + DayLo;
SS3 = SS2 - DayHi + DayLo;

DayHi = -999999;
DayLo = +999999;
HaveTLs = false;

end; //If Date <> Date[1] then begin...

If Time > StartCalcTime and Time <= EndCalcTime then begin
If High >= DayHi then DayHi = High;
If Low <= DayLo then DayLo = Low;
If BarStatus(1) = 2 then
SessClose = Close;
end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...

If HaveTLs = false then begin
HaveTLs = true;

RR1TL = TL_New(Date, StartTime, RR1, Date, EndTime, RR1);
TL_SetColor(RR1TL, R1Color);
TL_SetSize(RR1TL, TLSize);
TL_SetStyle(RR1TL, TLStyle);

RR2TL = TL_New(Date, StartTime, RR2, Date, EndTime, RR2);
TL_SetColor(RR2TL, R2Color);
TL_SetSize(RR2TL, TLSize);
TL_SetStyle(RR2TL, TLStyle);

RR3TL = TL_New(Date, StartTime, RR3, Date, EndTime, RR3);
TL_SetColor(RR3TL, R3Color);
TL_SetSize(RR3TL, TLSize);
TL_SetStyle(RR3TL, TLStyle);

SS1TL = TL_New(Date, StartTime, SS1, Date, EndTime, SS1);
TL_SetColor(SS1TL, S1Color);
TL_SetSize(SS1TL, TLSize);
TL_SetStyle(SS1TL, TLStyle);

SS2TL = TL_New(Date, StartTime, SS2, Date, EndTime, SS2);
TL_SetColor(SS2TL, S2Color);
TL_SetSize(SS2TL, TLSize);
TL_SetStyle(SS2TL, TLStyle);

SS3TL = TL_New(Date, StartTime, SS3, Date, EndTime, SS3);
TL_SetColor(SS3TL, S3Color);
TL_SetSize(SS3TL, TLSize);
TL_SetStyle(SS3TL, TLStyle);

PPTL = TL_New(Date, StartTime, PP, Date, EndTime, PP);
TL_SetColor(PPTL, PivColor);
TL_SetSize(PPTL, TLSize);
TL_SetStyle(PPTL, TLStyle);

R1Txt = Text_New(Date, StartTime, RR1, "R1");
Text_SetStyle(R1Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(R1Txt, R1Color);

R2Txt = Text_New(Date, StartTime, RR2, "R2");
Text_SetStyle(R2Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(R2Txt, R2Color);

R3Txt = Text_New(Date, StartTime, RR3, "R3");
Text_SetStyle(R3Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(R3Txt, R3Color);

S1Txt = Text_New(Date, StartTime, SS1, "S1");
Text_SetStyle(S1Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(S1Txt, S1Color);

S2Txt = Text_New(Date, StartTime, SS2, "S2");
Text_SetStyle(S2Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(S2Txt, S2Color);

S3Txt = Text_New(Date, StartTime, SS3, "S3");
Text_SetStyle(S3Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(S3Txt, S3Color);

PPTxt = Text_New(Date, StartTime, PP, "PP");
Text_SetStyle(PPTxt, TextStyleHoriz, TextStyleVert);
Text_SetColor(PPTxt, PivColor);
end //If HaveTLs = false then begin...
else begin
If PlotToDateEnd then
EndTime = EndTime
else
EndTime = EndCalcTime;

TL_SetEnd(RR1TL, Date, EndTime, RR1);
TL_SetEnd(RR2TL, Date, EndTime, RR2);
TL_SetEnd(RR3TL, Date, EndTime, RR3);
TL_SetEnd(SS1TL, Date, EndTime, SS1);
TL_SetEnd(SS2TL, Date, EndTime, SS2);
TL_SetEnd(SS3TL, Date, EndTime, SS3);
TL_SetEnd(PPTL, Date, EndTime, PP);

If PlaceTextRight then begin
Text_SetLocation(R1Txt, Date, EndTime, RR1);
Text_SetLocation(R2Txt, Date, EndTime, RR2);
Text_SetLocation(R3Txt, Date, EndTime, RR3);
Text_SetLocation(S1Txt, Date, EndTime, SS1);
Text_SetLocation(S2Txt, Date, EndTime, SS2);
Text_SetLocation(S3Txt, Date, EndTime, SS3);
Text_SetLocation(PPTxt, Date, EndTime, PP);
end; //If PlaceTextRight then begin...
end; //If HaveTLs then begin...

end; //If Monday2Friday then begin...
end
else
RaiseRunTimeError( "Somente Intraday." ) ;

Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	139
Size:	213.4 KB
ID:	243145  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures True Range Report
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

flerte,

this appears to be the code that I posted once. However some some parts, comments and the header are removed removed. I would suggest to download a full, working version here on futures.io, the MC forum or my website etc..

Regards,

ABCTG


flerte View Post
Dear, could anyone help?

I am a beginner and I can not hit the formula, the PPivot bars do not follow when prices move to the right. They stay static without moving.


Code:


Inputs:
StartCalcTime (0000),
EndCalcTime (2359),
PlaceTextRight (true),
PlotatDateChange (true),
PlotToDateEnd (true),
IgnoreWeekends (true),
TLSize (1),
TLStyle (1),
PivColor (yellow),
R1Color (red),
R2Color (red),
R3Color (red),
S1Color (green),
S2Color (green),
S3Color (green);

Variables:
Monday2Friday (false),
RR1 (0),
RR2 (0),
RR3 (0),
SS1 (0),
SS2 (0),
SS3 (0),
PP (0),
RR1TL (0),
RR2TL (0),
RR3TL (0),
SS1TL (0),
SS2TL (0),
SS3TL (0),
PPTL (0),
DayHi (-999999),
DayLo (+999999),
HaveTLs (false),
StartTime (0),
EndTime (0),
R1Txt (0),
R2Txt (0),
R3Txt (0),
S1Txt (0),
S2Txt (0),
S3Txt (0),
PPTxt (0),
SessClose (0),
TextStyleHoriz (1), //0: To the right of the bar specified for the text object
//1: To the left of the bar specified for the text object
//2: Centered on the bar specified for the text object
TextStyleVert (2); //0: Beneath the price specified for the text object
//1: Above the price specified for the text object
//2: Centered on the specified price location of the text object
if BarType <= 1 or BarType >= 5 then
begin

If IgnoreWeekends then begin
If DayOfWeek(Date) >= Monday and DayOfWeek(Date) <= Friday then
Monday2Friday = true
else
Monday2Friday = false;
end
else begin
Monday2Friday = true;
end;
´
If Monday2Friday then begin

If Date <> Date[1] then begin
If PlaceTextRight then
TextStyleVert = 1;

If PlotatDateChange then
StartTime = Time
else
StartTime = StartCalcTime;

EndTime = Time[1];

PP = (DayHi + DayLo + SessClose[1])/3 ;
RR1 = PP * 2 - DayLo;
RR2 = PP + DayHi - DayLo;
RR3 = RR2 + DayHi - DayLo;
SS1 = PP * 2 - DayHi;
SS2 = PP - DayHi + DayLo;
SS3 = SS2 - DayHi + DayLo;

DayHi = -999999;
DayLo = +999999;
HaveTLs = false;

end; //If Date <> Date[1] then begin...

If Time > StartCalcTime and Time <= EndCalcTime then begin
If High >= DayHi then DayHi = High;
If Low <= DayLo then DayLo = Low;
If BarStatus(1) = 2 then
SessClose = Close;
end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...

If HaveTLs = false then begin
HaveTLs = true;

RR1TL = TL_New(Date, StartTime, RR1, Date, EndTime, RR1);
TL_SetColor(RR1TL, R1Color);
TL_SetSize(RR1TL, TLSize);
TL_SetStyle(RR1TL, TLStyle);

RR2TL = TL_New(Date, StartTime, RR2, Date, EndTime, RR2);
TL_SetColor(RR2TL, R2Color);
TL_SetSize(RR2TL, TLSize);
TL_SetStyle(RR2TL, TLStyle);

RR3TL = TL_New(Date, StartTime, RR3, Date, EndTime, RR3);
TL_SetColor(RR3TL, R3Color);
TL_SetSize(RR3TL, TLSize);
TL_SetStyle(RR3TL, TLStyle);

SS1TL = TL_New(Date, StartTime, SS1, Date, EndTime, SS1);
TL_SetColor(SS1TL, S1Color);
TL_SetSize(SS1TL, TLSize);
TL_SetStyle(SS1TL, TLStyle);

SS2TL = TL_New(Date, StartTime, SS2, Date, EndTime, SS2);
TL_SetColor(SS2TL, S2Color);
TL_SetSize(SS2TL, TLSize);
TL_SetStyle(SS2TL, TLStyle);

SS3TL = TL_New(Date, StartTime, SS3, Date, EndTime, SS3);
TL_SetColor(SS3TL, S3Color);
TL_SetSize(SS3TL, TLSize);
TL_SetStyle(SS3TL, TLStyle);

PPTL = TL_New(Date, StartTime, PP, Date, EndTime, PP);
TL_SetColor(PPTL, PivColor);
TL_SetSize(PPTL, TLSize);
TL_SetStyle(PPTL, TLStyle);

R1Txt = Text_New(Date, StartTime, RR1, "R1");
Text_SetStyle(R1Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(R1Txt, R1Color);

R2Txt = Text_New(Date, StartTime, RR2, "R2");
Text_SetStyle(R2Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(R2Txt, R2Color);

R3Txt = Text_New(Date, StartTime, RR3, "R3");
Text_SetStyle(R3Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(R3Txt, R3Color);

S1Txt = Text_New(Date, StartTime, SS1, "S1");
Text_SetStyle(S1Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(S1Txt, S1Color);

S2Txt = Text_New(Date, StartTime, SS2, "S2");
Text_SetStyle(S2Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(S2Txt, S2Color);

S3Txt = Text_New(Date, StartTime, SS3, "S3");
Text_SetStyle(S3Txt, TextStyleHoriz, TextStyleVert);
Text_SetColor(S3Txt, S3Color);

PPTxt = Text_New(Date, StartTime, PP, "PP");
Text_SetStyle(PPTxt, TextStyleHoriz, TextStyleVert);
Text_SetColor(PPTxt, PivColor);
end //If HaveTLs = false then begin...
else begin
If PlotToDateEnd then
EndTime = EndTime
else
EndTime = EndCalcTime;

TL_SetEnd(RR1TL, Date, EndTime, RR1);
TL_SetEnd(RR2TL, Date, EndTime, RR2);
TL_SetEnd(RR3TL, Date, EndTime, RR3);
TL_SetEnd(SS1TL, Date, EndTime, SS1);
TL_SetEnd(SS2TL, Date, EndTime, SS2);
TL_SetEnd(SS3TL, Date, EndTime, SS3);
TL_SetEnd(PPTL, Date, EndTime, PP);

If PlaceTextRight then begin
Text_SetLocation(R1Txt, Date, EndTime, RR1);
Text_SetLocation(R2Txt, Date, EndTime, RR2);
Text_SetLocation(R3Txt, Date, EndTime, RR3);
Text_SetLocation(S1Txt, Date, EndTime, SS1);
Text_SetLocation(S2Txt, Date, EndTime, SS2);
Text_SetLocation(S3Txt, Date, EndTime, SS3);
Text_SetLocation(PPTxt, Date, EndTime, PP);
end; //If PlaceTextRight then begin...
end; //If HaveTLs then begin...

end; //If Monday2Friday then begin...
end
else
RaiseRunTimeError( "Somente Intraday." ) ;


Follow me on Twitter Reply With Quote




Last Updated on October 30, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts