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

[amibroker] Re: plotting x against y



PureBytes Links

Trading Reference Links

OK thanks. Indeed currently I use another program for this type of 
analysis but it would be cool if it could be done in Amibroker :)

regards, Ed 


--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> Ok I misunderstood, sorry
> 
> Excel probably best for that
> 
> Cheers,
> Graham
> http://groups.msn.com/ASXShareTrading
> http://groups.msn.com/FMSAustralia 
> 
> -----Original Message-----
> From: ed2000nl [mailto:pablito@x...] 
> Sent: Thursday, 30 October 2003 8:49 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: plotting x against y
> 
> 
> Graham,
> 
> I'm not sure I understand exactly what you mean. I see two lines in 
> your chart where the x-axis is still plotted againt the date.
> 
> As an example what I would like to do the following code(see 
below). 
> I calculate the array "resu". This array is plotted against the y- 
axis.
> However I get the date against the x-axis. And actually I want 
> to draw not the date against the x-axis but the array "fra". I want 
> to plot "fra against resu" and I will get only one line in the 
chart.
> 
> regards, Ed
> 
> 
> the code:
> 
> profit_chances = Param("profit_chances",75,0,100,0.1);
> profit_perc = Param("profit_perc",2,0,100,0.1);
> loss_perc = Param("loss_perc",10,0,100,0.1);
> 
> fra=BarIndex()/(BarCount-1);
> resu=fra;
> 
> loss_chances = 100 - profit_chances;
> 
> for (j=0;j<BarCount;j++) {
> 
> acc=1;
> 
> 	for (i=0;i<profit_chances;i++) {
> 
> 		acc = acc + (acc*fra[j])*(profit_perc/100);
> 		i=IIf(acc < 0.01,profit_chances-1,i);
> 
> 	}
> 
> 	for (i=0;i<loss_chances;i++) {
> 
> 		acc = acc - (acc*fra[j])*(loss_perc/100);
> 		i=IIf(acc < 0.01,loss_chances-1,i);
> 
> 	}
> 
> resu[j]=acc;
> 
> }
> 
> resu = resu * 100 - 100;
> 
> Plot(resu,"",1,1);
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> > Ed
> > I have given this some thought and done a simple plot of xx and yy
> on a
> > single chart
> > 
> > z = IIf(BarIndex()<BarCount-100,Null,1);
> > 
> > xx = 3*Cum(z);
> > yy = 2*Cum(z);
> > 
> > Plot(xx,"xx",colorRed,styleLine); Plot
(yy,"yy",colorGreen,styleLine);
> > 
> > 
> > 
> > Cheers,
> > Graham
> > http://groups.msn.com/ASXShareTrading
> > http://groups.msn.com/FMSAustralia
> > 
> > -----Original Message-----
> > From: ed2000nl [mailto:pablito@x...]
> > Sent: Thursday, 30 October 2003 5:59 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: plotting x against y
> > 
> > 
> > hi Graham,
> > 
> > indeed I'm trying to get xx on the horizontal and yy on the
> vertical 
> > axis. This just in an attempt to see if I could use AFL to plot
> > statistics and stuff like that about stock analysis as well.
> > 
> > My example with xx and yy was just some example. Although I would
> > like to plot two arrays (xx and yy) of the same length, they are 
> not 
> > directly related. E.g. plotting the re-invested fraction of 
account
> > per wager (xx) versus profitability (yy).
> > 
> > But it is no big deal. I guess one would need a function like Plot
> > (xx,yy,"") for that,
> > 
> > regards, Ed
> > 
> > > The yy would need to a function of xx though
> > > needing to be related somehow
> > > 
> > > Xbar = barcount - 99 + xx;
> > > Ybar = valuewhen( Xbar,  yy );
> > > 
> > > Plot(yy,"yy",colorblue,styledots);
> > 
> > 
> > 
> > 
> > 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 
> > 
> > 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 
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/


------------------------ 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
---------------------------------------------------------------------~->

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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/