PureBytes Links
Trading Reference Links
|
When scanning for signals for the next day, I set the n=1 in
AA. However, from what I can tell of the documentation, the Equity()
function gets its range parameters from AA, ie, n=1 , Sometimes I would
like the "range" values for Equity() to be different than AA, for example in the
little routine below (courtesy of TJ) I would like to set the number of bars to
be worked on as say n=60. Is there any way of doing this? (Note -
that the range I'm interested in is the number of bars to be considered as used
in the Equity() documentation not to be confused with the use of "range"
in the routine below referring to a parameter of the Cross()
function.
Regards,
lou howard
//range.
bestequity = 0;
bestrange = 0;
// optimization loop<FONT
size=1>
for( range =
2; range < <FONT
color=#ff00ff size=1>90; range = (range + <FONT
color=#ff00ff size=1>1) )
{
Buy = Cross(
Close, EMA(
Close, range ) );
Sell = Cross(
EMA( Close, range
), Close );
Le = LastValue(
Equity() );
if( Le >
bestequity )
{
bestequity = Le;
bestrange = range;
}
}
range = bestrange;
Buy = Cross(
Close, EMA(
Close, range ) );
Sell = Cross(
EMA( Close, range
), Close );
Filter = BarIndex<FONT
size=1>() == BarCount - 1<FONT
size=1>;
AddColumn( bestrange,
"Best range" );
AddColumn( <FONT
color=#0000ff size=1>Equity(), <FONT color=#ff00ff
size=1>"Best Equity" );
Plot( <FONT
color=#0000ff size=1>Equity(), <FONT color=#ff00ff
size=1>"equity", colorRed, styleLine);
Plot( <FONT
color=#0000ff size=1>EMA( Close, range ),
"Opt EMA",
colorBlue,
styleLine|styleLeftAxisScale);
Plot( Close,
"close",
colorBrightGreen,
styleLine|styleLeftAxisScale);
Yahoo! Groups Sponsor
ADVERTISEMENT
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 the Yahoo! Terms of Service.
|