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

[amibroker] Re: A technical question



PureBytes Links

Trading Reference Links




<FONT 
face=Arial size=2>My final choice, a bit more complicated but this solution 
includes the very first and very last bar of data. This code is useful when you 
want calculations only performed for display purposes (in idicators) and not on 
the whole price array. In contrast to Backtesting, for trading purposes one 
usually doesn't to calculate the whole 10+ years of data. Of course you 
should provide adequate pre-display data for moving averages 
etc.
<FONT 
face=Arial size=2> 
<FONT 
face=Arial size=2>herman
<FONT 
face=Arial size=2> 
<FONT 
face=Arial size=2>// Begin and End Display markers
<FONT 
size=2>BV = Status<FONT 
color=#000000>("barvisible"<FONT 
size=2>); // array is 1 during visible 
barsFirstBarVisible = BV>Ref<FONT 
color=#000000>(BV,-1) 
OR (<FONT 
color=#0000ff>BarIndex()==<FONT 
color=#ff00ff>0<FONT 
color=#000000>); // a single bar marker at first bar of 
displayLastBarVisible = (BV==1<FONT 
color=#000000> AND 
Ref(BV,<FONT 
color=#ff00ff>1)==<FONT 
color=#ff00ff>0) <FONT 
color=#ff0000>OR (<FONT 
color=#0000ff>BarIndex() == <FONT 
color=#0000ff>LastValue(<FONT 
color=#0000ff>BarIndex<FONT 
color=#000000>()));   // a single bar markerDisplayStartIndex = 
ValueWhen(<FONT 
color=#0000ff>Cross(BV,<FONT 
color=#ff00ff>0) <FONT 
color=#ff0000>OR (<FONT 
color=#0000ff>BarIndex()==<FONT 
color=#ff00ff>0),<FONT 
color=#0000ff>BarIndex<FONT 
color=#000000>()); // number giving the Start indexDisplayEndIndex = 
ValueWhen<FONT 
color=#000000>(LastBarVisible,<FONT 
color=#0000ff>BarIndex<FONT 
color=#000000>()); // number giving the End index of display<FONT 
color=#0000ff>Plot(FirstBarVisible,<FONT 
color=#ff00ff>"FBV",<FONT 
color=#ff00ff>4,<FONT 
color=#ff0000>styleArea|<FONT 
color=#ff0000>styleOwnScale|<FONT 
color=#ff0000>styleNoLabel,-.05,<FONT 
color=#ff00ff>1.05<FONT 
color=#000000>); // debugging plots only<FONT 
color=#0000ff>Plot(LastBarVisible,<FONT 
color=#ff00ff>"LBV",<FONT 
color=#ff00ff>1,<FONT 
color=#ff0000>styleArea|<FONT 
color=#ff0000>styleOwnScale|<FONT 
color=#ff0000>styleNoLabel,-.05,<FONT 
color=#ff00ff>1.05<FONT 
color=#000000>); Plot<FONT 
color=#000000>(DisplayStartIndex,"Start"<FONT 
color=#000000>,6<FONT 
color=#000000>,1<FONT 
color=#000000>|<FONT 
color=#ff0000>styleNoLine<FONT 
face=Arial>); <FONT 
color=#0000ff>Plot(DisplayEndIndex,<FONT 
color=#ff00ff>"End",<FONT 
color=#ff00ff>6,<FONT 
color=#ff00ff>1|<FONT 
color=#ff0000>styleNoLine<FONT 
face=Arial>); <FONT 
color=#ff0000>GraphXSpace = <FONT 
color=#ff00ff>5<FONT face=Arial 
size=2>; 
<FONT 
face=Arial size=2>


<FONT face=Arial 
size=2> 
Just hadn't woken up 
yet... this is one solution of probably many: 
<FONT face=Arial 
size=2> 
startpoint = 
Status(<FONT 
color=#ff00ff>"barvisible"<FONT 
face=Arial>); <FONT 
color=#0000ff>Plot(StartPoint,<FONT 
color=#ff00ff>"SP",<FONT 
color=#ff00ff>1,<FONT 
color=#ff00ff>1<FONT 
color=#000000>); FirstBarVisible = startpoint - <FONT 
color=#0000ff>Ref( startpoint, -<FONT 
color=#ff00ff>1<FONT 
color=#000000> ); Plot<FONT 
color=#000000>(FirstBarVisible,"FBV"<FONT 
color=#000000>,4<FONT 
color=#000000>,styleArea<FONT 
color=#000000>|styleOwnScale<FONT 
color=#000000>,0<FONT 
color=#000000>,1<FONT 
size=2>); LastBarVisible = 
StartPoint==1 <FONT 
color=#ff0000>AND <FONT 
color=#0000ff>Ref(StartPoint,<FONT 
color=#ff00ff>1)==<FONT 
color=#ff00ff>0<FONT 
color=#000000>; Plot<FONT 
color=#000000>(LastBarVisible,"LBV"<FONT 
color=#000000>,1<FONT 
color=#000000>,styleArea<FONT 
color=#000000>|styleOwnScale<FONT 
color=#000000>,0<FONT 
color=#000000>,1); 

<SPAN 
class=640550300-16012004> 
<SPAN 
class=640550300-16012004>herman.
<SPAN 
class=640550300-16012004> 
<SPAN 
class=640550300-16012004> 
<SPAN 
class=640550300-16012004> 
<SPAN 
class=640550300-16012004>Hello,
<SPAN 
class=640550300-16012004> 
I need a single bar 
signal during the first and last bar in my Display. I solved the first one like 
this:
<SPAN 
class=640550300-16012004> 
startpoint = 
Status(<FONT 
color=#ff00ff>"barvisible"<FONT 
face=Arial>); FirstBarVisible = startpoint - 
Ref( startpoint, 
-1 ); 

<SPAN 
class=640550300-16012004> 
Is there a similar 
command to detect the last bar in the display?
<SPAN 
class=640550300-16012004> 
many 
thanks,
<SPAN 
class=640550300-16012004>herman<FONT face=Arial 
size=2>Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
<FONT 
face=Arial 
size=2>http://groups.yahoo.com/group/amiquote/messages/)<FONT 
face=Arial size=2>--------------------------------------------Check group 
FAQ at: <A 
href=""><FONT 
face=Arial 
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT 
size=2> 
<FONT 
face=Arial size=2>

Yahoo! Groups Links
  To visit your group on the web, go 
  to:<FONT 
  face=Arial size=2>http://groups.yahoo.com/group/amibroker/<FONT 
  face=Arial size=2>  
  To unsubscribe from this group, send an email 
  to:<A 
  href=""><FONT 
  face=Arial size=2>amibroker-unsubscribe@xxxxxxxxxxxxxxx<FONT 
  face=Arial size=2>  
  Your use of Yahoo! Groups is subject to the 
  <FONT face=Arial 
  size=2>Yahoo! Terms of Service. 



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.