Title: Re: [amibroker] Re: Consistent coding structure problem
Your text messages can only display the condition for ONE selected bar at a time. The SelectedValue() will display the condition for the bar selected by your cursor or, if the cursor is off-screen, for the last bar on the chart.
If you want to display the condition for all visible bars at the same time you have to use a different technique. For example you could use PlotText(), color the bar, plot symbols on the bar, etc. Plotting an indicator at the bottom of your chart is the easiest:
HLRange = abs( H - L );
ABC = HLRange > Ref( HLRange, -1 ) AND HLRange > Ref( HLRange, -2 ) AND HLRange > Ref( HLRange, -3 );
XYZ_Check = IIf( Ref( ABC, -1 ), 1, IIf( Ref( ABC, -2 ), 2, IIf( Ref( ABC, -3 ), 3, 0 ) ) );
ColorOffset = 2;
Plot(C,"",1,128);
Plot( XYZ_Check,"",XYZ_Check+ColorOffset,styleArea|styleOwnScale|stylenolabel,0,50);
If you want to use the condition in another formula (arrays) the coding would depend on what your code requires. Most often you do not need a loop...
best regards,
herman
Thursday, November 6, 2008, 2:10:34 PM, you wrote:
> Thanks Herman.
> I understand why the error occurs... i.e. the 'array' in question has
> a variety of values in it. If the 'array' had only a single value in
> it... for instance if the array was set via a param() statement the
> code would work...
> Question... Does using SelectedValue() or LastValue() stop the working
> across the entire array of prices...?? i.e. it's outside of a loop,
> and I want it work across the whole price array. Will this work...?
> Thanks
> ------------------------------------
> **** IMPORTANT ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
> *********************
> TO GET TECHNICAL 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/
__._,_.___
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL 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
*********************************
__,_._,___
|