Hi,
What you are suggestiong is going to be both difficult and error prone.
1. I am not aware of any way to get the name of the active formula,
other than using COM to find the active window and parse its titlebar.
2. The filter settings allow you to include from any combination of
group, wathlist, market, etc. as well as simultaneously exclude any of
the same. So, what name would you use for a mixture like that?
You might be better off declaring a ParamStr that you set before the run
such that the value entered is used as the name of the resulting equity
curve. Use the Parameters buttom from the AA window to set the desired
composite name, then run the backtest.
e.g.
SetTradeDelays(0,0,0,0);
SetPositionSize(2, spsPercentOfEquity);
fast = MA(Close, 25);
slow = MA(Close, 200);
Buy = Cross(fast, slow);
Sell = Cross(slow, fast);
atcName = ParamStr("Equity Name", "EC_Custom");
SetCustomBacktestProc("");
if (Status("action") == actionPortfolio) {
bo = GetBacktesterObject();
bo.Backtest();
if (StrFind(atcName, "~") != 1) {
atcName = "~~~" + atcName;
}
AddToComposite(Foreign("~~~Equity", "C"), atcName, "X",
atcFlagDefaults | atcFlagEnableInPortfolio);
}
Mike
--- In [email protected], "f8fcs" <nickdepeys...@...> wrote:
>
> Hi,
>
> I am trying to use one formula file to generate multiple, distinct
equity lines. The idea is that I will just change the "apply to filter"
in Automatic Analysis and run the backtest while not changing the
pointer to the formula file. Each time I run the backtest on a new
filter group, I will create a new equity line that has a label that
reflects the group was being filtered for that particular backtest.
>
> So if I selected a group called "XYZ" for a formula file "ABC", on
running the backtest the equity line might be called "~~~EC_ABC_XYZ"
>
> It is easy enough to create a custom-labeled equity line on a one-off
basis, but I want to make this more flexible by referencing whatever
group I have decided to filter with in Autmoatic ANalysis. The article I
used is here:
>
> TO get this to work, I need to figure out how to obtain the name of
the group that is being filtered. I tried Name(), CategoryGetName() etc
and they don't seem to give the right output.
>