Hi,
I am hoping to have someone point me in the correct direction.
Below is my intraday code to compute tomorrows pivot points and
S1,S2,S3
R1,R2,R3
In the title line of my intraday chart is displayed daily cummulative
quotes for close open volume etc and tomorrows pivots.
see code below
even though my price graph is in 5 minute timeframe increments i
switch to a daily time frame to compute yesterdays close, high and
low and am able to compute the pivots for the following day correctly.
i have 2 questions which i hope someone can answer:
1) i need to click twice on a bar to get the values to display on
the title for price chart (the first click shows most of the fields
as empty values). why? may i get around this?
2) i tried using the plot command(see last line of code). i expected
a single straight line plotted on my intraday chart ( a different one
for each day). But i think i cannot
plot it correctly since each of
the arrays is in daily timeframe rather than 5 minute timeframe(which
is the display timeframe for the chart.) would populating an array
with the same value for all the intraday timeframe fix the problem?
which command do i use to do this? or is there a better way
Thank you in advance for your help and consideration
Tony
// compute pivot points for next day when using intraday charts
TimeFrameSet( inDaily ); // switch to daily frame
OpenDailyYest = Ref(Open ,-1);
CloseDailyYest = Ref(Close,-1) ;
HighDailyYest = Ref(High ,-1);
LowDailyYest = Ref(Low ,-1);
OpenDaily = Open ;
CloseDaily = Close ;
HighDaily = High ;
LowDaily = Low ;
VolumeDaily= Volume;
TimeFrameRestore( ) ; // restore time frame to original
PP = (HighDailyYest + LowDailyYest + CloseDailyYest) / 3;
R1 = (2 * PP) - LowDailyYest ;
S1 = (2 * PP) - HighDailyYest ;
R2 = PP +
(R1 - S1);
S2 = PP - (R1 - S1);
R3 = HighDailyYest + 2*(PP - LowDailyYest );
S3 = LowDailyYest - 2*(HighDailyYest - PP);
Title = Name() + " " + Date() + " Close="+ WriteVal
(CloseDaily ,5.2)+ "
Days Open = "+ WriteVal (OpenDaily ,5.2)+ "
Days Gain/Loss= "+ WriteVal ((closeDaily- ref(closeDaily, -1)),2.3) + "
Days High = "+ WriteVal (HighDaily,5. 2)+ "
Days Low = "+ WriteVal (LowDaily,5. 2)+ "
Days Volume = "+ WriteVal (volumeDaily, 10.0)+"
Days Range = "+ WriteVal (highDaily-lowDaily ,8.2)+"
//DaysDelta= "+ WriteVal (close-open, 8.2)+"
TomorrowPP= "+ WriteVal (PP,8.2)+"
TomorrowS1= "+ WriteVal (S1,8.2)+"
TomorrowS2= "+ WriteVal (S2,8.2)+"
TomorrowS3= "+ WriteVal (S3,8.2)+"
TomorrowR1= "+ WriteVal (R1,8.2)+"
TomorrowR2= "+ WriteVal (R2,8.2)+"
TomorrowR3= "+ WriteVal (R3,8.2) ;
Plot (PP,"PP",colorRed) ;