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

[EquisMetaStock Group] Re: indicator that starts from a specified date



PureBytes Links

Trading Reference Links

Shaun,

Let's see if I can totally confuse you. :-)

Straight from Metastock help[top line of your program]:

IF FUNCTION:A conditional function that returns the second parameter 
(THEN) if the conditional expression defined by the first parameter 
is true; otherwise, the third parameter is returned (ELSE).

EXAMPLE	The formula "if(1<2,3,4)" will always return the value three.


Another way to look at this is:
if(condition,value,null)

or if the condition is true,{then} use this value,{else} no value.

In your case it would be:
if({share bought},{stop loss},0)

In your case you will need to consider several factors:

1.Will the actual date of the purchase be needed or could you simply 
use a trigger or barsince condition?

2.In this example you would plot either the stop loss or zero.The 
value between the stop loss and zero may be large. If plotted on a 
price chart it would require a plot of 0 to the stop loss value and 
if prices are around 100 or greater you would have a large price 
display. If plotted in a seperate window it may not be as 
significant. Consider also that this is the case if you plot from 
left to right or from the beginning of the price display. Another 
option and I think what you may be looking for is to plot from right 
to left or from today backwards. This is unorthodox to metastock BUT 
I have seen it done. Let me look through some older post and see if I 
can scrounge up the solution. In the mean time maybe some others will 
be able to glean another method to accomplish the task.

Preston

 



--- In equismetastock@xxxxxxxxxxxxxxx, "shauncris" <spc901@xxxx> 
wrote:
> I want to create a stop loss line that only starts calculating from 
a 
> specified date (when the share was bought).  I can partially do 
this 
> with an 'if' function which tests if the date has yet occurred 
(using 
> dayofmonth, month and year functions).  But the 'if' function 
> requires a formula to use if the result of the test is false (ie 
> before the specified date).  I dont want anything to be displayed 
if 
> the date is before the specified date.  How do I do this?  Is there 
> something like a null value or function I can specify if the 'if' 
> function is false,  or should I be using something other than 
> the 'if' function?
> 
> Thanks
> Shaun


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Your own Online Store Selling our Overstock.
http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/BefplB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/