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

[amibroker] Re: Visible range shown on chart



PureBytes Links

Trading Reference Links

Bill -

Yes. You need to use LastValue() to get a scalar value.  But even 
with that, I think that your code will have an issue if you scroll 
back in time and right tick is not the last bar.  For a quick 
solution, try -

data = Close;
Minvalue = LastValue(Lowest(IIf(Status("barvisible"), data, 999999)));
Maxvalue = LastValue(Highest(IIf(Status("barvisible"), data, 
  -999999)));

-- Bruce R.


--- In amibroker@xxxxxxxxxxxxxxx, "BillBarack" <wbarack@xxxx> wrote:
> Graham,
> 
> No, its not in the PortValue statement. I succesfully plotted it 
> without trying the styleownscale functionality. Having been 
> succesful, I was trying to shrink the plot to the bottom half of 
the 
> screen to make room for an extensive Title statement.
> 
> For some reason, it doesn't like the HighestSince, LowestSince, 
HHV, 
> LLV functions used to define MinVal and MaxVal.
> 
> When I put in:
> 
> BarRange = LVB - FVB +1;
> MinVal = 0.8 * LastValue(LLV(PortValue,BarRange));
> MaxVal = 1.5*LastValue(HHV(PortValue,BarRange));
> 
> it works. Is the answer that HighestSince, LowestSince, HHV, LLV 
are 
> all arrays? and LastValue makes it a scalar which is what MinValue 
> and MaxValue want in the Plot statement?
> 
> That's my best guess.
> 
> Bill
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> > Sounds like something in the Portvalue statement ?
> > 
> > 
> > Cheers,
> > Graham
> > http://groups.msn.com/asxsharetrading
> > http://groups.msn.com/fmsaustralia 
> > 
> > -----Original Message-----
> > From: BillBarack [mailto:wbarack@x...] 
> > Sent: Friday, 19 December 2003 7:11 AM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: Visible range shown on chart
> > 
> > 
> > 
> > 
> > Graham,
> > 
> > Thanks, it helps, but I keep getting error messages. Any ideas 
> here? 
> > Am I mixing variable types or something like that?
> > 
> > Bill
> > PortValue = my expression;
> > 
> > Try #1:
> > barvisible = Status("barvisible");
> > //firstvisiblebar = barvisible AND NOT Ref( barvisible, -1 ); FVB 
=
> > barvisible AND NOT Ref( barvisible, -1 ); LVB = barvisible AND NOT
> > Ref(barvisible,1); BarRange = LVB - FVB +1; MinVal =
> > LLV(PortValue,BarRange); MaxVal = HHV(PortValue,BarRange);
> > 
> > Error Message for Try #1:
> > 
> > Line 182, Column 61:
> > 
> > Plot(PortValue,"",colorBlack,4|styleOwnScale,MinVal, MaxVal);
> > ------------------------------------------------------------^
> > 
> > Bad args.
> > 5-th argument of function call has invalid (or unsupported) type
> > 
> > Try #2:
> > barvisible = Status("barvisible");
> > //firstvisiblebar = barvisible AND NOT Ref( barvisible, -1 ); FVB 
=
> > barvisible AND NOT Ref( barvisible, -1 ); LVB = barvisible AND NOT
> > Ref(barvisible,1); MinVal = LowestSince(FVB,PortValue); MaxVal =
> > HighestSince(FVB,PortValue);
> > Plot(PortValue,"",colorBlack,4|styleOwnScale,MinVal, MaxVal);
> > 
> > Error Message for Try #2:
> > Line 178, Column 61:
> > MinVal = LowestSince(FVB,PortValue);
> > MaxVal = HighestSince(FVB,PortValue);
> > Plot(PortValue,"",colorBlack,4|styleOwnScale,MinVal, MaxVal);
> > ------------------------------------------------------------^
> > 
> > Bad args.
> > 5-th argument of function call has invalid (or unsupported) type
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> > > Use
> > > Status( "barvisible" );
> > > 
> > > Returns 1 if the bar is on screen
> > > 
> > > 
> > > 
> > > Cheers,
> > > Graham
> > > http://groups.msn.com/asxsharetrading
> > > http://groups.msn.com/fmsaustralia
> > > 
> > > -----Original Message-----
> > > From: BillBarack [mailto:wbarack@x...]
> > > Sent: Friday, 19 December 2003 6:21 AM
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: [amibroker] Visible range shown on chart
> > > 
> > > 
> > > I've been struggling, trying to find a way to express in AFL, 
the
> > > range currently shown on the chart. By this I mean, the Last 
bar 
> > > visible minus the first bar visible.
> > > 
> > > Can anyone point me in the right direction?
> > > 
> > > Thanks
> > > 
> > > Bill
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > 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:
> > http://docs.yahoo.com/info/terms/
> > 
> > 
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > 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 Sponsor -------------------
--
> ~--> Buy
> > Ink Cartridges or Refill Kits for your HP, Epson, Canon or 
Lexmark 
> Printer
> > at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
> > http://www.c1tracking.com/l.asp?cid=5511
> > http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
> > ------------------------------------------------------------------
--
> -~->
> > 
> > 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:  
> http://docs.yahoo.com/info/terms/


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:
 http://docs.yahoo.com/info/terms/