PureBytes Links
Trading Reference Links
|
Yes.
1. Tomasz's original implementation expected a scaler for the 'howmany' argument, not an array.
Your modification is not correct since you are iterating through the first 'howmany' elements of the array and comparing that value to your counting variable. This will cause an exit at a non deterministic point since it depends on the content of the array. This is not at all what you want. The counter and the array are completely unrelated.
2. Adding a text column would always print the last value of the array provided. It does not allow different values on a bar by bar basis (i.e. if you ran the exploration on a range, all dates would have the same text value).
Mike
--- In amibroker@xxxxxxxxxxxxxxx, "gmorlosky" <gmorlosky@xxx> wrote:
>
> Is that why this isn't producing any repeated "|" in the Explore cells ?
>
> Filter = 1;
> i = 0;
> Buy = Close >0;
> Sell = Close < 0;
>
> function Rept( string, howmany )
> {
> result = "";
> for( i = 0; i < howmany[i]; i++ ) result += string; // changed to howmany[i] because an array was required ???
> return result;
> }
>
> Y = RSI();
> _TRACE ("Y "+ Y );
> X = Rept("|",Y); // replacing Y with a number works fine ???
>
> AddTextColumn (FullName(), "Fullname",1.0);
> AddTextColumn(X,"RSI", 1.2);
> AddColumn (RSI(),"RSI",1.2);
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@> wrote:
> >
> > I suspect that the more common request would be to have the function return an array for bar by bar results.
> >
> > Based on that assumption, the problem with coding our own Rept function is that we cannot add text, that changes bar by bar, to an exploration.
> >
> > In order to get an Exploration to give bar by bar output comparable to the original graph we could use some creative coding and generate a graph using the numerical values 1, 11, 111, etc.
> >
> > In the following example it is assumed that:
> >
> > - The values to be plotted have all been normalized to be within the range 0..100
> > - Floating point precision is limited to 16 characters and thus 100% can at best be represented by 16 bars. This means that each '1' of the bar graph represents 100/16 = 6.25%.
> >
> > The approach would then be to use powers of 10 to add 1's to the graph column and a format string of 16.0 to truncate any remaining decimal places.
> >
> > In this example, RSI is used since it is already normalized as per the first assumption.
> >
> > Pattern = 0.1111111111111111;
> > Exponent = floor( RSI() / ( 100 / 16 ) );
> > Graph = Pattern * ( 10 ^ Exponent );
> >
> > Filter = 1;
> > AddColumn( RSI(), "RSI" );
> > AddColumn( Exponent, "Exponent" );
> > AddColumn( Graph, "Graph", 16.0 );
> >
> > Last thing to do would be to try and get rid of the commas in the graph.
> >
> > Mike
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@> wrote:
> > >
> > > Hello,
> > >
> > > You can implement it on your own:
> > >
> > > function Rept( string, howmany )
> > > {
> > > result = "";
> > > for( i = 0; i < howmany; i++ ) result += string;
> > > return result;
> > > }
> > >
> > >
> > >
> > >
> > > Best regards,
> > > Tomasz Janeczko
> > > amibroker.com
> > > ----- Original Message -----
> > > From: "gmorlosky" <gmorlosky@>
> > > To: <amibroker@xxxxxxxxxxxxxxx>
> > > Sent: Tuesday, May 19, 2009 8:57 PM
> > > Subject: [amibroker] TJ - WishList - bar charts in cells of Explore
> > >
> > >
> > > > TJ:
> > > >
> > > > What is the possibility of enhancing the Explore spreadsheet wiht this technique:
> > > > http://infosthetics.com/archives/2006/08/excel_in_cell_graphing.html
> > > >
> > > > which is a simple repeat of characters to create bar charts
> > > > REPT("|",percentage)
> > > >
> > > >
> > > >
> > > > ------------------------------------
> > > >
> > > > **** IMPORTANT PLEASE READ ****
> > > > This group is for the discussion between users only.
> > > > This is *NOT* technical support channel.
> > > >
> > > > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > > > SUPPORT {at} amibroker.com
> > > >
> > > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > > > http://www.amibroker.com/feedback/
> > > > (submissions sent via other channels won't be considered)
> > > >
> > > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > > > http://www.amibroker.com/devlog/
> > > >
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > >
> >
>
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
|