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

[amibroker] Re: How to copy indicator values to Excel



PureBytes Links

Trading Reference Links

you can use fputs() function to write equity array data to a file.
here's some sample code to get you started.
http://www.amibroker.com/library/detail.php?id=327&hilite=fputs


--- In amibroker@xxxxxxxxxxxxxxx, "ges x" <ges8ges@xxx> wrote:
>
> Thanks again, Herman.
> 
> But isn't the 'equity()' function only for single security backtests?
> 
> I'm doing portfolio backtesting.
> 
> So...I'm still looking for a way to extract the equity curve data for
> portfolio backtests.
> 
> ges
> 
> 
> On 2/12/07, Herman <psytek@xxx> wrote:
> >
> >    simply write and explorations, i think someone suggested that
early on.
> > Like so:
> >
> >
> > Buy=Cross( MACD(), Signal() );
> >
> > Sell=Cross( Signal(), MACD() );
> >
> > Filter=1;
> >
> > E= Equity(1);
> >
> > DT=DateTime();
> >
> > AddColumn(E,"Eq");
> >
> >
> > Send this to the AA and run an Exploration. Click on the chart,
copy and
> > paste to Excel.
> >
> >
> > best regards,
> >
> > herman
> >
> >
> > Monday, February 12, 2007, 7:09:49 PM, you wrote:
> >
> >
> >    >
> >
> > Herman,
> >
> >
> >
> > Thank you very much!  What you describe would be helpful, but I'd
still
> > like to be able to pull this equity curve data into Excel.
> >
> >
> >
> > It will be easier for me to compare and, especially, to blend
these curves
> > in Excel.
> >
> >
> >
> > Let me ask it this way...
> >
> >
> >
> > Isn't there some way to get the data values for these equity
curves out of
> > AB?  Surely there is.  For that matter, it could be handy on
occasion to get
> > the values for an indicator out of AB.
> >
> >
> >
> > So...bottom line...isn't there some way to copy these data values
out of
> > AB?
> >
> >
> >
> > Thanks again...
> >
> >
> >
> > ges
> >
> >
> >
> >
> > On 2/12/07, Herman <psytek@xxx> wrote:
> >
> > OK, I don't quite know what you are doing.
> >
> >
> > However total portfolio equities are available as "~~~Equity"
Tickers that
> > can be plotted using an indicator using Foreign("~~~Equity","C").
Equities
> > from other backtests can be saved adding a AddToComposite() to the
code so
> > that they can be plotted in the same manner. I don't think you
need to go
> > through the trouble of using excel, you may also run out of space
there if
> > you have many bars.
> >
> >
> > Tomasz wrote some code
> >
http://www.amibroker.com/kb/2006/03/11/how-to-create-copy-of-portfolio-equity/
<http://www.amibroker.com/kb/2006/03/11/how-to-create-copy-of-portfolio-equity/>
showing
> > you how to copy such equity files so that you collect them by
name, data,
> > test number, or ParamStr() and plot them from indicators. If you
name them
> > sequentially numbered you can use a small loop to overlay them in an
> > indicator chart.
> >
> >
> >
> > SetCustomBacktestProc("");
> >
> > if( Status("action") == actionPortfolio )
> >
> > {
> >
> >  bo = GetBacktesterObject();
> >
> >  bo.Backtest();
> >
> >  AddToComposite( Foreign("~~~EQUITY","C"),
> >
> >                  "~~~MY_EQUITY_COPY", "X",
> >
> >                  atcFlagDeleteValues | atcFlagEnableInPortfolio );
> >
> > }
> >
> >
> > best regards,
> >
> > herman
> >
> >
> >
> >
> > Monday, February 12, 2007, 2:22:11 PM, you wrote:
> >
> >
> >    >
> >
> > Herman,
> >
> >
> >
> > Thanks, but I'm afraid I don't follow you.
> >
> >
> >
> > To clarify, what I'd like to do is take the equity curve data
(primarily
> > total portfolio value)  from portfolio backtests of multiple different
> > systems and then import that data Excel so I can plot those equity
curves
> > together and compare them or blend the curves.
> >
> >
> >
> > Does that make sense?
> >
> >
> >
> > Thanks.
> >
> >
> >
> >
> > On 2/12/07, Herman <psytek@xxx> wrote:
> >
> > Running your system from an indicator and plotting all equities
> > simultaneously on your chart is far easier.
> >
> >
> > best regards,
> >
> > herman
> >
> >
> > Monday, February 12, 2007, 1:42:35 PM, you wrote:
> >
> >
> >    >
> >
> > Lester,
> >
> >
> >
> > Thanks.
> >
> >
> >
> > Now...what I'd really like to do, is get the daily values for the
equity
> > graph out of AB and into Excel, so I can compare equity graphs between
> > different systems, or even combine them to see how the blended systems
> > equity graph would look.
> >
> >
> >
> > I can run the backtests and export the cumulative profit to Excel
and plot
> > the graph of the equity growth, but the data points won't
necessarily line
> > up.
> >
> >
> >
> > I would really like to be able to get the equity graph values out
of AB
> > and into Excel and I have the notion that this should not be hard
to do, but
> > I have yet to see how it can be done.
> >
> >
> >
> > Any other ideas?
> >
> >
> >
> > Thanks!
> >
> >
> >
> >
> > On 2/12/07, Lester Vanhoff <ebsn247lsm@xxx > wrote:
> >
> > Automatic Analysis - run your exploration - hit Export button - then
> > import the CSV file to Excel.
> >
> >
> > Lester
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx <amibroker%40yahoogroups.com>, "ges"
> > <ges8ges@> wrote:
> >
> > >
> >
> > > I have a feeling this is a stupid question as I think it must be
easy
> >
> > > to do, but I can't figure it out...
> >
> > >
> >
> > > How can I copy the values for an indicator (or more to the
point, the
> >
> > > values for an equity graph) to Excel for further analysis?
> >
> > >
> >
> > > I want to get the numeric values out of AB and copy them over to the
> >
> > > spreadsheet.
> >
> > >
> >
> > > Thanks,
> >
> > >
> >
> > > ges
> >
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 
> >
>



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.39/687 - Release Date: 2/14/2007 4:17 PM