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

[amibroker] Re: Help : Trying to plot a 15 min StochD on a 3 min chart - Got a solution



PureBytes Links

Trading Reference Links

First thanks to everyone for your suggestions. After sending in the
question to Amibroker help the told me its not possible but instead
should use a 1 min chart as the base and produce the StochD from that
base chart. So this is the code i'm using to produce a 5 and 15 min
StochD (I know the orginal question was for a 3 and 10 min but it
works for those time frames also).  The only problem i'm having is
getting the StochD to keep its color in between the times for the 5
and 15 min StochD. If anyone has a possible solution I would love to
see it. I've tried, but failed on the 15 min code below. I also plot
the 5 and 15 min bars in sub-charts of the 1 min chart so I can see
what these bars are looking like. I've included that code below the
StochD code. Its a copy of the example given by Amibroker. Also does
anyone know how to change the paramaters on the PlotGrid to something
other than dotted and change its thickness.

Thanks,
Mark


_SECTION_BEGIN("Two time StochD");
T15 = 600;

Color15[0] = colorRed;
TimeFrameSet( T15 );
tstoch15 = StochD( 6 , 3, 3); 
TimeFrameRestore();

tstoch15xx = TimeFrameExpand( tstoch15, T15 );

Color15 = IIf(tstoch15xx == Ref(tstoch15xx, -1), colorYellow,
		IIf(tstoch15xx > Ref(tstoch15xx, -1), colorGreen, colorRed));

Plot( tstoch15xx, "10min", Color15, ParamStyle("Style") );

T5 = 180;

TimeFrameSet( T5);
tstoch5= StochD( 5 , 5, 6); 
TimeFrameRestore();

tstoch5x = TimeFrameExpand( tstoch5, T5);

Plot( tstoch5x, "3min" , IIf(tstoch5x > Ref(tstoch5x, -1), colorGreen,
colorRed), styleThick);
_SECTION_END();



/// code for plotting 5 min bars on a 1 min chart
T5 = 300;  // 5 min
t5_O = TimeFrameGetPrice( "O", T5, 0, expandPoint );
t5_H = TimeFrameGetPrice( "H", T5, 0, expandPoint );
t5_L = TimeFrameGetPrice( "L", T5, 0, expandPoint );
t5_C = TimeFrameGetPrice( "C", T5, 0, expandPoint );
PlotOHLC( t5_O, t5_H, t5_L, t5_C, "5 MIN", colorBlack, styleCandle );


--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> If the periods used are not exact multiples then you will get the
best fit
> 10 minute over 3 minute bars will mean that the 10 minutes will
> autofit to the underlying time period, generally being closest to the
> 10 minute
> 3 minute bars
930,933,936,939,942,945,948,951,954,957,1003,1006,1009,1012
> 10 minute bars, 930,939,948,957,1009
> 
> Also remember that the value of the "10 minute bar" will be that for
> the end of the previous "10" minute period as you are using the
> default expandlast
> 
> -- 
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://www.aflwriting.com
> 
> 
> 
> On 25/01/07, mbluhm2001 <mbluhm2001@xxx> wrote:
> > I'm only comparing the 10 min  StochD(  15 , 3, 3) expanded on the 3
> > min chart to a 10 min StochD(  15 , 3, 3)  on a 10 min chart and they
> > are different. The TWO code snippets below will hopefully will help
> > clear up the confusion.
> >
> > This code is running on a  3 MIN Chart:
> >
> > _SECTION_BEGIN("Test");
> >
> > T2 = 600; // 10 min
> >
> > TimeFrameSet( T2 );
> > tstoch10 = StochD( 15 , 3, 3);
> > TimeFrameRestore();
> >
> > /* expand T2 stoch */
> > tstoch10 = TimeFrameExpand( tstoch10, T2);
> >
> >
> > Plot( tstoch10, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ),
> > ParamStyle("Style") );
> > _SECTION_END();
> >
> >
> > This code is running on a 10 MIN chart:
> >
> >
> > _SECTION_BEGIN("Test");
> >
> >
> > tstoch10 = StochD( 15 , 3, 3);
> > Plot( tstoch10, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ),
> > ParamStyle("Style") );
> >
> > _SECTION_END();
> >
> > They are giving me different values at time during the day where they
> > should be the same.  If I do the same thing on a 2 min chart and
> > compare this code to a 10 min chart then at the correct time frames
> > they are the same.
> >
> > Thanks,
> > Mark
> >
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "apfxtrader" <apfx@> wrote:
> > >
> > > You have different parameters on tstoch10 and tstoch. Correct it and
> > > they will perfectly match on a 10 min timeframe.
> > >
> > >
> > >
> > >
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "mbluhm2001" <mbluhm2001@> wrote:
> > > >
> > > > Thanks for your suggestion but it works the same way with the
> > > > different name. Any other ideas?
> > > >
> > > > Thanks,
> > > > Mark
> > > >
> > > >
> > > >
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@> wrote:
> > > > >
> > > > > I think you can't change an array from the same array.
> > > > > Try a different name for the expansion such as:
> > > > >
> > > > > /* expand T2 stoch */
> > > > > tstoch10expanded = TimeFrameExpand( tstoch10, T2);
> > > > > --
> > > > > Terry
> > > > >
> > > > > -----Original Message-----
> > > > > From: amibroker@xxxxxxxxxxxxxxx
[mailto:amibroker@xxxxxxxxxxxxxxx]
> > > > On Behalf
> > > > > Of mbluhm2001
> > > > > Sent: Wednesday, January 24, 2007 10:32
> > > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > > Subject: [amibroker] Help : Trying to plot a 15 min StochD
on a 3
> > > > min chart
> > > > >
> > > > > I'm trying to plot the 10 min StochD onto a 3 min time frame
chart
> > > > > using the code below. I get the two StochD but when I
compare the 10
> > > > > min StochD on this chart to a 10min chart with the StochD
they don't
> > > > > match. Can someone tell me what I'm doing wrong?
> > > > >
> > > > > Thanks,
> > > > > Mark
> > > > >
> > > > >
> > > > >
> > > > > _SECTION_BEGIN("Test");
> > > > >
> > > > > T2 = 600;  // 10 min
> > > > >
> > > > > TimeFrameSet( T2 );
> > > > > tstoch10 = StochD( 15 , 3, 3);
> > > > > TimeFrameRestore();
> > > > >
> > > > > /* expand T2 stoch */
> > > > > tstoch10 = TimeFrameExpand( tstoch10, T2);
> > > > >
> > > > > tstoch = StochD( 15 , 5, 9);
> > > > >
> > > > >
> > > > > Plot( tstoch10, _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ),
> > > > > ParamStyle("Style") );
> > > > > Plot( tstoch, _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ),
> > > > > ParamStyle("Style") );
> > > > >
> > > > >
> > > > > _SECTION_END();
> > > > >
> > > > >
> > > > >
> > > > > Please note that this group is for discussion between users
only.
> > > > >
> > > > > To get support from AmiBroker please send an e-mail directly to
> > > > > SUPPORT {at} amibroker.com
> > > > >
> > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check
DEVLOG:
> > > > > http://www.amibroker.com/devlog/
> > > > >
> > > > > For other support material please check also:
> > > > > http://www.amibroker.com/support.html
> > > > >
> > > > > Yahoo! Groups Links
> > > > >
> > > >
> > >
> >
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.11/652 - Release Date: 1/25/2007 3:32 PM