Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: Rea Time Daily Price Levels
Author/Uploader: Ara Kaloustian - ara1 [at] san.rr.com
Date/Time added: 2005-10-10 01:40:26
Origin:
Keywords: Real Time Daily Price Levels
Level: medium
Flags: indicator

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:

This program computes and plots prices levels fir real time data, for following parameters: Toda's Open, Prior Day Open, Clode, High, Low, First hour High, Low.

Formula:

//File: Bruce Chart
//August 5, 2005
//
//Program computes and displays various price values in real time 
//
// Today's Open
// Prior Day High
// Prior Day Low
// Prior Day Open
// Prior Day Close
// Prior Day Middle 
// First Hour High
// First Hour Low

PlotOHLC(Open,High,Low,Close,"",colorBlack,styleCandle);
Bars  = 0;
xpdh  = 90;

//Levels = 1 activates program
Levels     = Param("Levels",1,0,1,1);
ExpFirst   = Param("ExpFirst",1,0,1,1); 

if (Levels ==1)
{
//Convert data to daily
Plot_Range = (TimeNum() >= 63000 AND TimeNum()<= 131500) AND
(DateNum()==LastValue(DateNum()));
FH_Range   = (TimeNum() >= 63000 AND TimeNum()<= 73000) AND
(DateNum()==LastValue(DateNum()));

FH_Prices  = High * FH_Range;
FH_Marker  = BarsSince(FH_Range>0);

//Find number of bars in 60 minutes 
Num_Bars   = 3600 / Interval(1);  

TimeFrameSet(inDaily);
TOP_        = Open;
PDH_        = Ref(High,-1);
PDL_        = Ref(Low,-1);
PDO_        = Ref(Open,-1);
PDC_        = Ref(Close,-1);
PDM_        = (PDH_+PDL_)/2;
TimeFrameRestore();





TOP         = TimeFrameExpand(TOP_,inDaily,expandFirst); 
PDH         = TimeFrameExpand(PDH_,inDaily,expandFirst); 
PDL         = TimeFrameExpand(PDL_,inDaily,expandFirst); 
PDO         = TimeFrameExpand(PDO_,inDaily,expandFirst); 
PDC         = TimeFrameExpand(PDC_,inDaily,expandFirst); 
PDM         = TimeFrameExpand(PDM_,inDaily,expandFirst); 

FHH        = Ref(HHV(High*FH_Range,Num_Bars),-FH_Marker);
FHL        = Ref(LLV(Low,Num_Bars),-FH_Marker);

Bars       = BarsSince(TimeNum() >= 62900 AND TimeNum() <
64400);//,BarIndex(),1); // AND DateNum()==LastValue(DateNum());

x0         = BarCount-LastValue(Bars);

x1         = BarCount-1;
TOP_Line   = LineArray(x0,LastValue(TOP),x1,LastValue(TOP),0);
PDH_Line   = LineArray(x0,LastValue(PDH),x1,LastValue(PDH),0);
PDL_Line   = LineArray(x0,LastValue(PDL),x1,LastValue(PDL),0);
PDC_Line   = LineArray(x0,LastValue(PDC),x1,LastValue(PDC),0);
PDM_Line   = LineArray(x0,LastValue(PDM),x1,LastValue(PDM),0);
FHH_Line   = LineArray(x0,LastValue(FHH),x1,LastValue(FHH),0);
FHL_Line   = LineArray(x0,LastValue(FHL),x1,LastValue(FHL),0);

Plot(TOP_Line,"",colorGreen,styleDashed|styleNoRescale);
Plot(PDH_Line,"",colorPlum,styleLine|styleNoRescale);
Plot(PDL_Line,"",colorRed,styleLine|styleNoRescale);
Plot(PDC_Line,"",colorAqua,styleLine|styleNoRescale);
Plot(PDM_Line,"",colorYellow,styleLine|styleNoRescale);
Plot(FHH_Line,"",IIf(FH_Range==1,Null,colorBlue),styleLine|styleNoRescale);
Plot(FHL_Line,"",IIf(FH_Range==1,Null,colorBlue),styleLine|styleNoRescale);

}



Title = Name() + "  Daily Levels Bruce 1   " + Interval(2) + "  " +
WriteVal(TimeNum(),1.0) + "    Open: " + WriteVal(Open,1.2) + "   High: " +
WriteVal(High,1.2) 
				+ "   Low: " + WriteVal(Low,1.2) + "   Close: " + WriteVal(Close,1.2);

Comments:

Raam
eraam [at] bezeqint.net
2005-10-21 08:30:26
Thank you for your formula.
I can see only: Daily 164,000, and than Open, High, Open, Close.
No other data is available.
What are the parameters: Levels (1,0) and ExpFirst (1,0).
sai
sai20_2000 [at] yahoo.com
2005-11-29 04:43:43
Thanx , but no levels are evident.
jim wiehe

2008-10-13 11:23:05
The code looks right but i cant see the Plot lines
Vinod K. Iyer
vinodkiyer [at] yahoo.com
2009-09-17 11:42:30
For this afl to plot the mentioned values, the following modifications on the formula part above needs to be made as per your country\\\'s exchange market hours, Following is the settings for India (example below).
correct this part:

Plot_Range = (TimeNum() >= 95500 AND TimeNum()<= 153500) AND
(DateNum()==LastValue(DateNum()));
FH_Range = (TimeNum() >= 95500 AND TimeNum()<= 105500) AND
(DateNum()==LastValue(DateNum()));

- where 95500 is 09hrs 55 mins and 00 sec indian standard time at which time the exchange opens for trading and 153500 is 15 30 hrs IST at which time exchange winds up.
and 95500 to 105500 is the first hour range timings (FH_Range)

Replace these timings in 24 hour format for the working hours of the exchanges you trade.


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM