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

Re: [amibroker] Re: Error 47



PureBytes Links

Trading Reference Links

I get no error from the get price, but I have made a few changes in
order to get a plot, and overcome some errors in your code
PlotText location values cannot be arrays, so have made them LastValue


SetChartOptions( 0, chartShowDates|chartWrapTitle );
GraphXSpace=10;
_N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}} "+_DEFAULT_NAME()+" :
{{OHLCX}} {{VALUES}}" );

Plot( C, "", ParamColor( "Price Colour", colorGrey50), ParamStyle(
"Price Style", styleBar, maskPrice ) );


_SECTION_BEGIN("Daily_Pivots");
H1=TimeFrameGetPrice( "H", inDaily, -1 );
L1=TimeFrameGetPrice( "L", inDaily, -1 );
C1=TimeFrameGetPrice( "C", inDaily, -1 );

/*PIVOT Calculation*/
p = ( H1+ L1 + C1 )/3;
s1 = (2*p)-H1;
r1 = (2*p)-L1;
s2 = p -(H1 - L1);
s3 = S1 - (H1-L1);
r2 = p +(H1 - L1);
r3 = R1 +(H1-L1);

Plot (p,"Pivot",25,2048);
PlotText("PIVOT",BarCount,LastValue(p),25);
Plot (r1,"R1",40,2048);
PlotText("R1",BarCount,LastValue(r1),40);
Plot (r2,"R2",40,2048);
PlotText("R2",BarCount,LastValue(r2),40);
Plot (r3,"R3",40,2048);
PlotText("R3",BarCount,LastValue(r3),40);
Plot (s1,"S1",3,2048);
PlotText("S1",BarCount,LastValue(s1),3);
Plot (s2,"S2",3,2048);
PlotText("S2",BarCount,LastValue(s2),3);
Plot (s3,"S3",3,2048);
PlotText("S3",BarCount,LastValue(s3),3);
_SECTION_END();


-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com




2008/6/12 sidhartha70 <sidhartha70@xxxxxxxxx>:
> Can anyone from AB comment on this error...?
>
> Thanks
>
> --- In amibroker@xxxxxxxxxxxxxxx, "sidhartha70" <sidhartha70@xxx> wrote:
>>
>> The following simple daily pivots code is giving me an Error 47 when
>> applied ONLY to tick charts (I am looking at 200 tick bars for
>> example)... However the code works perfectly on (x) min charts...
>>
>> The error seems to occur at the TimeFrameGetPrice() functions.
>>
>> Any ideas...?
>>
>> _SECTION_BEGIN("Daily_Pivots");
>> H1=SelectedValue(TimeFrameGetPrice( "H", inDaily, -1 ));
>> L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 ));
>> C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));
>>
>> /*PIVOT Calculation*/
>> p = ( H1+ L1 + C1 )/3;
>> s1 = (2*p)-H1;
>> r1 = (2*p)-L1;
>> s2 = p -(H1 - L1);
>> s3 = S1 - (H1-L1);
>> r2 = p +(H1 - L1);
>> r3 = R1 +(H1-L1);
>>
>> Plot (p,"Pivot",25,2048);
>> PlotText("PIVOT",BarCount,p,25);
>> Plot (r1,"R1",40,2048);
>> PlotText("R1",BarCount,r1,40);
>> Plot (r2,"R2",40,2048);
>> PlotText("R2",BarCount,r2,40);
>> Plot (r3,"R3",40,2048);
>> PlotText("R3",BarCount,r3,40);
>> Plot (s1,"S1",3,2048);
>> PlotText("S1",BarCount,s1,3);
>> Plot (s2,"S2",3,2048);
>> PlotText("S2",BarCount,s2,3);
>> Plot (s3,"S3",3,2048);
>> PlotText("S3",BarCount,s3,3);
>> _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

<*> 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/