[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Intraday - Open 10 Minute Price Marker



PureBytes Links

Trading Reference Links

Ken,

I must have been thinking more about making the apple crumble than writing code.

Here is the fixup:

http://zboard.wordpress.com/2009/05/29/intraday-markers/

brian_z

--- In amibroker@xxxxxxxxxxxxxxx, "brian_z111" <brian_z111@xxx> wrote:
>
> Sorry mate.
> 
> I have to go and cook tea before the night session.
> 
> I found a 1 bar crash point in my code (BarsSince type functions can do that do you) ... fixed that and managed to get it down to three lines ... changed the plot to a time bound range also.
> 
> Good luck with your code .... the night shift will start arriving soon.
> 
> brian_z
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Ken H <sfehendo@> wrote:
> >
> > Hi Brian
> >  
> > Thanks for the support on this but I am not having much luck getting this code to work.  
> >  
> > Can you see anything wrong with what I have done?
> >  
> > Many thanks
> >  
> > Ken
> >  
> > _SECTION_BEGIN( "Price");
> > TimeFrameSet( in5Minute ); 
> > SetChartOptions( 0,chartShowArrows| chartShowDates );
> > _N(Title = StrFormat("{ {NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
> > Plot( C, "Close", ParamColor(" Color", colorBlack ), styleNoTitle | ParamStyle(" Style") | GetPriceStyle( ) ); 
> > if( ParamToggle( "Tooltip shows", "All Values|Only Prices" ) )
> > {
> > ToolTip=StrFormat( "Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
> > //HHV( ARRAY, periods )
> > ORB = (1000 - 0950)/(Interval( )/60);//OpeningRangeBars
> > Plot(ORB,"OpeningRa ngeBars", 1,1);
> > ORH = HHV( H, ORB );//OpeningRangeHig h
> > TM = IIf(TimeNum( ) == 095000, ORH,Null);// TimeMarker
> > Plot(ValueWhen( TM > 0,TM,1),"LatchedTimeMarker", colorBrightGreen ,1);
> > _SECTION_END();
> > 
> > 
> > 
> > --- On Fri, 29/5/09, brian_z111 <brian_z111@> wrote:
> > 
> > 
> > From: brian_z111 <brian_z111@>
> > Subject: [amibroker] Re: Intraday - Open 10 Minute Price Marker
> > To: amibroker@xxxxxxxxxxxxxxx
> > Received: Friday, 29 May, 2009, 3:07 PM
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Verify Syntax :-)
> > 
> > //P_IntradayMarkers _HL
> > 
> > //Example 1.
> > 
> > //HighestSince( EXPRESSION, ARRAY, Nth = 1 )
> > 
> > LND = Cum(DateNum( ) !=Ref(DateNum( ),-1));// LatchedNewDay
> > 
> > Plot(LND == Ref(LND,-1), "LatchedNewDay" ,1,1);
> > 
> > IDH = HighestSince( LND != Ref(LND,-1), H, 1 );
> > 
> > Plot(IDH,"IntradayH igh",colorBright Green,1);
> > 
> > //////////// ///////// ///////// ///////// ///////// ///////// /
> > 
> > //Example 2.
> > 
> > /*Overlay on intraday charts to show High after defined time (0950 in this example).
> > The OpeningRange == 0950 - 0930 (this assumes the market day starts at 0930).
> > The Plot will adjust automatically when the chart time is changed via the chart icons.
> > Only use chart timeframes that are whole number divisors of the Opening Range.
> > For example 0950 - 0930 == 20 minutes/5 minute bars == 4 == O.K..
> > but 0950 - 0930 == 20 minutes/15 minute bars == 1.333 != O.K.
> > Manually enter the opening range times.
> > 
> > */
> > 
> > //HHV( ARRAY, periods )
> > 
> > ORB = (0950 - 0930)/(Interval( )/60);//OpeningR angeBars
> > 
> > Plot(ORB,"OpeningRa ngeBars", 1,1);
> > 
> > ORH = HHV( H, ORB );//OpeningRangeHig h
> > 
> > TM = IIf(TimeNum( ) == 095000, ORH,Null);// TimeMarker
> > Plot(ValueWhen( TM > 0,TM,1),"LatchedTim eMarker", colorBrightGreen ,1);
> > 
> > --- In amibroker@xxxxxxxxx ps.com, "brian_z111" <brian_z111@ ...> wrote:
> > >
> > > Example 2 assumes that you will not have missing data bars in your chosen timeframe e.g. 5 mins - this should be true for the ASX indexes but possibly not for a ASX midcap - smaller timeframes increase the chance of no trade time bars with low liquidity stock.
> > > 
> > > 
> > > If you want to use it with lightly traded stock then it might work in a chart if you use padded data.
> > > 
> > > 
> > > http://zboard. wordpress. com/2009/ 02/28/display- padded-data/
> > > 
> > > 
> > > 
> > > 
> > > 
> > > //P_IntradayMarkers _HL
> > > 
> > > //Example 1.
> > > 
> > > //HighestSince( EXPRESSION, ARRAY, Nth = 1 )
> > > 
> > > LND = Cum(DateNum( ) !=Ref(DateNum( ),-1));// LatchedNewDay
> > > 
> > > //Plot(LND == Ref(LND,-1), 1,1);
> > > 
> > > IDH = HighestSince( LND != Ref(LND,-1), H, 1 );
> > > 
> > > //Plot(NDH," IntradayHigh" ,colorBrightGree n,1);
> > > 
> > > //////////// ///////// ///////// ///////// ///////// ///////// /
> > > 
> > > //Example 2.
> > > 
> > > /*Overlay on intraday charts to show High after defined time (0950 in this example).
> > > The OpeningRange == 0950 - 0930 (this assumes the market day starts at 0930).
> > > The Plot will adjust automatically when the chart time is changed via the chart icons.
> > > Only use chart timeframes that are whole number divisors of the Opening Range.
> > > For example 0950 - 0930 == 20 minutes/5 minute bars == 4 == O..K.
> > > but 0950 - 0930 == 20 minutes/15 minute bars == 1.333 != O.K.
> > > Manually enter the opening range times.
> > > 
> > > */
> > > 
> > > //HHV( ARRAY, periods )
> > > 
> > > ORB = (0950 - 0930)/(Interval( )/60);//OpeningR angeBars
> > > 
> > > //Plot(ORB," OpeningRangeBars ",1,1);
> > > 
> > > ORH = HHV( H, ORB );
> > > 
> > > P = IIf(TimeNum( ) == 095000, ORH,Null);
> > > Plot(ValueWhen( P > 0,P,1),"IntradayHig h",colorBrightGr een,1);
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > //HighestSince( EXPRESSION, ARRAY, Nth = 1 )
> > > 
> > > 
> > > 
> > > 
> > > --- In amibroker@xxxxxxxxx ps.com, "brian_z111" <brian_z111@ > wrote:
> > > >
> > > > Hello Ken,
> > > > 
> > > > I think RazBarry is in bed at the moment.
> > > > In the interim here are a couple of examples of intraday HL's.
> > > > 
> > > > 
> > > > They show how I go about it:
> > > > 
> > > > - copy/paste function from the AFL reference to show me the way (they also come up automatically in the Formula Editor but sometimes I find the permanent reference helpful the first few times I use a function).
> > > > 
> > > > - plot every line (as far as possible) to get a visual on the output from the code
> > > > 
> > > > - try to write the code to produce the plotted lines that I want.
> > > > 
> > > > 
> > > > Try example 2 - there are other and possibly better ways to do it but I think that is what you want.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > --- In amibroker@xxxxxxxxx ps.com, Ken H <sfehendo@> wrote:
> > > > >
> > > > > Hi
> > > > >  
> > > > > I have modified the code as layed out below but am getting a sytax error after the important time line of code.   This is set at 9.50am so as to align with the Australian SPI open.
> > > > >  
> > > > > Ken
> > > > >  
> > > > > _SECTION_BEGIN( "Price");
> > > > > TimeFrameSet( in5Minute ); 
> > > > > SetChartOptions( 0,chartShowArrows| chartShowDates );
> > > > > _N(Title = StrFormat("{ {NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
> > > > > Plot( C, "Close", ParamColor(" Color", colorBlack ), styleNoTitle | ParamStyle(" Style") | GetPriceStyle( ) ); 
> > > > > if( ParamToggle( "Tooltip shows", "All Values|Only Prices" ) )
> > > > > {
> > > > > ToolTip=StrFormat( "Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
> > > > > }
> > > > > newday = Day() != Ref(Day(), -1);
> > > > > highofday = Ref(HighestSince( newday, H, 1), -1); 
> > > > > Lowofday = Ref(LowestSince( newday, L, 1), -1); 
> > > > > Rangeofday=highofda y-lowofday;
> > > > > importanttime= 95000;
> > > > > 10minuteORhigh = ValueWhen( Cross(TimeNum( ),95000), highofday, 1);
> > > > > 10minuteORlow= .....;
> > > > > StrFormat("newday = %g \nhighofday = %1.4f \nLowofday = %1.4f \n10MinHi = %1.4f", newday, highofday, Lowofday, HighOr10Min );
> > > > > Plot(HighOr10Min , "10 Day", colorRed);
> > > > > 
> > > > > 
> > > > > Need a Holiday? Win a $10,000 Holiday of your choice. Enter now.http://us. lrd.yahoo. com/_ylc= X3oDMTJxN2x2ZmNp BF9zAzIwMjM2MTY2 MTMEdG1fZG1lY2gD VGV4dCBMaW5rBHRt X2xuawNVMTEwMzk3 NwR0bV9uZXQDWWFo b28hBHRtX3BvcwN0 YWdsaW5lBHRtX3Bw dHkDYXVueg- -/SIG=14600t3ni/ **http%3A/ /au.rd.yahoo. com/mail/ tagline/creative holidays/ *http%3A/ /au..docs. yahoo.com/ homepageset/ %3Fp1=other% 26p2=au%26p3= mailtagline
> > > > >
> > > >
> > >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >       Need a Holiday? Win a $10,000 Holiday of your choice. Enter now.http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzk3NwR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=14600t3ni/**http%3A//au.rd.yahoo.com/mail/tagline/creativeholidays/*http%3A//au.docs.yahoo.com/homepageset/%3Fp1=other%26p2=au%26p3=mailtagline
> >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/