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

[amibroker] Re: TJ - WishList - bar charts in cells of Explore



PureBytes Links

Trading Reference Links

Thanks for pointing that out. I see what you mean.

Here is my working code:
// "Diff" is a number between -100 and 100

function Rept( string1, howmany )
{
result = "";
for( i = 0; i < howmany; i++ ) result += string1;
return result;
}

Y = LastValue (int(abs(Diff)));
X = Rept("|",Y);

AddTextColumn ( X, "Diff_reps", 1.0,
   IIf( Diff == 0, colorWhite,
   IIf( Diff > 0 , colorGreen,
   IIf( Diff < 0, colorRed, colorDefault ))),colorDefault, 220 );





--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> Your code is just a duplication of Tomasz's function when passing LastValue(RSI()) as argument.
> 
> The argument you've passed looks into the future and will always produce the same output regardless of the range selected. The results will be wrong for any exploration except a range of length 1 on the very last bar.
> 
> Mike
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "gmorlosky" <gmorlosky@> wrote:
> >
> > I fiddled around with the concept and if I use LastValue, it works perfect.
> > 
> > repeats = "";
> > string1 = "|";
> > Y = LastValue(int(RSI()));
> > for( i = 0; i < Y; i++ )
> > {
> > repeats += string1;
> > }
> > 
> > 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "gmorlosky" <gmorlosky@> 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/