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

[amibroker] Controlling the Built-in Equity Plot


  • To: "AmiBroker YahooGroups" <amibroker@xxxxxxxxxxxxxxx>
  • Subject: [amibroker] Controlling the Built-in Equity Plot
  • From: "Herman van den Bergen" <psytek@xxxxxxxx>
  • Date: Sat, 2 Oct 2004 17:26:13 -0400

PureBytes Links

Trading Reference Links

These comment pertain to the "Equity Line" Built-in Indicator as used with
Individual Backtests. In addition to plotting from indicator formula windows
you can plot indicators directly from the AA (very useful for debugging) if
you insert /* below the

    //--equity-plot-- do not remove this line

line. Like so:

    //--equity-plot-- do not remove this line
    /*

this in effect comments out the Built-in Equity plot. Doing this you can add
Plot() statements to your system's code and plot these by clicking the
"Equity" button in the AA (a backtest is required after each code change).
To prevent having to insert/delete the /* each time you want to switch
between the Built-In Equity plot and your own plots you can curly-bracket
the Buit-in Equity code and make it conditional on the state of a
StaticVariable you can control from any AA code, the Built-In equity plot
now looks like ths:
/**/
//--equity-plot-- do not remove this line
if (IsEmpty(StaticVarGet("ShowBuiltinEquityPlot")))
StaticVarSet("ShowBuiltinEquityPlot",1);
if (StaticVarGet("ShowBuiltinEquityPlot"))
{
MaxGraph=0;GraphXSpace=5;
GraphZOrder=1;
Plot( Equity( 0, -2 ), "Equity", -8, styleArea );
// now buy and hold simulation
Short=Cover=0;
Buy=Status("firstbarintest");
Sell=Status("lastbarintest");
SetTradeDelays(0,0,0,0); PositionSize = -100;
ApplyStop(0,0,0,0);
ApplyStop(1,0,0,0);
ApplyStop(2,0,0,0);
Plot( Equity( 0, -2 ), "Buy&Hold", -9 );
}

Now you can control display of the Built-In Equity Plot directly from your
AA code, without the /* edit,  using this line:

StaticVarSet("ShowBuiltinEquityPlot",0); // Set argument 1 to plot Buil-In
Equity Plot

best regards,

herman.





[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> 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/