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

RE: Custom Indicators for Periods Loaded and First Loaded Closing Price



PureBytes Links

Trading Reference Links

Thanks to Allen at Equis and Aongas for responding to my question
directed at formulation of a "Buy and Hold" custom indicator. Just after
my post I came across a way to create this indicator using the
predefined Performance indicator, but their comments were instructive
and useful nonetheless. Thought I'd share the final indicator with the
list. To compare the "Buy and Hold" performance with the results from a
System test drop the following custom indicator into the same Equity
Curve inner window that the System test produces. Change the default
initial equity to whatever you normally use in System tests.

    InitialEquity:= Input("Enter the initial equity",100,10000,3000);
    Equity:= InitialEquity*( 1 + Per()/100);
    Equity

Note: Another way to arrive at the identical results is:

    InitialEquity:= Input("Enter the initial equity",100,10000,3000);
    1stClose:=  ValueWhen(1, Cum(1) = 1, CLOSE);
    Equity:= InitialEquity*CLOSE / 1stClose;
    Equity


Indebted to Allen for suggesting the ValueWhen function to find the
first loaded CLOSE.

Aongas suggested:
> To solve the "buy and hold" question, why not just create a System that
> enters a long position:
> c > 0;
> Don't put anything in for the exit condition and the system will then
> calculate the total return and percentage gain for the available data.
> 
This also works but requires a separate System test; I found the custom
indicator approach more useful for my purposes. Thanks again.

Charles