PureBytes Links
Trading Reference Links
|
Hi,
I recently purchased MetaStock as a trial. I was a SuperCharts user and
had become frustrated with the lack of openness to integrating custom coded
indicators into SuperCharts. But that is off the point....
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.
Hope this helps
Aongus
aflood@xxxxxxxx
-----Original Message-----
From: Charles Kalb <chaskalb@xxxxxxxxxxxxxxxx>
To: metastock-list@xxxxxxxxxxxxx <metastock-list@xxxxxxxxxxxxx>
Date: Tuesday, January 06, 1998 5:39 PM
Subject: Custom Indicators for Periods Loaded and First Loaded Closing Price
>Hello All,
>
>I have been using MetaStock v6.5 for about four months and this is my
>first post to the list. I'd like to offer a little something which might
>be of use to someone and hopefully get a question answered. I have
>developed the following custom indicator for the number of periods
>loaded in a displayed chart:
>
> NumPeriods:= Sum(1, LastValue(Cum(1)));
> NumPeriods {Returns a single point at the right-hand edge of chart
>with the number of periods loaded in the chart.}
>
>It is interesting that I had to use three MetaStock language functions
>to arrive at a constant which must be embedded somewhere within
>MetaStock when a chart is loaded. It would be nice if Equis had provided
>a function which would give the number of loaded periods directly.
>
>But I digress, my objective is to develop a custom indicator which gives
>the "Buy and Hold" performance of a security, something which is useful
>to compare with the results from System testing. Such an indicator
>requires the first loaded value of the closing price. I attempted,
>unsuccessfully, to use the above number of periods loaded in the chart
>to come up with an expression for the first loaded CLOSE:
>
> NumPeriods:= Sum(1,LastValue(Cum(1)));
> 1stCLOSE:= REF(CLOSE, - (NumPeriods - 1));
> 1stCLOSE {Returns a single point with the value of the CLOSE for
>the first period loaded in the chart.}
>
>This custom indicator for the first loaded CLOSE did not work because
>the MetaStock language will not accept a nonconstant value for the
>periods portion of the REF function. By manually inserting the number of
>loaded periods I verified that the above relation is correct but I want
>an indicator which automatically inserts the correct periods loaded.
>Once the first loaded CLOSE is available it is a trivial extention to
>define the "Buy and Hold" performance in an indicator.
>
>Does anyone know how to reference the first loaded value of anything in
>MetaStock?
>
>
>Charles Kalb
>chaskalb@xxxxxxx
>
|