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

[amibroker] Re: Drawing yesterday high/low lines in an intraday chart



PureBytes Links

Trading Reference Links

Lester, thank you for your help.  
Please review below attached these two versions and  several syntax 
errors. Because I'm a newbie for coding, so I can not correct these 
errors by myself. Any help is very appreciated

1.
/*** START ***/

// High and Low in a specified time frame
startTime = 093000;
endTime = 103000;

// add-on plugin functions
hgh = deTimeRangeHHV (H, startTime, endTime);
lwl = deTimeRangeLLV (L, startTime, endTime);
cls = deValueWhenTime(C, endTime);

H_plot = IIf(TimeNum()>=endTime, hgh, Null);
L_plot = IIf(TimeNum()>=endTime, lwl, Null);
C_plot = IIf(TimeNum()>=endTime, cls, Null);

Plot(H_plot, "", colorLightBlue, styleLine);
Plot(L_plot, "", colorOrange, styleLine);
Plot(C_plot, "", colorDarkYellow, styleLine);

Plot(C,"",26,64);

Title = "\\c11"+Interval(2)+" "+
Date()+"\\c-1 H="+H+" L="+L+" C="+C;

SetChartOptions(0, chartShowDates);

/*** END ***/


Ln: 8, Col: 22 : Error 30, Syntax error
Ln: 9, Col: 22 : Error 30, Syntax error
Ln: 10, Col: 22 : Error 30, Syntax error
Ln: 12, Col: 37 : Error 29, Variable 'hgh' used without having been 
initialized.
Ln: 13, Col: 37 : Error 29, Variable 'lwl' used without having been 
initialized.
Ln: 14, Col: 37 : Error 29, Variable 'cls' used without having been 
initialized.


2.
// High and Low in a specified time frame 
startTime = 153000; 
endTime = 163000; 

tt = IIf(TimeNum() >= startTime AND TimeNum() <= endTime,1,0); 
dtt = tt - Ref(tt,-1); 

// add-on plugin functions 
hgh = deTimeRangeHHV (H, startTime, endTime); 
lwl = deTimeRangeLLV (L, startTime, endTime); 
//cls = deValueWhenTime(C, endTime); 

H_plot = IIf(TimeNum()>=endTime, hgh, Null); 
L_plot = IIf(TimeNum()>=endTime, lwl, Null); 
//C_plot = IIf(TimeNum()>=endTime, cls, Null); 
C_Plot = IIf(!tt,ValueWhen(Ref(dtt,1) == -1,C),Null); 

Plot(H_plot, "", colorLightBlue, styleLine); 
Plot(L_plot, "", colorOrange, styleLine); 
Plot(C_plot, "", colorDarkYellow, styleLine); 

SetChartOptions(0, chartShowDates); 
Plot(C,"",26,64); 

Title = "\\c11"+Interval(2)+" "+ 
Date()+"\\c-1 H="+H+" L="+L+" C="+C; 

Ln: 9, Col: 22 : Error 30, Syntax error
Ln: 10, Col: 22 : Error 30, Syntax error
Ln: 13, Col: 37 : Error 29, Variable 'hgh' used without having been 
initialized.
Ln: 14, Col: 37 : Error 29, Variable 'lwl' used without having been 
initialized.



--- In amibroker@xxxxxxxxxxxxxxx, "Lester Vanhoff" <ebsn247lsm@xxx> 
wrote:
>
> There are two final versions of the code.
> 
> In most cases this one (the shorter of the two) is sufficient, 
except that it shouldn't be used with illiquid tickers or very short 
time frames, like bars below one minute:
> 
> http://finance.groups.yahoo.com/group/amibroker/message/106471
> 
> For illiquid tickers and seconds long bars you need to use the 
second code. It is modified to make sure that Close Line is plotted 
even if there is no bar present at Close Time.
> 
> http://finance.groups.yahoo.com/group/amibroker/message/106487
> 
> If you need to plot the lines across midnight then further 
modifications are likely required.
> 
> Lester
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "cstdc5588" <cstdc5588@> wrote:
> >
> > Lester, thank you very much for you help. I'll read and try to 
find 
> > which coding is working.
>




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/