NexusFi: Find Your Edge


Home Menu

 





Pivot points - Multicharts


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one ABCTG with 4 posts (3 thanks)
    2. looks_two georgex with 3 posts (1 thanks)
    3. looks_3 hoolio with 2 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,347 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 1 attachments




 
Search this Thread

Pivot points - Multicharts

  #1 (permalink)
 
georgex's Avatar
 georgex 
Prag/czechrepublic
 
Experience: Intermediate
Platform: Multicharts, NinjaTrader
Broker: IB
Trading: Currency
Posts: 3 since Jan 2014
Thanks Given: 0
Thanks Received: 1

Helo,
i have one script Pivot points
For day is formula:
......
if date <> date[1] then begin
....

for month is
...
if month(date) <> month(date)[1] then begin
...

but for week do not work. you have any idea how to do it:

Complete script:
--------------------------------------------------------------------
inputs:
StartCalcTime (0000),
EndCalcTime (2359),
PlaceTextRight (true),
PlotDateChange (true),
PlotToDateEnd (true),
IgnoreWeekends (true),
PivColor (yellow),
R1Color (Red),
R2Color (Red),
R3Color (Red),
S1Color (green),
S2Color (green),
S3Color (green),
TLSize (2),
TLStyle (2);

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,1,2
TextStyleVert (2);//0,1,2


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 week(date)<> week(date)[1] then begin
if PlaceTextRight then
TextStyleVert = 1;

if PlotDateChange then
starttime = Time
else
starttime = StartCalcTime;
endtime = time[1];

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

dayhi = -999999;
Daylo = +999999;
HaveTLs = false;

end;

if time > StartCalcTime and time <= EndCalcTime then begin
if High >= dayhi then dayhi = High;
if Low <=daylo then daylo=Low;
SessClose=close;

end;

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 W");
Text_setstyle(R1Txt,Textstylehoriz, textstylevert);
text_setcolor(R1Txt, R1Color);

R2Txt = text_new(Date, Starttime, RR2,"R2 W");
Text_setstyle(R2Txt,Textstylehoriz, textstylevert);
text_setcolor(R2Txt, R2Color);

R3Txt = text_new(Date, Starttime, RR3,"R3 W");
Text_setstyle(R3Txt,Textstylehoriz, textstylevert);
text_setcolor(R3Txt, R3Color);

S1Txt = text_new(Date, Starttime, SS1,"S1 W");
Text_setstyle(S1Txt,Textstylehoriz, textstylevert);
text_setcolor(S1Txt, S1Color);

S2Txt = text_new(Date, Starttime, SS2,"S2 W");
Text_setstyle(S2Txt,Textstylehoriz, textstylevert);
text_setcolor(S2Txt, S2Color);

S3Txt = text_new(Date, Starttime, SS3,"S3 W");
Text_setstyle(S3Txt,Textstylehoriz, textstylevert);
text_setcolor(S3Txt, S3Color);

PPTxt = text_new(Date, Starttime, PP,"PP W");
Text_setstyle(PPTxt,Textstylehoriz, textstylevert);
text_setcolor(PPTxt, PivColor);

end
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;

end;

end;

if 0=1 then
begin
plot1(PP,"PP",PivColor,TLSize);
end
else begin
Noplot(1);
end;

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Increase in trading performance by 75%
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Spoo-nalysis ES e-mini futures S&P 500
14 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


georgex,

you can use DayOfWeek(Date) to return the day of the week starting with 0 for Sunday, 1 for Monday etc..
So something like to detect a new week:
 
Code
Variables:
DayOfTheWeek(0);

DayOfTheWeek = DayOfWeek(Date);

if DayOfTheWeek < DayOfTheWeek[1] then
	Plot1(+1)
else
	Plot1(0);
Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #4 (permalink)
 
georgex's Avatar
 georgex 
Prag/czechrepublic
 
Experience: Intermediate
Platform: Multicharts, NinjaTrader
Broker: IB
Trading: Currency
Posts: 3 since Jan 2014
Thanks Given: 0
Thanks Received: 1

ABCTG,
Thank you for the quick reply.

I have one problem.

For end of day data is correct.
for live is indicator for last pivot is dot. see it picture.

thank you for answer

Attached Thumbnails
Click image for larger version

Name:	pivot.jpg
Views:	224
Size:	215.4 KB
ID:	146558  
Follow me on Twitter Started this thread Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

georgex,

I am not exactly following your problem, but you can try using this instead:
 
Code
DayOfWeek(Date) < DayOfWeek(Date[1])
By the way may I ask where you got this indicator? As it appears to mainly be code I wrote in 2007 and someone just deleted my notes.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #6 (permalink)
 
georgex's Avatar
 georgex 
Prag/czechrepublic
 
Experience: Intermediate
Platform: Multicharts, NinjaTrader
Broker: IB
Trading: Currency
Posts: 3 since Jan 2014
Thanks Given: 0
Thanks Received: 1

Helo ABCTG,
this code is

Pivot [AUTOLINK]points[/AUTOLINK] indicator code for TradeStation, [AUTOLINK]MultiCharts[/AUTOLINK] & OpenECry

I rewrote the code for their own use.

thank you.

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

Thanks, I hope you didn't pay for it as it should be free.

Regards,
ABCTG


georgex View Post
Helo ABCTG,
this code is

Pivot [AUTOLINK]points[/AUTOLINK] indicator code for TradeStation, [AUTOLINK]MultiCharts[/AUTOLINK] & OpenECry

I rewrote the code for their own use.

thank you.


Follow me on Twitter Reply With Quote
Thanked by:
  #8 (permalink)
 hoolio 
Melbourne, Australia
 
Experience: Intermediate
Platform: NT8, Multicharts,Sierra
Broker: CQG, IB
Trading: YM,CL,GC,6E,6J
Posts: 97 since Mar 2013
Thanks Given: 85
Thanks Received: 60

Hi ABCTG,

How easy it is to insert an input into your v3 of this code where you can turn off the plots for the previous days.

It seems rather cluttered on a higher timeframe chart (eg 30000 ticks on ES) to have every pivot point going back to the start of the chart displayed and it would be great to noplot the previous days or the previous days except yesterday.

Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

Hi hoolio,

not very hard. Do you know a bit of EasyLanguage? You would draw the lines once when you execute the code the first time and then only update the location on later dates.
In case you need help with that post back here and we can modify what you have so far.

Regards,
ABCTG



hoolio View Post
Hi ABCTG,

How easy it is to insert an input into your v3 of this code where you can turn off the plots for the previous days.

It seems rather cluttered on a higher timeframe chart (eg 30000 ticks on ES) to have every pivot point going back to the start of the chart displayed and it would be great to noplot the previous days or the previous days except yesterday.


Follow me on Twitter Reply With Quote
Thanked by:
  #10 (permalink)
 hoolio 
Melbourne, Australia
 
Experience: Intermediate
Platform: NT8, Multicharts,Sierra
Broker: CQG, IB
Trading: YM,CL,GC,6E,6J
Posts: 97 since Mar 2013
Thanks Given: 85
Thanks Received: 60


Thanks ABCTG

A belated reply I know.

I was totally oblivious to the "once" keyword.

Your tutorial number 5 on the ABC website enlightened me

Reply With Quote
Thanked by:




Last Updated on July 14, 2014


© 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