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

SV: Calculations from a specific date



PureBytes Links

Trading Reference Links

Thank you Mr.Maas for your help.
Here is the formula for my stop-line (It will cause problems by year end when new month number is less than previous, but that can be sorted out by entering new value from 01.01 with the line value of 12.31.):

Initiell:=Input("Initiell Stop",1,5000,10);
TestYR:=Year();
TestMth:=Month();
YrBuy:=Input("Year Bought",1999,2010,2000);
MthBuy:=Input("Month Bought",1,12,1);
Testday:=TestYR>=YrBuy AND TestMth>=MthBuy;

If(Testday,If(HHV(H - 2.5*ATR(5),20) <LOW,HHV(H -2.5*ATR(5),20),PREV),initiell)

----- Original Message ----- 
Fra: A.J. Maas <anthmaas@xxxxxxxxx>
Til: <metastock@xxxxxxxxxxxxx>
Sendt: 20. februar 2000 02:10
Emne: Re: Calculations from a specific date


> Unfortunatly MSK doesn't carry a DATE function in its formula arsenal.
> 
> One of the closest ways that MSK can come up with S/L or F/C levels
> are the F&C indicators printed below.
> 
> Combined with a continuesly calculated and embedded formula in one of
> the below given formula's, can produce also a continiously, horizontal
> S/L or F/C level of one's own likings throughout the future.
> 
> Breaking conditional If() statements will then help to produce certain
> data to be calculated + displayed whenever the user wants it to, BUT all
> for as long as (some samples are given above and below) program's
> formula language limitations are also taken into considderation.
> Therefore below are functioning (sometimes a bit cripled/mutulated)
> workarounds only.
> 
> 
> Floors % Ceilings
> 
> When plotted (here for example on the DowINDU) will give a horizontal
> Floor @ 10,000 since Jan, 1st 1999.
> 
> Floors % Ceiling indicators (MSKv6.x)
> (6.0 users should not use variables, instead use the definite values)
>     -Floors&Ceilings (Value)
>     -Floors&Ceilings (Date)
>     -Floors&Ceilings (Level)
> 
> Name:
> Floors&Ceilings (Value)
> 
> Formula:
> TestVal:=Input("Stop/Loss Level",1,10000,1);
> TestYR:=Year();
> TestMth:=Month();
> TestD:=DayOfMonth();
> Testday:=TestYR>1998 AND TestMth>0 AND DayOfMonth()>0;
> Testdays:=If(Testday,TestVal,0);
> {C>Testdays}{1=pos,0-neg}
> Testdays {enter 10000 when asked for S/L value}
> 
> Name:
> Floors&Ceilings (Date)
> 
> Formula:
> TestYR:=Year();
> TestMth:=Month();
> TestD:=DayOfMonth();
> Testday:=TestYR>1998 AND TestMth>0 AND DayOfMonth()>0;
> If(Testday,10000,0)
> {TestYR can last for > 1 year, but in combination with
> TestMth will depend on TestMth's value}
> 
> Name:
> Floors&Ceilings (Level)
> 
> Formula:
> 10000  {simply put a value here to get a horizontal line @ that level}
> 
> Regards,
> Ton Maas
> ms-irb@xxxxxxxxxxxxxxxx
> Dismiss the ".nospam" bit (including the dot) when replying.
> Homepage  http://home.planet.nl/~anthmaas